ext/ogg/gstoggdemux.*: Parse presentation time from skeleton streams and use it as offset for the timestamps. Fixes b...

Original commit message from CVS:
Patch by: j^ <j at oil21 dot org>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone):
* ext/ogg/gstoggdemux.h:
Parse presentation time from skeleton streams and use it as offset
for the timestamps. Fixes bug #530068.
This commit is contained in:
j^ 2008-05-13 07:28:21 +00:00 committed by Sebastian Dröge
parent 0c9b13988c
commit 1a154e1d3d
4 changed files with 18 additions and 3 deletions

View file

@ -1,3 +1,13 @@
2008-05-13 Sebastian Dröge <slomo@circular-chaos.org>
Patch by: j^ <j at oil21 dot org>
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_parse_skeleton_fishead),
(gst_ogg_pad_parse_skeleton_fisbone):
* ext/ogg/gstoggdemux.h:
Parse presentation time from skeleton streams and use it as offset
for the timestamps. Fixes bug #530068.
2008-05-12 Wim Taymans <wim.taymans@collabora.co.uk>
* gst-libs/gst/audio/gstbaseaudiosink.c:

2
common

@ -1 +1 @@
Subproject commit dbf8f3aeceb6e57de097951a670cd853b4886ad8
Subproject commit 2d9c09df0fe4ad3f570fea9f649cfc6c4511080d

View file

@ -547,13 +547,15 @@ gst_ogg_pad_parse_skeleton_fishead (GstOggPad * pad, ogg_packet * packet)
data += 8;
ogg->basetime = gst_util_uint64_scale (GST_SECOND, basetime_n, basetime_d);
ogg->prestime = gst_util_uint64_scale (GST_SECOND, prestime_n, prestime_d);
ogg->have_fishead = TRUE;
pad->is_skeleton = TRUE;
pad->start_time = GST_CLOCK_TIME_NONE;
pad->first_granule = -1;
pad->first_time = GST_CLOCK_TIME_NONE;
GST_INFO_OBJECT (ogg, "skeleton fishead parsed (basetime: %"
GST_TIME_FORMAT ")", GST_TIME_ARGS (ogg->basetime));
GST_TIME_FORMAT ", prestime: %" GST_TIME_FORMAT ")",
GST_TIME_ARGS (ogg->basetime), GST_TIME_ARGS (ogg->prestime));
}
/* function called when a skeleton fisbone is found. Caller ensures that
@ -561,6 +563,7 @@ gst_ogg_pad_parse_skeleton_fishead (GstOggPad * pad, ogg_packet * packet)
static void
gst_ogg_pad_parse_skeleton_fisbone (GstOggPad * pad, ogg_packet * packet)
{
GstOggDemux *ogg = pad->ogg;
GstOggPad *fisbone_pad;
gint64 start_granule;
guint32 serialno;
@ -596,7 +599,8 @@ gst_ogg_pad_parse_skeleton_fisbone (GstOggPad * pad, ogg_packet * packet)
/* padding */
data += 3;
fisbone_pad->start_time = gst_annodex_granule_to_time (start_granule,
fisbone_pad->start_time = ogg->prestime - ogg->basetime;
fisbone_pad->start_time += gst_annodex_granule_to_time (start_granule,
fisbone_pad->granulerate_n, fisbone_pad->granulerate_d,
fisbone_pad->granuleshift);

View file

@ -169,6 +169,7 @@ struct _GstOggDemux
/* annodex stuff */
gboolean have_fishead;
gint64 basetime;
gint64 prestime;
/* ogg stuff */
ogg_sync_state sync;