diff mbox series

[FFmpeg-devel,8/8] fftools/ffprobe: only print AVStereo3D.view when it's defined

Message ID 20240622033701.8987-1-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/2] avutil/stereo3d add Monoscopic View enum value | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/configure_x86 warning Failed to apply patch

Commit Message

James Almer June 22, 2024, 3:37 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 fftools/ffprobe.c                      | 3 ++-
 tests/ref/fate/matroska-spherical-mono | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Stefano Sabatini July 6, 2024, 12:04 p.m. UTC | #1
On date Saturday 2024-06-22 00:37:01 -0300, James Almer wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  fftools/ffprobe.c                      | 3 ++-
>  tests/ref/fate/matroska-spherical-mono | 1 -
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index d7ba980ff9..f9124ad5d7 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -2544,7 +2544,8 @@ static void print_pkt_side_data(WriterContext *w,
>              const AVStereo3D *stereo = (AVStereo3D *)sd->data;
>              print_str("type", av_stereo3d_type_name(stereo->type));
>              print_int("inverted", !!(stereo->flags & AV_STEREO3D_FLAG_INVERT));

> -            print_str("view", av_stereo3d_view_name(stereo->view));
> +            if (stereo->type == AV_STEREO3D_VIEW)
> +                print_str("view", av_stereo3d_view_name(stereo->view));

probably we should use print_str_opt to follow the other fields logic

[...]
diff mbox series

Patch

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index d7ba980ff9..f9124ad5d7 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2544,7 +2544,8 @@  static void print_pkt_side_data(WriterContext *w,
             const AVStereo3D *stereo = (AVStereo3D *)sd->data;
             print_str("type", av_stereo3d_type_name(stereo->type));
             print_int("inverted", !!(stereo->flags & AV_STEREO3D_FLAG_INVERT));
-            print_str("view", av_stereo3d_view_name(stereo->view));
+            if (stereo->type == AV_STEREO3D_VIEW)
+                print_str("view", av_stereo3d_view_name(stereo->view));
             print_str("primary_eye", av_stereo3d_primary_eye_name(stereo->primary_eye));
             print_int("baseline", stereo->baseline);
             print_q("horizontal_disparity_adjustment", stereo->horizontal_disparity_adjustment, '/');
diff --git a/tests/ref/fate/matroska-spherical-mono b/tests/ref/fate/matroska-spherical-mono
index aa17e9c624..254bb9903f 100644
--- a/tests/ref/fate/matroska-spherical-mono
+++ b/tests/ref/fate/matroska-spherical-mono
@@ -3,7 +3,6 @@ 
 side_data_type=Stereo 3D
 type=2D
 inverted=0
-view=monoscopic
 primary_eye=none
 baseline=0
 horizontal_disparity_adjustment=0/1