libopenh264enc: Return a more sensible error code in some init failure paths
authorMartin Storsjö <martin@martin.st>
Thu, 14 Jul 2016 19:21:50 +0000 (22:21 +0300)
committerMartin Storsjö <martin@martin.st>
Fri, 15 Jul 2016 10:36:22 +0000 (13:36 +0300)
Previously they returned the default AVERROR_UNKNOWN.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/libopenh264enc.c

index 8ef23f1..bf1cf25 100644 (file)
@@ -167,6 +167,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
         av_log(avctx, AV_LOG_ERROR,
                "Invalid combination -slices %d and -max_nal_size %d.\n",
                avctx->slices, s->max_nal_size);
+        err = AVERROR(EINVAL);
         goto fail;
     }
 
@@ -195,6 +196,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
         } else {
             av_log(avctx, AV_LOG_ERROR, "Invalid -max_nal_size, "
                    "specify a valid max_nal_size to use -slice_mode dyn\n");
+            err = AVERROR(EINVAL);
             goto fail;
         }
     }