oggdemux: move is_sparse into stream map

This commit is contained in:
David Schleef 2010-10-10 15:17:31 -07:00 committed by Wim Taymans
parent 3e99c06ad0
commit 5ae2f04856
4 changed files with 10 additions and 8 deletions

View file

@ -576,7 +576,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
pad->current_granule);
out_duration = gst_util_uint64_scale (duration,
GST_SECOND * pad->map.granulerate_d, pad->map.granulerate_n);
} else if (pad->is_sparse) {
} else if (pad->map.is_sparse) {
out_timestamp = gst_ogg_stream_granule_to_time (&pad->map,
pad->current_granule);
out_duration = GST_CLOCK_TIME_NONE;
@ -1792,11 +1792,6 @@ gst_ogg_demux_activate_chain (GstOggDemux * ogg, GstOggChain * chain,
GST_DEBUG_OBJECT (ogg, "adding pad %" GST_PTR_FORMAT, pad);
structure = gst_caps_get_structure (GST_PAD_CAPS (pad), 0);
pad->is_sparse =
gst_structure_has_name (structure, "application/x-ogm-text") ||
gst_structure_has_name (structure, "text/x-cmml") ||
gst_structure_has_name (structure, "subtitle/x-kate") ||
gst_structure_has_name (structure, "application/x-kate");
/* activate first */
gst_pad_set_active (GST_PAD_CAST (pad), TRUE);
@ -3367,7 +3362,7 @@ gst_ogg_demux_sync_streams (GstOggDemux * ogg)
/* Theoretically, we should be doing this for all streams, but we're only
* doing it for known-to-be-sparse streams at the moment in order not to
* break things for wrongly-muxed streams (like we used to produce once) */
if (stream->is_sparse && stream->last_stop != GST_CLOCK_TIME_NONE) {
if (stream->map.is_sparse && stream->last_stop != GST_CLOCK_TIME_NONE) {
/* Does this stream lag? Random threshold of 2 seconds */
if (GST_CLOCK_DIFF (stream->last_stop, cur) > (2 * GST_SECOND)) {

View file

@ -103,7 +103,6 @@ struct _GstOggPad
gint64 first_granule; /* the granulepos of first page == first sample in next page */
GstClockTime first_time; /* the timestamp of the second page or granuletime of first page */
gboolean is_sparse; /* TRUE if this is a subtitle pad or some other sparse stream */
GstClockTime last_stop; /* last_stop when last push occured; used to detect when we
* need to send a newsegment update event for sparse streams */

View file

@ -918,6 +918,9 @@ setup_fishead_mapper (GstOggStream * pad, ogg_packet * packet)
GST_TIME_ARGS (pad->prestime));
pad->is_skeleton = TRUE;
pad->is_sparse = TRUE;
pad->caps = gst_caps_new_simple ("none/none", NULL);
return TRUE;
}
@ -1336,6 +1339,7 @@ setup_ogmtext_mapper (GstOggStream * pad, ogg_packet * packet)
pad->n_header_packets = 1;
pad->is_ogm = TRUE;
pad->is_ogm_text = TRUE;
pad->is_sparse = TRUE;
return TRUE;
}
@ -1493,6 +1497,7 @@ setup_cmml_mapper (GstOggStream * pad, ogg_packet * packet)
GST_DEBUG ("blocksize1: %u", 1 << (data[0] & 0x0F));
pad->caps = gst_caps_new_simple ("text/x-cmml", NULL);
pad->is_sparse = TRUE;
return TRUE;
}
@ -1551,6 +1556,8 @@ setup_kate_mapper (GstOggStream * pad, ogg_packet * packet)
pad->caps = gst_caps_new_simple ("application/x-kate", NULL);
}
pad->is_sparse = TRUE;
return TRUE;
}

View file

@ -66,6 +66,7 @@ struct _GstOggStream
gint frame_size;
gint bitrate;
guint64 total_time;
gboolean is_sparse;
GstCaps *caps;