diff mbox series

[FFmpeg-devel,5/9] avformat/matroskaenc: Improve message for WebM-incompatible StereoModes

Message ID AS8P250MB07440366197962B2DA610E988F10A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 2d09488ac39abc4a31acbdbd0d0c5f787a35544d
Headers show
Series [FFmpeg-devel,1/9] avformat/matroskaenc: Avoid atoi() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 11, 2023, 10:43 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/matroskaenc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 20d3af3b42..c4be6791ab 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1583,6 +1583,7 @@  static int mkv_write_stereo_mode(AVFormatContext *s, EbmlWriter *writer,
                                  const AVStream *st, int is_webm,
                                  int *h_width, int *h_height)
 {
+    const char *error_message_addendum = "";
     const AVDictionaryEntry *tag;
     MatroskaVideoStereoModeType format = MATROSKA_VIDEO_STEREOMODE_TYPE_NB;
 
@@ -1656,6 +1657,7 @@  static int mkv_write_stereo_mode(AVFormatContext *s, EbmlWriter *writer,
 
     // if webm, do not write unsupported modes
     if (is_webm && !(webm_bitfield >> format)) {
+        error_message_addendum = " for WebM";
         goto fail;
     }
 
@@ -1668,7 +1670,8 @@  static int mkv_write_stereo_mode(AVFormatContext *s, EbmlWriter *writer,
     return 0;
 fail:
     av_log(s, AV_LOG_ERROR,
-            "The specified stereo mode is not valid.\n");
+            "The specified stereo mode is not valid%s.\n",
+            error_message_addendum);
     return AVERROR(EINVAL);
 }