OSDN Git Service

lavc/libopusenc: report an error if global_quality is set.
authorNicolas George <nicolas.george@normalesup.org>
Wed, 13 Feb 2013 11:16:47 +0000 (12:16 +0100)
committerNicolas George <nicolas.george@normalesup.org>
Wed, 27 Feb 2013 18:01:34 +0000 (19:01 +0100)
libavcodec/libopusenc.c

index d198798..a4aa37c 100644 (file)
@@ -107,6 +107,13 @@ static int libopus_configure_encoder(AVCodecContext *avctx, OpusMSEncoder *enc,
 {
     int ret;
 
+    if (avctx->global_quality) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Quality-based encoding not supported, "
+               "please specify a bitrate and VBR setting.\n");
+        return AVERROR(EINVAL);
+    }
+
     ret = opus_multistream_encoder_ctl(enc, OPUS_SET_BITRATE(avctx->bit_rate));
     if (ret != OPUS_OK) {
         av_log(avctx, AV_LOG_ERROR,