Skip to content

Commit 8e5a541

Browse files
quariumcmassiot
authored andcommitted
upipe_ts_mux: select the smallest PID for PCR
When multiple input are eligible for PCR, choose the input with the smallest PID.
1 parent b005bbb commit 8e5a541

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/upipe-ts/upipe_ts_mux.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,9 @@ static void upipe_ts_mux_program_change(struct upipe *upipe)
21232123
continue;
21242124
if (pcr_input == NULL ||
21252125
(pcr_input->input_type == UPIPE_TS_MUX_INPUT_AUDIO &&
2126-
input->input_type == UPIPE_TS_MUX_INPUT_VIDEO)) {
2126+
input->input_type == UPIPE_TS_MUX_INPUT_VIDEO) ||
2127+
(pcr_input->input_type == input->input_type &&
2128+
pcr_pid > input->pid)) {
21272129
pcr_pid = input->pid;
21282130
pcr_input = input;
21292131
}

0 commit comments

Comments
 (0)