mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
ext/ogg/gstoggdemux.c: If there is a stream in a chain without any data packets, ignore the stream in the total lengt...
Original commit message from CVS: * ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet), (gst_ogg_demux_collect_chain_info): If there is a stream in a chain without any data packets, ignore the stream in the total length calculations. Might be related to #436820.
This commit is contained in:
parent
1e2c327792
commit
8532e91e7e
2 changed files with 17 additions and 16 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-05-12 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_submit_packet),
|
||||||
|
(gst_ogg_demux_collect_chain_info):
|
||||||
|
If there is a stream in a chain without any data packets, ignore the
|
||||||
|
stream in the total length calculations. Might be related to #436820.
|
||||||
|
|
||||||
2007-05-11 Jan Schmidt <thaytan@mad.scientist.com>
|
2007-05-11 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
* gst/typefind/gsttypefindfunctions.c: (mpeg_sys_is_valid_pack),
|
* gst/typefind/gsttypefindfunctions.c: (mpeg_sys_is_valid_pack),
|
||||||
|
|
|
@ -1023,7 +1023,8 @@ gst_ogg_pad_submit_packet (GstOggPad * pad, ogg_packet * packet)
|
||||||
/* check if complete chain has start time */
|
/* check if complete chain has start time */
|
||||||
if (chain == ogg->building_chain) {
|
if (chain == ogg->building_chain) {
|
||||||
|
|
||||||
/* see if we have enough info to activate the chain */
|
/* see if we have enough info to activate the chain, we have enough info
|
||||||
|
* when all streams have a valid start time. */
|
||||||
if (gst_ogg_demux_collect_chain_info (ogg, chain)) {
|
if (gst_ogg_demux_collect_chain_info (ogg, chain)) {
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
GstClockTime segment_start, segment_stop, segment_time;
|
GstClockTime segment_start, segment_stop, segment_time;
|
||||||
|
@ -2564,10 +2565,12 @@ gst_ogg_demux_find_chain (GstOggDemux * ogg, int serialno)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* returns TRUE if all streams have valid start time */
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_ogg_demux_collect_chain_info (GstOggDemux * ogg, GstOggChain * chain)
|
gst_ogg_demux_collect_chain_info (GstOggDemux * ogg, GstOggChain * chain)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
|
gboolean res = TRUE;
|
||||||
|
|
||||||
chain->total_time = GST_CLOCK_TIME_NONE;
|
chain->total_time = GST_CLOCK_TIME_NONE;
|
||||||
chain->segment_start = G_MAXINT64;
|
chain->segment_start = G_MAXINT64;
|
||||||
|
@ -2580,25 +2583,16 @@ gst_ogg_demux_collect_chain_info (GstOggDemux * ogg, GstOggChain * chain)
|
||||||
|
|
||||||
/* can do this if the pad start time is not defined */
|
/* can do this if the pad start time is not defined */
|
||||||
if (pad->start_time == GST_CLOCK_TIME_NONE)
|
if (pad->start_time == GST_CLOCK_TIME_NONE)
|
||||||
goto no_start_time;
|
res = FALSE;
|
||||||
|
else
|
||||||
chain->segment_start = MIN (chain->segment_start, pad->start_time);
|
chain->segment_start = MIN (chain->segment_start, pad->start_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chain->segment_stop != GST_CLOCK_TIME_NONE)
|
if (chain->segment_stop != GST_CLOCK_TIME_NONE
|
||||||
|
&& chain->segment_start != G_MAXINT64)
|
||||||
chain->total_time = chain->segment_stop - chain->segment_start;
|
chain->total_time = chain->segment_stop - chain->segment_start;
|
||||||
|
|
||||||
return TRUE;
|
return res;
|
||||||
|
|
||||||
/* ERROR */
|
|
||||||
no_start_time:
|
|
||||||
{
|
|
||||||
chain->total_time = GST_CLOCK_TIME_NONE;
|
|
||||||
chain->segment_start = GST_CLOCK_TIME_NONE;
|
|
||||||
chain->segment_stop = GST_CLOCK_TIME_NONE;
|
|
||||||
chain->begin_time = GST_CLOCK_TIME_NONE;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue