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
This commit is contained in:
Philippe Normand 2015-09-16 12:50:46 +02:00 committed by Tim-Philipp Müller
parent ae7d938842
commit bf1246cb13

View file

@ -388,6 +388,7 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux)
{ {
GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux); GstMssDemux *mssdemux = GST_MSS_DEMUX_CAST (demux);
GSList *streams = gst_mss_manifest_get_streams (mssdemux->manifest); GSList *streams = gst_mss_manifest_get_streams (mssdemux->manifest);
GSList *active_streams = NULL;
GSList *iter; GSList *iter;
const gchar *protection_system_id = const gchar *protection_system_id =
gst_mss_manifest_get_protection_system_id (mssdemux->manifest); gst_mss_manifest_get_protection_system_id (mssdemux->manifest);
@ -419,12 +420,12 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux)
demux->connection_speed); demux->connection_speed);
gst_mss_manifest_change_bitrate (mssdemux->manifest, 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)) { for (iter = streams; iter; iter = g_slist_next (iter)) {
GstPad *srcpad = NULL; GstPad *srcpad = NULL;
GstMssDemuxStream *stream = NULL; GstMssDemuxStream *stream = NULL;
GstMssStream *manifeststream = iter->data; GstMssStream *manifeststream = iter->data;
GstCaps *caps;
const gchar *lang;
srcpad = _create_pad (mssdemux, manifeststream); srcpad = _create_pad (mssdemux, manifeststream);
@ -437,6 +438,17 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux)
srcpad); srcpad);
stream->manifest_stream = manifeststream; stream->manifest_stream = manifeststream;
gst_mss_stream_set_active (manifeststream, TRUE); 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); caps = gst_mss_stream_get_caps (stream->manifest_stream);
@ -474,6 +486,7 @@ gst_mss_demux_setup_streams (GstAdaptiveDemux * demux)
} }
} }
g_slist_free (active_streams);
return TRUE; return TRUE;
} }