Commit 52efb628 authored by Mathieu Duponchelle's avatar Mathieu Duponchelle 🐸 Committed by Mathieu Duponchelle

basetsmux: fix PCR stream selection

parent 1ff72bb6
......@@ -685,7 +685,15 @@ gst_base_ts_mux_create_streams (GstBaseTsMux * mux)
tsmux_set_pmt_interval (ts_pad->prog, mux->pmt_interval);
g_hash_table_insert (mux->programs,
GINT_TO_POINTER (ts_pad->prog_id), ts_pad->prog);
}
if (ts_pad->stream == NULL) {
ret = gst_base_ts_mux_create_stream (mux, ts_pad);
if (ret != GST_FLOW_OK)
goto no_stream;
}
if (ts_pad->prog->pcr_stream == NULL) {
/* Take the first stream of the program for the PCR */
GST_DEBUG_OBJECT (ts_pad,
"Use stream (pid=%d) from pad as PCR for program (prog_id = %d)",
......@@ -694,12 +702,6 @@ gst_base_ts_mux_create_streams (GstBaseTsMux * mux)
tsmux_program_set_pcr_stream (ts_pad->prog, ts_pad->stream);
}
if (ts_pad->stream == NULL) {
ret = gst_base_ts_mux_create_stream (mux, ts_pad);
if (ret != GST_FLOW_OK)
goto no_stream;
}
/* Check for user-specified PCR PID */
pcr_name = g_strdup_printf ("PCR_%d", ts_pad->prog->pgm_number);
if (mux->prog_map && gst_structure_has_field (mux->prog_map, pcr_name)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment