[FFmpeg-devel] [PATCH 4/8 v2] avformat/dump: print Stereo3D view only when type is view defined

James Almer jamrial at gmail.com
Sat Jun 22 18:31:18 EEST 2024


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavformat/dump.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index 61a2c6a29f..33d72b7e18 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -259,9 +259,10 @@ static void dump_stereo3d(void *ctx, const AVPacketSideData *sd, int log_level)
 
     stereo = (const AVStereo3D *)sd->data;
 
-    av_log(ctx, log_level, "%s, view: %s, primary eye: %s",
-           av_stereo3d_type_name(stereo->type), av_stereo3d_view_name(stereo->view),
-           av_stereo3d_primary_eye_name(stereo->primary_eye));
+    av_log(ctx, log_level, "%s", av_stereo3d_type_name(stereo->type));
+    if (stereo->type == AV_STEREO3D_VIEW)
+        av_log(ctx, log_level, ", view: %s", av_stereo3d_view_name(stereo->view));
+    av_log(ctx, log_level, ", primary eye: %s", av_stereo3d_primary_eye_name(stereo->primary_eye));
     if (stereo->baseline)
         av_log(ctx, log_level, ", baseline: %"PRIu32"", stereo->baseline);
     if (stereo->horizontal_disparity_adjustment.num && stereo->horizontal_disparity_adjustment.den)
-- 
2.45.2



More information about the ffmpeg-devel mailing list