summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2010-10-10 15:17:31 -0700
committerWim Taymans <wim.taymans@collabora.co.uk>2010-10-12 16:06:56 +0200
commit5ae2f04856c2b138df35647cf00a49a38261c730 (patch)
tree555209561fc8f1fff5265d9257b65fb246ab0507
parent3e99c06ad0e8fa269e7fc0cde00345c53c47f911 (diff)
oggdemux: move is_sparse into stream map
-rw-r--r--ext/ogg/gstoggdemux.c9
-rw-r--r--ext/ogg/gstoggdemux.h1
-rw-r--r--ext/ogg/gstoggstream.c7
-rw-r--r--ext/ogg/gstoggstream.h1
4 files changed, 10 insertions, 8 deletions
diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c
index d7774dcca..3d658b482 100644
--- a/ext/ogg/gstoggdemux.c
+++ b/ext/ogg/gstoggdemux.c
@@ -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)) {
diff --git a/ext/ogg/gstoggdemux.h b/ext/ogg/gstoggdemux.h
index b7a0ecb4c..031627baf 100644
--- a/ext/ogg/gstoggdemux.h
+++ b/ext/ogg/gstoggdemux.h
@@ -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 */
diff --git a/ext/ogg/gstoggstream.c b/ext/ogg/gstoggstream.c
index be774dcf3..175bff452 100644
--- a/ext/ogg/gstoggstream.c
+++ b/ext/ogg/gstoggstream.c
@@ -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;
}
diff --git a/ext/ogg/gstoggstream.h b/ext/ogg/gstoggstream.h
index da6ee14bf..a8bc2c8e8 100644
--- a/ext/ogg/gstoggstream.h
+++ b/ext/ogg/gstoggstream.h
@@ -66,6 +66,7 @@ struct _GstOggStream
gint frame_size;
gint bitrate;
guint64 total_time;
+ gboolean is_sparse;
GstCaps *caps;