avaudenc: post better error message if experimental codecs don't work
authorTim-Philipp Müller <tim@centricular.com>
Sat, 26 Oct 2013 08:34:30 +0000 (09:34 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 26 Oct 2013 08:34:30 +0000 (09:34 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=691617

ext/libav/gstavaudenc.c

index 74c2304..83a2eee 100644 (file)
@@ -324,6 +324,16 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
     if (avcodec_get_context_defaults3 (ffmpegaudenc->context,
             oclass->in_plugin) < 0)
       GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults");
+
+    if ((oclass->in_plugin->capabilities & CODEC_CAP_EXPERIMENTAL) &&
+        ffmpegaudenc->compliance != GST_FFMPEG_EXPERIMENTAL) {
+      GST_ELEMENT_ERROR (ffmpegaudenc, LIBRARY, SETTINGS,
+          ("Codec is experimental, but settings don't allow encoders to "
+              "produce output of experimental quality"),
+          ("This codec may not create output that is conformant to the specs "
+              "or of good quality. If you must use it anyway, set the "
+              "compliance property to experimental"));
+    }
     return FALSE;
   }