diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 21:28:29 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 21:28:29 +0000 |
commit | e4284a1a248f08b619b66f0823fefd0838262bd8 (patch) | |
tree | 318351842b4830e306191e638aaff29f3c42997a /third_party/ffmpeg | |
parent | 85ff2c48df0789ae2476cd85738e07cecae9b3e3 (diff) | |
download | chromium_src-e4284a1a248f08b619b66f0823fefd0838262bd8.zip chromium_src-e4284a1a248f08b619b66f0823fefd0838262bd8.tar.gz chromium_src-e4284a1a248f08b619b66f0823fefd0838262bd8.tar.bz2 |
Better seeking for <video> and <audio>
There two problems surrouding the seek feature for
<video> and <audio>:
1. After each seek, the time goes back and forth until
stable, so user has to "fight" the time bar for
seeking.
2. When playing an audio file, sounds plays a litte bit
and then the play position rewinded and plays again.
The cause of above problems:
1. There are demuxed packets and decoded buffers inside
decoders and renderers. When seek is requested only
demuxer flush its buffers, decoders and renderers
still plays a little bit of the old buffer, thus
updating the time incorrectly.
2. When playing a media file, WebKit does:
1. load()
2. pause()
3. seek(0.0f)
4. play()
Since load() does prerolling internally, there were
some decoded buffers in the renderers, and when
seek(0.0f) is fired the play position reset to time
0 and decode starts from there again, the internal
buffer queue in the renderer would then look like:
| 0.0s | | 0.1s | | 0.2s | | 0.0s | | 0.1s | ...
Thus playback at the beginning goes back and forth.
To solve the seek problems, here's what is done in this CL:
1. All decoders and renderers should receive the seek signal.
2. When seek signal is received, discard all buffers and
schedule read again.
With this CL, we can now scrub an <audio> tag with the timebar.
The downside of this fix is that we don't have prerolling
(notice that due to how WebKit starts playing back we didn't
preroll anyway...), this should be fixed in another CL.
Review URL: http://codereview.chromium.org/113891
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/ffmpeg')
-rw-r--r-- | third_party/ffmpeg/avcodec-52.def | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/third_party/ffmpeg/avcodec-52.def b/third_party/ffmpeg/avcodec-52.def index cadf0c0a..1a0649d 100644 --- a/third_party/ffmpeg/avcodec-52.def +++ b/third_party/ffmpeg/avcodec-52.def @@ -8,6 +8,7 @@ EXPORTS avcodec_decode_audio3 avcodec_decode_video2 avcodec_find_decoder + avcodec_flush_buffers avcodec_init avcodec_open avcodec_thread_init |