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

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 159476: Merge 21611 - Implemented proper pausethenseek behaviour for the media pipeli... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 5 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/filters/ffmpeg_video_decoder.h ('k') | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder.cc
===================================================================
--- media/filters/ffmpeg_video_decoder.cc (revision 21798)
+++ media/filters/ffmpeg_video_decoder.cc (working copy)
@@ -95,11 +95,17 @@
// Everything in the presentation time queue is invalid, clear the queue.
while (!pts_queue_.empty())
pts_queue_.pop();
+
+ // We're back where we started. It should be completely safe to flush here
+ // since DecoderBase uses |expecting_discontinuous_| to verify that the next
+ // time OnDecode() is called we will have a discontinuous buffer.
+ state_ = kNormal;
+ avcodec_flush_buffers(codec_context_);
}
void FFmpegVideoDecoder::OnDecode(Buffer* buffer) {
// During decode, because reads are issued asynchronously, it is possible to
- // recieve multiple end of stream buffers since each read is acked. When the
+ // receive multiple end of stream buffers since each read is acked. When the
// first end of stream buffer is read, FFmpeg may still have frames queued
// up in the decoder so we need to go through the decode loop until it stops
// giving sensible data. After that, the decoder should output empty
@@ -120,6 +126,8 @@
// A catastrophic failure occurs, and decoding needs to stop.
// kFlushCodec -> kDecodeFinished:
// When avcodec_decode_video2() returns 0 data or errors out.
+ // (any state) -> kNormal:
+ // Any time buffer->IsDiscontinuous() is true.
//
// If the decoding is finished, we just always return empty frames.
if (state_ == kDecodeFinished) {
@@ -240,12 +248,6 @@
bool FFmpegVideoDecoder::DecodeFrame(const Buffer& buffer,
AVCodecContext* codec_context,
AVFrame* yuv_frame) {
- // Check for discontinuous buffer. If we receive a discontinuous buffer here,
- // flush the internal buffer of FFmpeg.
- if (buffer.IsDiscontinuous()) {
- avcodec_flush_buffers(codec_context);
- }
-
// Create a packet for input data.
// Due to FFmpeg API changes we no longer have const read-only pointers.
AVPacket packet;
Property changes on: media\filters\ffmpeg_video_decoder.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /trunk/src/media/filters/ffmpeg_video_decoder.cc:r21611
Merged /branches/chrome_webkit_merge_branch/media/filters/ffmpeg_video_decoder.cc:r69-2775
« no previous file with comments | « media/filters/ffmpeg_video_decoder.h ('k') | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698