[vlc-devel] [PATCH] Improve the unsupported codec errors

Rafaël Carré funman at videolan.org
Wed Dec 18 11:55:59 CET 2013


Provide a description of the codec if possible
Give a more descriptive message if the codec is "undf"
That one means that the demuxer could not identify the codec
---
 src/input/decoder.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 57ad129..38da0dc 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -683,13 +683,22 @@ static int DecoderGetDisplayRate( decoder_t *p_dec )
 /* */
 static void DecoderUnsupportedCodec( decoder_t *p_dec, vlc_fourcc_t codec )
 {
-    msg_Err( p_dec, "no suitable decoder module for fourcc `%4.4s'. "
-             "VLC probably does not support this sound or video format.",
-             (char*)&codec );
-    dialog_Fatal( p_dec, _("No suitable decoder module"),
-                 _("VLC does not support the audio or video format \"%4.4s\". "
-                  "Unfortunately there is no way for you to fix this."),
-                  (char*)&codec );
+    if (codec != VLC_FOURCC('u','n','d','f')) {
+        const char *desc = vlc_fourcc_GetDescription(p_dec->fmt_in.i_cat, codec);
+        if (!desc || !*desc)
+            desc = N_("No description for this codec");
+        msg_Err( p_dec, "no suitable decoder module for fourcc `%4.4s' (%s). "
+                "VLC probably does not support this sound or video format.",
+                (char*)&codec, desc );
+        dialog_Fatal( p_dec, _("No suitable decoder module"),
+                _("VLC does not support the audio or video format \"%4.4s\" (%s). "
+                    "Unfortunately there is no way for you to fix this."),
+                (char*)&codec, desc );
+    } else {
+        msg_Err( p_dec, "could not identify codec" );
+        dialog_Fatal( p_dec, _("Unidentified codec"),
+            _("VLC could not identify the audio or video codec" ) );
+    }
 }
 
 
-- 
1.8.5.2




More information about the vlc-devel mailing list