Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mpegts input: optimize the mpegts_mux_find_pid_() for last change
  • Loading branch information
perexg committed Nov 15, 2014
1 parent 7f1d851 commit dd6c882
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/input/mpegts/mpegts_mux.c
Expand Up @@ -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;
Expand Down

0 comments on commit dd6c882

Please sign in to comment.