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

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

Issue 1963343002: Report media error if PlayOutputBuffer failed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Min's comment Created 4 years, 7 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
« no previous file with comments | « media/base/android/audio_media_codec_decoder.h ('k') | media/base/android/media_codec_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/audio_media_codec_decoder.cc
diff --git a/media/base/android/audio_media_codec_decoder.cc b/media/base/android/audio_media_codec_decoder.cc
index bf9939de1e5c381f501e2e9759820b72fb076b26..299a70a48c656f5c0469f19fa2c1d5c267b117b3 100644
--- a/media/base/android/audio_media_codec_decoder.cc
+++ b/media/base/android/audio_media_codec_decoder.cc
@@ -195,7 +195,7 @@ bool AudioMediaCodecDecoder::OnOutputFormatChanged() {
status = media_codec_bridge_->GetOutputChannelCount(&output_num_channels_);
if (status == MEDIA_CODEC_OK && old_num_channels != output_num_channels_) {
- DCHECK_GT(output_sampling_rate_, 0);
+ DCHECK_GT(output_num_channels_, 0);
DVLOG(2) << __FUNCTION__ << ": new channel count " << output_num_channels_;
needs_recreate_audio_track = true;
}
@@ -210,7 +210,7 @@ bool AudioMediaCodecDecoder::OnOutputFormatChanged() {
return true;
}
-void AudioMediaCodecDecoder::Render(int buffer_index,
+bool AudioMediaCodecDecoder::Render(int buffer_index,
size_t offset,
size_t size,
RenderMode render_mode,
@@ -234,10 +234,13 @@ void AudioMediaCodecDecoder::Render(int buffer_index,
int64_t head_position;
MediaCodecStatus status = audio_codec->PlayOutputBuffer(
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);
+
+ if (status != MEDIA_CODEC_OK) {
+ DLOG(ERROR) << class_name() << "::" << __FUNCTION__ << " pts:" << pts
+ << " PlayOutputBuffer failed for index:" << buffer_index;
+ media_codec_bridge_->ReleaseOutputBuffer(buffer_index, false);
+ return false;
+ }
base::TimeTicks current_time = base::TimeTicks::Now();
@@ -297,6 +300,8 @@ void AudioMediaCodecDecoder::Render(int buffer_index,
media_codec_bridge_->ReleaseOutputBuffer(buffer_index, false);
CheckLastFrame(eos_encountered, false); // no delayed tasks
+
+ return true;
}
void AudioMediaCodecDecoder::SetVolumeInternal() {
« no previous file with comments | « media/base/android/audio_media_codec_decoder.h ('k') | media/base/android/media_codec_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698