From 149d818f38a485e45ff88c9e271a897e12cbc1ed Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 26 Jul 2006 15:20:56 +0000 Subject: [PATCH] ext/ogg/gstoggdemux.c: Make seeking in ogg more accurate again by doing the more correct granuletime to stream time c... Original commit message from CVS: * ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain), (gst_ogg_demux_do_seek), (gst_ogg_demux_read_chain): Make seeking in ogg more accurate again by doing the more correct granuletime to stream time conversion. --- ChangeLog | 7 +++++++ ext/ogg/gstoggdemux.c | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 788da86e34..352cc2ff82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-07-26 Wim Taymans + + * ext/ogg/gstoggdemux.c: (gst_ogg_pad_internal_chain), + (gst_ogg_demux_do_seek), (gst_ogg_demux_read_chain): + Make seeking in ogg more accurate again by doing the more correct + granuletime to stream time conversion. + 2006-07-26 Thomas Vander Stichele * gst/tcp/gstmultifdsink.c: (gst_multi_fd_sink_add_full), diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 361c30952d..a76f5b4278 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -135,7 +135,7 @@ struct _GstOggPad GstClockTime start_time; /* the timestamp of the first sample */ gint64 first_granule; /* the granulepos of first page == first sample in next page */ - GstClockTime first_time; /* the timestamp of the second page */ + GstClockTime first_time; /* the timestamp of the second page or granuletime of first page */ ogg_stream_state stream; @@ -1878,12 +1878,12 @@ gst_ogg_demux_do_seek (GstOggDemux * ogg, gint64 position, gboolean accurate, GST_WARNING_OBJECT (ogg, "could not convert granulepos to time"); granuletime = target; } else { - if (granuletime < pad->first_time) + if (granuletime < pad->start_time) continue; - GST_LOG_OBJECT (ogg, "granulepos %" G_GINT64_FORMAT "maps to time %" + GST_LOG_OBJECT (ogg, "granulepos %" G_GINT64_FORMAT " maps to time %" GST_TIME_FORMAT, granulepos, GST_TIME_ARGS (granuletime)); - granuletime -= pad->first_time; + granuletime -= pad->start_time; } GST_DEBUG_OBJECT (ogg,