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

Unified Diff: media/filters/ffmpeg_audio_decoder.cc

Issue 339653003: No EOS frame in {Audio|Video}Decoder::OutputCB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 6 years, 6 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_audio_decoder.cc
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc
index b7e5459df0dc6511945c6df3e3b34ac25cb0a8b8..4fced3fd505c61dfe799445189064229429e7da1 100644
--- a/media/filters/ffmpeg_audio_decoder.cc
+++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -213,34 +213,6 @@ void FFmpegAudioDecoder::DecodeBuffer(
DCHECK(buffer);
- // During decode, because reads are issued asynchronously, it is possible to
- // receive multiple end of stream buffers since each decode 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
- // frames. There are three states the decoder can be in:
- //
- // kNormal: This is the starting state. Buffers are decoded. Decode errors
- // are discarded.
- // kFlushCodec: There isn't any more input data. Call avcodec_decode_audio4
- // until no more data is returned to flush out remaining
- // frames. The input buffer is ignored at this point.
- // kDecodeFinished: All calls return empty frames.
- // kError: Unexpected error happened.
- //
- // These are the possible state transitions.
- //
- // kNormal -> kFlushCodec:
- // When buffer->end_of_stream() is first true.
- // kNormal -> kError:
- // A decoding error occurs and decoding needs to stop.
- // kFlushCodec -> kDecodeFinished:
- // When avcodec_decode_audio4() returns 0 data.
- // kFlushCodec -> kError:
- // When avcodec_decode_audio4() errors out.
- // (any state) -> kNormal:
- // Any time Reset() is called.
-
// Make sure we are notified if http://crbug.com/49709 returns. Issue also
// occurs with some damaged files.
if (!buffer->end_of_stream() && buffer->timestamp() == kNoTimestamp()) {
@@ -265,10 +237,8 @@ void FFmpegAudioDecoder::DecodeBuffer(
return;
}
- if (buffer->end_of_stream()) {
+ if (buffer->end_of_stream())
state_ = kDecodeFinished;
- output_cb_.Run(AudioBuffer::CreateEOSBuffer());
- }
decode_cb.Run(kOk);
}
@@ -357,7 +327,6 @@ bool FFmpegAudioDecoder::FFmpegDecode(
const int decoded_frames = frame_decoded ? output->frame_count() : 0;
if (IsEndOfStream(result, decoded_frames, buffer)) {
DCHECK_EQ(packet.size, 0);
- output_cb_.Run(AudioBuffer::CreateEOSBuffer());
} else if (discard_helper_->ProcessBuffers(buffer, output)) {
output_cb_.Run(output);
}

Powered by Google App Engine
This is Rietveld 408576698