]> git.sesse.net Git - vlc/commitdiff
Improve the unsupported codec errors
authorRafaël Carré <funman@videolan.org>
Wed, 18 Dec 2013 10:55:14 +0000 (11:55 +0100)
committerRafaël Carré <funman@videolan.org>
Thu, 19 Dec 2013 08:04:38 +0000 (09:04 +0100)
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

index 57ad129541e04c067d536e999b027b98c624415d..38da0dcea3f24326dc745a5931fe805c02cff474 100644 (file)
@@ -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" ) );
+    }
 }