[FFmpeg-cvslog] libopenh264enc: Return a more sensible error code in some init failure paths

Martin Storsjö git at videolan.org
Fri Nov 18 11:46:35 EET 2016


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Jul 14 22:21:50 2016 +0300| [2d097c16b833c532ac974a7f1fd05c0a1f3b7675] | committer: Martin Storsjö

libopenh264enc: Return a more sensible error code in some init failure paths

Previously they returned the default AVERROR_UNKNOWN.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d097c16b833c532ac974a7f1fd05c0a1f3b7675
---

 libavcodec/libopenh264enc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 8ef23f1..bf1cf25 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -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;
         }
     }



More information about the ffmpeg-cvslog mailing list