summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2015-09-16 12:50:46 +0200
committerTim-Philipp Müller <tim@centricular.com>2015-09-30 17:20:59 +0100
commitc62af2921c633fffdfce9d964f7e1f06b48b020c (patch)
treee92fc890b2f48d9f0aa8e065d22de93326ca8c9c
parent5ee804e297e075cc2114d4eadbc891abbb7188f6 (diff)
downloadgstreamer-plugins-bad-c62af2921c633fffdfce9d964f7e1f06b48b020c.tar.gz
mssdemux: activate streams before configuring bitrate
Doing the contrary has no effect and the consequence is that playback will start with the lowest bitrate even if we can already handle higher bitrate. https://bugzilla.gnome.org/show_bug.cgi?id=755108
-rw-r--r--ext/smoothstreaming/gstmssdemux.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/ext/smoothstreaming/gstmssdemux.c b/ext/smoothstreaming/gstmssdemux.c
index 8f10d7de0..196ce4147 100644
--- a/ext/smoothstreaming/gstmssdemux.c
+++ b/ext/smoothstreaming/gstmssdemux.c
@@ -373,6 +373,7 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux)
GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
GSList *streams = gst_mss_manifest_get_streams (mssdemux->manifest);
GSList *iter;
+ GSList *active_streams = NULL;
if (streams == NULL) {
GST_INFO_OBJECT (mssdemux, "No streams found in the manifest");
@@ -382,16 +383,11 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux)
return FALSE;
}
- GST_INFO_OBJECT (mssdemux, "Changing max bitrate to %u",
- demux->connection_speed);
- gst_mss_manifest_change_bitrate (mssdemux->manifest, demux->connection_speed);
-
+ GST_INFO_OBJECT (mssdemux, "Activating streams");
for (iter = streams; iter; iter = g_slist_next (iter)) {
GstPad *srcpad = NULL;
GstMssDemuxStream *stream = NULL;
GstMssStream *manifeststream = iter->data;
- GstCaps *caps;
- const gchar *lang;
srcpad = _create_pad (mssdemux, manifeststream);
@@ -404,6 +400,18 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux)
srcpad);
stream->manifest_stream = manifeststream;
gst_mss_stream_set_active (manifeststream, TRUE);
+ active_streams = g_slist_prepend (active_streams, stream);
+ }
+
+ GST_INFO_OBJECT (mssdemux, "Changing max bitrate to %u",
+ demux->connection_speed);
+ gst_mss_manifest_change_bitrate (mssdemux->manifest, demux->connection_speed);
+
+ for (iter = active_streams; iter; iter = g_slist_next (iter)) {
+ GstMssDemuxStream *stream = iter->data;
+ GstCaps *caps;
+ const gchar *lang;
+
caps = gst_mss_stream_get_caps (stream->manifest_stream);
gst_adaptive_demux_stream_set_caps (GST_ADAPTIVE_DEMUX_STREAM_CAST (stream),
create_mss_caps (stream, caps));
@@ -419,6 +427,7 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux)
}
}
+ g_slist_free (active_streams);
return TRUE;
}