oggdemux: implement push mode seeking
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Sat, 13 Aug 2011 13:18:56 +0000 (14:18 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 16 Sep 2011 18:47:10 +0000 (19:47 +0100)
commit0173afa38cc6f8a2cb810f99a24ddb1d5d5f4868
tree934f1942f80d35dd2c49b8cf1682fe1982cfb812
parenta330ff0721299889e74632751c5a4f592be90f6d
oggdemux: implement push mode seeking

This patch implements seeking in push mode (eg, over the net)
in Ogg, using the double bisection method.
As a side effect, it also fixes duration determination of network
streams, by seeking to the end to check the actual duration.

Known issues:
- Getting an EOS while seeking stops the streaming task, I can't
  find a way to prevent this (eg, by issuing a seek in the event
  handler).
- Seeking twice in a VERY short succession with playbin2 fails
  for streams with subtitles, we end up pushing in a dataqueue
  which is flushing. Rare in normal use AFAICT.
- Seeking is slow on slow links - byte ranges guesses could be
  made better, decreasing the number of required requests
- If no granule position is found in the last 64 KB of a stream,
  duration will be left unknown (should be pretty rare)

https://bugzilla.gnome.org/show_bug.cgi?id=621897
ext/ogg/gstoggdemux.c
ext/ogg/gstoggdemux.h