ffmpegdec: improve error message when set_caps is called but we have no mapping
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 31 Jan 2011 23:28:33 +0000 (23:28 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 31 Jan 2011 23:28:33 +0000 (23:28 +0000)
This may happen e.g. if gst-ffmpeg is compiled against an external
libavcodec and the external lib is upgraded.

See e.g.
https://bugzilla.gnome.org/show_bug.cgi?id=640825

ext/ffmpeg/gstffmpegdec.c

index d3e7c40..5704baa 100644 (file)
@@ -1294,9 +1294,22 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec, gboolean force)
   /* ERRORS */
 no_caps:
   {
-    GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION, (NULL),
-        ("could not find caps for codec (%s), unknown type",
-            oclass->in_plugin->name));
+#ifdef HAVE_FFMPEG_UNINSTALLED
+    /* using internal ffmpeg snapshot */
+    GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION,
+        ("Could not find GStreamer caps mapping for FFmpeg codec '%s'.",
+            oclass->in_plugin->name), (NULL));
+#else
+    /* using external ffmpeg */
+    GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION,
+        ("Could not find GStreamer caps mapping for FFmpeg codec '%s', and "
+            "you are using an external libavcodec. This is most likely due to "
+            "a packaging problem and/or libavcodec having been upgraded to a "
+            "version that is not compatible with this version of "
+            "gstreamer-ffmpeg. Make sure your gstreamer-ffmpeg and libavcodec "
+            "packages come from the same source/repository.",
+            oclass->in_plugin->name), (NULL));
+#endif
     return FALSE;
   }
 caps_failed: