ext/ogg/gstoggdemux.c: Fix sync on broken files. Fixes #158976

Original commit message from CVS:
patch by: Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/ogg/gstoggdemux.c:
Fix sync on broken files.  Fixes #158976
This commit is contained in:
Ronald Bultje 2004-11-23 15:24:28 +00:00 committed by Thomas Vander Stichele
parent 078f68e2a0
commit 25922d3fb2
2 changed files with 13 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2004-11-23 Thomas Vander Stichele <thomas at apestaart dot org>
patch by: Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/ogg/gstoggdemux.c:
Fix sync on broken files. Fixes #158976
2004-11-23 Thomas Vander Stichele <thomas at apestaart dot org>
patch by: Edward Hervey <bilboed@bilboed.com>

View file

@ -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;