mpegts input: optimize the mpegts_mux_find_pid_() for last change

This commit is contained in:
Jaroslav Kysela 2014-11-15 18:34:53 +01:00
parent 7f1d851a40
commit dd6c882bc8

View file

@ -1140,10 +1140,9 @@ mpegts_mux_find_pid_ ( mpegts_mux_t *mm, int pid, int create )
if (pid > 0x2000) return NULL;
if (!create) {
skel.mp_pid = pid;
mp = RB_FIND(&mm->mm_pids, &skel, mp_link, mp_cmp);
} else {
skel.mp_pid = pid;
mp = RB_FIND(&mm->mm_pids, &skel, mp_link, mp_cmp);
if (mp == NULL && create) {
pthread_mutex_lock(&mpegts_pid_skel_mutex);
SKEL_ALLOC(mpegts_pid_skel);
mpegts_pid_skel->mp_pid = pid;