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

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: 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..e9a81d0f3117f2b248f2daaa5bc2900876fd55d5 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,8 +198,9 @@ void AudioDecoderJob::OnOutputFormatChanged() {
DCHECK(media_codec_bridge_);
int old_sampling_rate = output_sampling_rate_;
- output_sampling_rate_ = media_codec_bridge_->GetOutputSamplingRate();
- if (output_sampling_rate_ != old_sampling_rate)
+ MediaCodecStatus status =
+ media_codec_bridge_->GetOutputSamplingRate(&output_sampling_rate_);
+ if (status != MEDIA_CODEC_OK || output_sampling_rate_ != old_sampling_rate)
qinmin 2016/03/03 23:15:23 if the return status is not MEDIA_CODEC_OK, i thin
watk 2016/03/04 01:33:32 Makes sense. I'm not quite sure how to do that jus
ResetTimestampHelper();
}

Powered by Google App Engine
This is Rietveld 408576698