From 489d7a174c8fbd2c88b3e7787e1df2deef519442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= Date: Wed, 23 Jan 2013 13:19:21 -0500 Subject: [PATCH] dashdemux: switch pads and send header file when a newsegment event is sent --- ext/dash/gstdashdemux.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index 6e457cab41..fe79c5ecd9 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -934,7 +934,8 @@ needs_pad_switch (GstDashDemux * demux, GList * fragment) if (G_LIKELY (demux->srcpad[i])) srccaps = gst_pad_get_negotiated_caps (demux->srcpad[i]); if (G_UNLIKELY (!srccaps - || (!gst_caps_is_equal_fixed (demux->output_caps[i], srccaps)))) { + || (!gst_caps_is_equal_fixed (demux->output_caps[i], srccaps))) + || demux->need_segment) { switch_pad = TRUE; } if (G_LIKELY (srccaps)) @@ -1003,6 +1004,7 @@ gst_dash_demux_stream_loop (GstDashDemux * demux) /* Figure out if we need to create/switch pads */ gboolean switch_pad = needs_pad_switch (demux, listfragment); if (switch_pad) { + GST_WARNING ("Switching pads"); switch_pads (demux, nb_adaptation_set); demux->need_segment = TRUE; } @@ -1636,7 +1638,8 @@ need_add_header (GstDashDemux * demux) return FALSE; caps = gst_dash_demux_get_input_caps (demux, stream); if (!demux->input_caps[stream_idx] - || !gst_caps_is_equal (caps, demux->input_caps[stream_idx])) { + || !gst_caps_is_equal (caps, demux->input_caps[stream_idx]) + || demux->need_segment) { switch_caps = TRUE; gst_caps_unref (caps); break;