diff --git a/ChangeLog b/ChangeLog index 71d9116b0b..95f2221fa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-11-23 Thomas Vander Stichele + + patch by: Ronald Bultje + * ext/ogg/gstoggdemux.c: + Fix sync on broken files. Fixes #158976 + 2004-11-23 Thomas Vander Stichele patch by: Edward Hervey diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 70b2362176..b8d88e5547 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -1387,11 +1387,6 @@ gst_ogg_demux_push (GstOggDemux * ogg, ogg_page * page) gint64 position, diff; gdouble ratio; - if (ogg->seek_try > 5) { - GST_DEBUG ("Seeking took too long, continuing with current page"); - goto play; - } - /* see if we reached the destination position when seeking */ position = get_relative (ogg, cur, ogg_page_granulepos (page), GST_FORMAT_TIME); @@ -1412,6 +1407,13 @@ gst_ogg_demux_push (GstOggDemux * ogg, ogg_page * page) goto play; } + /* not too long */ + if (ogg->seek_try > 5) { + GST_DEBUG ("Seeking took too long, continuing with current page"); + ogg->seek_to = position; + goto play; + } + /* seek again! yay */ ratio = (gdouble) ogg->seek_to / position; ogg->seek_offset = ogg->seek_offset * ratio;