]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/transcode.c
A lot of missing const in options lists
[vlc] / modules / stream_out / transcode.c
index 62d7188e35afee63c121dfdc8efc4f654a885f8c..5fcf03086027942af3b93bab0ef13678b7c569b3 100644 (file)
@@ -45,6 +45,8 @@
 
 #define MASTER_SYNC_MAX_DRIFT 100000
 
+#include <assert.h>
+
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
 #define HURRYUP_LONGTEXT N_( "The transcoder will drop frames if your CPU " \
                 "can't keep up with the encoding rate." )
 
-static const char *ppsz_deinterlace_type[] =
+static const char *const ppsz_deinterlace_type[] =
 {
     "deinterlace", "ffmpeg-deinterlace"
 };
@@ -295,7 +297,7 @@ vlc_module_begin();
 
 vlc_module_end();
 
-static const char *ppsz_sout_options[] = {
+static const char *const ppsz_sout_options[] = {
     "venc", "vcodec", "vb", "croptop", "cropbottom", "cropleft", "cropright",
     "paddtop", "paddbottom", "paddleft", "paddright",
     "canvas-width", "canvas-height", "canvas-aspect",
@@ -1361,7 +1363,7 @@ static int transcode_audio_new( sout_stream_t *p_stream,
         module_Need( id->p_decoder, "decoder", "$codec", 0 );
     if( !id->p_decoder->p_module )
     {
-        msg_Err( p_stream, "cannot find decoder" );
+        msg_Err( p_stream, "cannot find audio decoder" );
         return VLC_EGENERIC;
     }
     id->p_decoder->fmt_out.audio.i_bitspersample =
@@ -1401,7 +1403,9 @@ static int transcode_audio_new( sout_stream_t *p_stream,
         module_Need( id->p_encoder, "encoder", p_sys->psz_aenc, true );
     if( !id->p_encoder->p_module )
     {
-        msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_aenc );
+        msg_Err( p_stream, "cannot find audio encoder (module:%s fourcc:%4.4s)",
+                 p_sys->psz_aenc ? p_sys->psz_aenc : "any",
+                 (char *)&p_sys->i_acodec );
         module_Unneed( id->p_decoder, id->p_decoder->p_module );
         id->p_decoder->p_module = NULL;
         return VLC_EGENERIC;
@@ -1495,7 +1499,9 @@ static int transcode_audio_new( sout_stream_t *p_stream,
             module_Need( id->p_encoder, "encoder", p_sys->psz_aenc, true );
         if( !id->p_encoder->p_module )
         {
-            msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_aenc );
+            msg_Err( p_stream, "cannot find audio encoder (module:%s fourcc:%4.4s)",
+                     p_sys->psz_aenc ? p_sys->psz_aenc : "any",
+                     (char *)&p_sys->i_acodec );
             transcode_audio_close( id );
             return VLC_EGENERIC;
         }
@@ -1797,7 +1803,7 @@ static int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_t *id )
 
     if( !id->p_decoder->p_module )
     {
-        msg_Err( p_stream, "cannot find decoder" );
+        msg_Err( p_stream, "cannot find video decoder" );
         return VLC_EGENERIC;
     }
 
@@ -1835,7 +1841,9 @@ static int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_t *id )
         module_Need( id->p_encoder, "encoder", p_sys->psz_venc, true );
     if( !id->p_encoder->p_module )
     {
-        msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_venc );
+        msg_Err( p_stream, "cannot find video encoder (module:%s fourcc:%4.4s)",
+                 p_sys->psz_venc ? p_sys->psz_venc : "any",
+                 (char *)&p_sys->i_vcodec );
         module_Unneed( id->p_decoder, id->p_decoder->p_module );
         id->p_decoder->p_module = 0;
         return VLC_EGENERIC;
@@ -2149,7 +2157,9 @@ static int transcode_video_encoder_open( sout_stream_t *p_stream,
         module_Need( id->p_encoder, "encoder", p_sys->psz_venc, true );
     if( !id->p_encoder->p_module )
     {
-        msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_venc );
+        msg_Err( p_stream, "cannot find video encoder (module:%s fourcc:%4.4s)",
+                 p_sys->psz_venc ? p_sys->psz_venc : "any",
+                 (char *)&p_sys->i_vcodec );
         return VLC_EGENERIC;
     }
 
@@ -2547,7 +2557,9 @@ static int transcode_video_process( sout_stream_t *p_stream,
             {
                 block_t *p_block;
                 p_pic->date = i_pts;
+                video_timer_start( id->p_encoder );
                 p_block = id->p_encoder->pf_encode_video(id->p_encoder, p_pic);
+                video_timer_stop( id->p_encoder );
                 block_ChainAppend( out, p_block );
             }
         }
@@ -2803,7 +2815,7 @@ static int transcode_spu_new( sout_stream_t *p_stream, sout_stream_id_t *id )
 
     if( !id->p_decoder->p_module )
     {
-        msg_Err( p_stream, "cannot find decoder" );
+        msg_Err( p_stream, "cannot find spu decoder" );
         return VLC_EGENERIC;
     }
 
@@ -2822,7 +2834,7 @@ static int transcode_spu_new( sout_stream_t *p_stream, sout_stream_id_t *id )
         if( !id->p_encoder->p_module )
         {
             module_Unneed( id->p_decoder, id->p_decoder->p_module );
-            msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_senc );
+            msg_Err( p_stream, "cannot find spu encoder (%s)", p_sys->psz_senc );
             return VLC_EGENERIC;
         }
     }
@@ -2930,7 +2942,7 @@ static int transcode_osd_new( sout_stream_t *p_stream, sout_stream_id_t *id )
 
         if( !id->p_encoder->p_module )
         {
-            msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_osdenc );
+            msg_Err( p_stream, "cannot find spu encoder (%s)", p_sys->psz_osdenc );
             goto error;
         }