Fix corrupted audio and video at playback start in ogg containers.
commitf04bdf5d99b0bfc1c989d2b1412153a57d23d56a
authordalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 1 Jul 2014 00:58:28 +0000 (1 00:58 +0000)
committerdalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 1 Jul 2014 00:58:28 +0000 (1 00:58 +0000)
tree9797284a83ed9f2067728c730cbb00532c41d166
parent65a204d3a9ea5a5228dfc198ee9d8a5b618f9612
Fix corrupted audio and video at playback start in ogg containers.

When demuxing ogg containers, FFmpeg will seek to the first packet in the
chosen stream that matches the seek criteria.  However, it does not advance
or rewind other streams in the container to match this timeline.

It's an open question whether FFmpeg is doing the wrong thing here:
http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2014-June/159212.html

To keep things working in the meantime negative audio start times will
be clipped to zero when being considered for seeking.

Additional fixes:
- Fixes non-audio timestamps being incorrectly offset when negative
timestamps are discarded from the audio stream.

BUG=387996
TEST=new unittest, extended existing tests.

Review URL: https://codereview.chromium.org/353563002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280720 0039d316-1c4b-4281-b951-d872f2087c98
media/filters/ffmpeg_demuxer.cc
media/filters/ffmpeg_demuxer.h
media/filters/ffmpeg_demuxer_unittest.cc