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

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 11745012: Handle config change during pending reset correctly in FFmpegVideoDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 6f6c49506d54ebe41f26fd474d913bdbd67c202a..a0991f3635bd5317cd0f7cbdda77a09f293ee7df 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -233,6 +233,25 @@ void FFmpegVideoDecoder::BufferReady(
DCHECK(!read_cb_.is_null());
+ if (status == DemuxerStream::kConfigChanged) {
+ if (!ConfigureDecoder()) {
+ base::ResetAndReturn(&read_cb_).Run(kDecodeError, NULL);
+ state_ = kDecodeFinished;
acolwell GONE FROM CHROMIUM 2013/01/03 17:53:31 Why is this needed now? The Read() shouldn't be ca
xhwang 2013/01/04 01:28:05 This transition follows the comment on line 298. I
+ if (!reset_cb_.is_null())
+ base::ResetAndReturn(&reset_cb_).Run();
+ return;
+ }
+
+ if (!reset_cb_.is_null()) {
acolwell GONE FROM CHROMIUM 2013/01/03 17:53:31 nit: If you flip the condition here you can reuse
xhwang 2013/01/04 01:28:05 Done.
+ base::ResetAndReturn(&read_cb_).Run(kOk, NULL);
+ DoReset();
+ return;
+ }
+
+ ReadFromDemuxerStream();
+ return;
+ }
+
if (!reset_cb_.is_null()) {
base::ResetAndReturn(&read_cb_).Run(kOk, NULL);
DoReset();
@@ -244,16 +263,6 @@ void FFmpegVideoDecoder::BufferReady(
return;
}
- if (status == DemuxerStream::kConfigChanged) {
- if (!ConfigureDecoder()) {
- base::ResetAndReturn(&read_cb_).Run(kDecodeError, NULL);
- return;
- }
-
- ReadFromDemuxerStream();
- return;
- }
-
DCHECK_EQ(status, DemuxerStream::kOk);
DecodeBuffer(buffer);
}
« no previous file with comments | « no previous file | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | media/filters/ffmpeg_video_decoder_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698