Commit fe6c7574 authored by Vincent Penquerc'h's avatar Vincent Penquerc'h Committed by Sebastian Dröge

oggdemux: remove eos avoidance workaround

This workaround tried to avoid an EOS event when seeking to the
end of an Ogg stream in order to find its duration. At some point,
an EOS event there would cause any queue2 upstream to pause and
not restart on a seek back to the beginning. This now appears to
not be the case anymore, and so the workaround can be removed.

https://bugzilla.gnome.org/show_bug.cgi?id=767689
parent 9ba54a40
......@@ -50,9 +50,6 @@
/* we hope we get a granpos within this many bytes off the end */
#define DURATION_CHUNK_OFFSET (64*1024)
/* stop duration checks within this much of EOS */
#define EOS_AVOIDANCE_THRESHOLD 8192
/* An Ogg page can not be larger than 255 segments of 255 bytes, plus
26 bytes of header */
#define MAX_OGG_PAGE_SIZE (255 * 255 + 26)
......@@ -1654,8 +1651,7 @@ gst_ogg_pad_handle_push_mode_state (GstOggPad * pad, ogg_page * page)
event and there is a queue2 upstream (such as when using playbin),
it will pause the task *after* we come back from the EOS handler,
so we cannot prevent the pausing by issuing a seek. */
if (ogg->push_byte_offset + EOS_AVOIDANCE_THRESHOLD >=
ogg->push_byte_length) {
if (ogg->push_byte_offset >= ogg->push_byte_length) {
GstMessage *message;
GstFlowReturn res;
......@@ -2420,13 +2416,6 @@ gst_ogg_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
case GST_EVENT_EOS:
{
GST_DEBUG_OBJECT (ogg, "got an EOS event");
#if 0
/* This would be what is needed (recover from EOS by going on to
the next step (issue the delayed seek)), but it does not work
if there is a queue2 upstream - see more details comment in
gst_ogg_pad_submit_page.
If I could find a way to bypass queue2 behavior, this should
be enabled. */
GST_PUSH_LOCK (ogg);
if (ogg->push_state == PUSH_DURATION) {
GST_DEBUG_OBJECT (ogg, "Got EOS while determining length");
......@@ -2438,7 +2427,6 @@ gst_ogg_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
break;
}
GST_PUSH_UNLOCK (ogg);
#endif
res = gst_ogg_demux_send_event (ogg, event);
if (ogg->current_chain == NULL) {
GST_WARNING_OBJECT (ogg,
......@@ -3662,8 +3650,7 @@ gst_ogg_demux_get_duration_push (GstOggDemux * ogg, int flags)
/* A full Ogg page can be almost 64 KB. There's no guarantee that there'll be a
granpos there, but it's fairly likely */
position =
ogg->push_byte_length - DURATION_CHUNK_OFFSET - EOS_AVOIDANCE_THRESHOLD;
position = ogg->push_byte_length - DURATION_CHUNK_OFFSET;
if (position < 0)
position = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment