[vlc-commits] record: remove a few relocations

Rafaël Carré git at videolan.org
Thu Sep 6 09:31:41 CEST 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue Sep  4 15:12:19 2012 +0200| [6884e6dca9f02a7ddbb70f1414c47cc5604a40cc] | committer: Rémi Denis-Courmont

record: remove a few relocations

They were spotted by ruby-elf's cowstats (gem install ruby-elf)

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 modules/stream_out/record.c |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/modules/stream_out/record.c b/modules/stream_out/record.c
index de6d32e..99fac51 100644
--- a/modules/stream_out/record.c
+++ b/modules/stream_out/record.c
@@ -256,8 +256,8 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
  *****************************************************************************/
 typedef struct
 {
-    const char  *psz_muxer;
-    const char  *psz_extension;
+    const char  psz_muxer[4];
+    const char  psz_extension[4];
     int         i_es_max;
     vlc_fourcc_t codec[128];
 } muxer_properties_t;
@@ -305,8 +305,6 @@ static const muxer_properties_t p_muxers[] = {
 
     M( "mkv", "mkv", 32,        VLC_CODEC_H264, VLC_CODEC_VP8, VLC_CODEC_MP4V,
                                 VLC_CODEC_A52,  VLC_CODEC_MP4A, VLC_CODEC_VORBIS, VLC_CODEC_FLAC ),
-
-    M( NULL, NULL, 0, 0 )
 };
 #undef M
 
@@ -386,7 +384,7 @@ static void OutputStart( sout_stream_t *p_stream )
      * TODO we could insert transcode in a few cases like
      * s16l <-> s16b
      */
-    for( int i = 0; p_muxers[i].psz_muxer != NULL; i++ )
+    for( unsigned i = 0; i < sizeof(p_muxers) / sizeof(*p_muxers); i++ )
     {
         bool b_ok;
         if( p_sys->i_id > p_muxers[i].i_es_max )
@@ -421,7 +419,7 @@ static void OutputStart( sout_stream_t *p_stream )
      * keeps most of our stream */
     if( !psz_muxer || !psz_extension )
     {
-        static const char *ppsz_muxers[][2] = {
+        static const char ppsz_muxers[][2][4] = {
             { "avi", "avi" }, { "mp4", "mp4" }, { "ogg", "ogg" },
             { "asf", "asf" }, {  "ts",  "ts" }, {  "ps", "mpg" },
             { "mkv", "mkv" },
@@ -434,13 +432,12 @@ static void OutputStart( sout_stream_t *p_stream )
             { "avformat{mux=nsv}", "nsv" },
             { "avformat{mux=flv}", "flv" },
 #endif
-            { NULL, NULL }
         };
         int i_best = 0;
         int i_best_es = 0;
 
         msg_Warn( p_stream, "failed to find an adequate muxer, probing muxers" );
-        for( int i = 0; ppsz_muxers[i][0] != NULL; i++ )
+        for( unsigned i = 0; i < sizeof(ppsz_muxers) / sizeof(*ppsz_muxers); i++ )
         {
             char *psz_file;
             int i_es;



More information about the vlc-commits mailing list