Chromium Code Reviews| Index: media/filters/ffmpeg_demuxer.cc |
| diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc |
| index 15e77c6aa03b1795066b28db1e92b8bb352611df..451dc4deafef88ec218fb5f477d1c7fc0bf24d85 100644 |
| --- a/media/filters/ffmpeg_demuxer.cc |
| +++ b/media/filters/ffmpeg_demuxer.cc |
| @@ -434,6 +434,20 @@ void FFmpegDemuxerStream::EnableBitstreamConverter() { |
| #endif |
| } |
| +void FFmpegDemuxerStream::ResetBitstreamConverter() { |
| + // If a bitstream converter exists, reset it. |
|
xhwang
2014/10/30 03:36:20
This comment doesn't belong here.
kjoswiak
2014/10/30 17:43:06
Done.
|
| + if (!bitstream_converter_enabled_) |
|
xhwang
2014/10/30 03:36:20
bitstream_converter_enabled_ is inited in ctor, th
kjoswiak
2014/10/30 17:43:06
Done.
|
| + return; |
| + |
| +#if defined(USE_PROPRIETARY_CODECS) |
| + if (!bitstream_converter_) |
| + return; |
| + |
| + bitstream_converter_.reset( |
| + new FFmpegH264ToAnnexBBitstreamConverter(stream_->codec)); |
|
kjoswiak
2014/10/29 20:24:27
Hmm, given https://code.google.com/p/chromium/issu
|
| +#endif // defined(USE_PROPRIETARY_CODECS) |
| +} |
| + |
| bool FFmpegDemuxerStream::SupportsConfigChanges() { return false; } |
| AudioDecoderConfig FFmpegDemuxerStream::audio_decoder_config() { |
| @@ -593,6 +607,13 @@ void FFmpegDemuxer::Seek(base::TimeDelta time, const PipelineStatusCB& cb) { |
| // otherwise we can end up waiting for a pre-seek read to complete even though |
| // we know we're going to drop it on the floor. |
| + FFmpegDemuxerStream* video = GetFFmpegStream(DemuxerStream::VIDEO); |
| + // H264 requires that we resend the header after flush. |
| + // Reset its bitstream for converter to do so. |
| + // This is related to chromium issue 140371 (http://crbug.com/140371). |
| + if (video) |
| + video->ResetBitstreamConverter(); |
|
xhwang
2014/10/30 03:36:20
Instead of doing this, can we handle Resetbitstrea
kjoswiak
2014/10/30 17:44:32
Done.
|
| + |
| // FFmpeg requires seeks to be adjusted according to the lowest starting time. |
| // Since EnqueuePacket() rebased negative timestamps by the start time, we |
| // must correct the shift here. |