Commit 110d75c3 authored by Rafaël Carré's avatar Rafaël Carré

ts mux: simplify compare functions

parent 8ea322d7
...@@ -444,22 +444,15 @@ static int AllocatePID( sout_mux_sys_t *p_sys, int i_cat ) ...@@ -444,22 +444,15 @@ static int AllocatePID( sout_mux_sys_t *p_sys, int i_cat )
static int pmtcompare( const void *pa, const void *pb ) static int pmtcompare( const void *pa, const void *pb )
{ {
if ( ((pmt_map_t *)pa)->i_pid < ((pmt_map_t *)pb)->i_pid ) int id1 = ((pmt_map_t *)pa)->i_pid;
return -1; int id2 = ((pmt_map_t *)pb)->i_pid;
else if ( ((pmt_map_t *)pa)->i_pid > ((pmt_map_t *)pb)->i_pid )
return 1; return id1 - id2;
else
return 0;
} }
static int intcompare( const void *pa, const void *pb ) static int intcompare( const void *pa, const void *pb )
{ {
if ( *(int *)pa < *(int *)pb ) return *(int*)pa - *(int*)pb;
return -1;
else if ( *(int *)pa > *(int *)pb )
return 1;
else
return 0;
} }
/***************************************************************************** /*****************************************************************************
...@@ -566,7 +559,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -566,7 +559,7 @@ static int Open( vlc_object_t *p_this )
/* Now sort according to pids for fast search later on */ /* Now sort according to pids for fast search later on */
qsort( (void *)p_sys->pmtmap, p_sys->i_pmtslots, qsort( (void *)p_sys->pmtmap, p_sys->i_pmtslots,
sizeof(pmt_map_t), &pmtcompare ); sizeof(pmt_map_t), pmtcompare );
if ( !*psz_next ) if ( !*psz_next )
psz = NULL; psz = NULL;
} }
......
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