[vlc-devel] [PATCH 1/5] decoder: change DecoderUnsupportedCodec arguments

Thomas Guillem thomas at gllm.fr
Mon Sep 7 18:59:27 CEST 2015


Use an es_format_t.
---
 src/input/decoder.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 0fad3f9..2eda188 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1717,16 +1717,16 @@ static void DeleteDecoder( decoder_t * p_dec )
 }
 
 /* */
-static void DecoderUnsupportedCodec( decoder_t *p_dec, vlc_fourcc_t codec )
+static void DecoderUnsupportedCodec( decoder_t *p_dec, const es_format_t *fmt )
 {
-    if (codec != VLC_FOURCC('u','n','d','f')) {
-        const char *desc = vlc_fourcc_GetDescription(p_dec->fmt_in.i_cat, codec);
+    if (fmt->i_codec != VLC_FOURCC('u','n','d','f')) {
+        const char *desc = vlc_fourcc_GetDescription(fmt->i_cat, fmt->i_codec);
         if (!desc || !*desc)
             desc = N_("No description for this codec");
-        msg_Err( p_dec, "Codec `%4.4s' (%s) is not supported.", (char*)&codec, desc );
+        msg_Err( p_dec, "Codec `%4.4s' (%s) is not supported.", (char*)&fmt->i_codec, desc );
         dialog_Fatal( p_dec, _("Codec not supported"),
                 _("VLC could not decode the format \"%4.4s\" (%s)"),
-                (char*)&codec, desc );
+                (char*)&fmt->i_codec, desc );
     } else {
         msg_Err( p_dec, "could not identify codec" );
         dialog_Fatal( p_dec, _("Unidentified codec"),
@@ -1758,7 +1758,7 @@ static decoder_t *decoder_New( vlc_object_t *p_parent, input_thread_t *p_input,
 
     if( !p_dec->p_module )
     {
-        DecoderUnsupportedCodec( p_dec, fmt->i_codec );
+        DecoderUnsupportedCodec( p_dec, fmt );
 
         DeleteDecoder( p_dec );
         return NULL;
@@ -2008,7 +2008,7 @@ int input_DecoderSetCcState( decoder_t *p_dec, bool b_decode, int i_channel )
         }
         else if( !p_cc->p_module )
         {
-            DecoderUnsupportedCodec( p_dec, fcc[i_channel] );
+            DecoderUnsupportedCodec( p_dec, &fmt );
             input_DecoderDelete(p_cc);
             return VLC_EGENERIC;
         }
-- 
2.1.4



More information about the vlc-devel mailing list