Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Unified Diff: media/base/android/audio_decoder_job.cc

Issue 1764813002: Catch CodecException in MediaCodecBridge and return MEDIA_CODEC_ERROR (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dale's comment Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/android/audio_decoder_job.cc
diff --git a/media/base/android/audio_decoder_job.cc b/media/base/android/audio_decoder_job.cc
index dd1fa5346f173535812b2f78499828a6f005ed61..f0baca4e94977cdffa80616832f2b84b116f33cb 100644
--- a/media/base/android/audio_decoder_job.cc
+++ b/media/base/android/audio_decoder_job.cc
@@ -105,9 +105,16 @@ void AudioDecoderJob::ReleaseOutputBuffer(
render_output = render_output && (size != 0u);
bool is_audio_underrun = false;
if (render_output) {
- int64_t head_position =
+ bool postpone = false;
+ int64_t head_position;
+ MediaCodecStatus status =
(static_cast<AudioCodecBridge*>(media_codec_bridge_.get()))
- ->PlayOutputBuffer(output_buffer_index, size, offset);
+ ->PlayOutputBuffer(output_buffer_index, size, offset, postpone,
+ &head_position);
+ // TODO(timav,watk): This CHECK maintains the behavior of this call before
+ // we started catching CodecException and returning it as MEDIA_CODEC_ERROR.
+ // It needs to be handled some other way. http://crbug.com/585978
+ CHECK_EQ(status, MEDIA_CODEC_OK);
base::TimeTicks current_time = base::TimeTicks::Now();
@@ -191,7 +198,12 @@ void AudioDecoderJob::OnOutputFormatChanged() {
DCHECK(media_codec_bridge_);
int old_sampling_rate = output_sampling_rate_;
- output_sampling_rate_ = media_codec_bridge_->GetOutputSamplingRate();
+ MediaCodecStatus status =
+ media_codec_bridge_->GetOutputSamplingRate(&output_sampling_rate_);
+ // TODO(timav,watk): This CHECK maintains the behavior of this call before
+ // we started catching CodecException and returning it as MEDIA_CODEC_ERROR.
+ // It needs to be handled some other way. http://crbug.com/585978
+ CHECK_EQ(status, MEDIA_CODEC_OK);
if (output_sampling_rate_ != old_sampling_rate)
ResetTimestampHelper();
}
« no previous file with comments | « content/common/gpu/media/android_video_encode_accelerator.cc ('k') | media/base/android/audio_media_codec_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698