mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
mpegtsmux: avoid PID collision for auto-generated PID
This commit is contained in:
parent
fa4f487d8f
commit
38bb55c472
1 changed files with 7 additions and 3 deletions
|
@ -356,9 +356,13 @@ tsmux_get_new_pid (TsMux * mux)
|
|||
{
|
||||
g_return_val_if_fail (mux != NULL, -1);
|
||||
|
||||
/* FIXME: It's possible that this next PID is already taken if a
|
||||
* specific PID was requested earlier. We should find a free PID */
|
||||
return mux->next_stream_pid++;
|
||||
/* make sure this PID is free
|
||||
* (and not taken by a specific earlier request) */
|
||||
do {
|
||||
mux->next_stream_pid++;
|
||||
} while (tsmux_find_stream (mux, mux->next_stream_pid));
|
||||
|
||||
return mux->next_stream_pid;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue