[vlc-commits] don't case bsearch() to unrelated types

Rafaël Carré git at videolan.org
Fri Feb 10 08:26:46 CET 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Fri Feb 10 01:41:24 2012 -0500| [2a9a62e55966e16c8bd70faf43640a8050d90545] | committer: Rafaël Carré

don't case bsearch() to unrelated types

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a9a62e55966e16c8bd70faf43640a8050d90545
---

 modules/mux/mpeg/ts.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index 6da669c..4a00a4c 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -2273,13 +2273,12 @@ static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c )
         ts_stream_t *p_stream = (ts_stream_t*)p_mux->pp_inputs[i_stream]->p_sys;
 
         int i_pidinput = p_mux->pp_inputs[i_stream]->p_fmt->i_id;
-        int *p_usepid = bsearch( &i_pidinput, p_sys->pmtmap, p_sys->i_pmtslots,
-                            sizeof(pmt_map_t), intcompare );
+        pmt_map_t *p_usepid = bsearch( &i_pidinput, p_sys->pmtmap,
+                    p_sys->i_pmtslots, sizeof(pmt_map_t), intcompare );
 
         dvbpsi_pmt_es_t *p_es;
         if( p_usepid != NULL )
-            p_es = dvbpsi_PMTAddES(
-                    &p_sys->dvbpmt[((pmt_map_t *)p_usepid)->i_prog],
+            p_es = dvbpsi_PMTAddES( &p_sys->dvbpmt[p_usepid->i_prog],
                     p_stream->i_stream_type, p_stream->i_pid );
         else
             /* If there's an error somewhere, dump it to the first pmt */



More information about the vlc-commits mailing list