diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-12-28 19:23:37 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-12-28 19:23:37 +0100 |
commit | f7775aeae381c15e9836b49cce71257ada4d0b56 (patch) | |
tree | 08106d447d694aed0849de9c9608bb0b6f4da771 | |
parent | c665034742f8f4e5e702ac61e8d26ed6d64f242f (diff) |
oggdemux: don't use invalid segment_start valueoggdemux-fix
The segment start calue is only set while collecting the chain info, if it's not
set, use the current pad value.
-rw-r--r-- | ext/ogg/gstoggdemux.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index c04481d9a..51cbb04ba 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -629,8 +629,11 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet, if (chain->segment_start != GST_CLOCK_TIME_NONE) chain_start = chain->segment_start; + else if (pad->start_time != GST_CLOCK_TIME_NONE) + chain_start = pad->start_time; - current_time = current_time - chain_start + chain->begin_time; + if (current_time != -1) + current_time = current_time - chain_start + chain->begin_time; } /* and store as the current position */ @@ -2975,6 +2978,9 @@ gst_ogg_demux_find_chains (GstOggDemux * ogg) gulong serialno; GstOggChain *chain; GstFlowReturn ret; + guint64 last_stop; + + last_stop = ogg->segment.last_stop; /* get peer to figure out length */ if ((peer = gst_pad_get_peer (ogg->sinkpad)) == NULL) @@ -3029,6 +3035,7 @@ gst_ogg_demux_find_chains (GstOggDemux * ogg) gst_ogg_print (ogg); done: + ogg->segment.last_stop = last_stop; return ret; /*** error cases ***/ |