[FFmpeg-cvslog] avfilter/vf_showinfo: only print yaw, pitch, and roll if set

James Almer git at videolan.org
Fri Jun 28 20:44:26 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Jun 26 11:05:54 2024 -0300| [beacdbf4b4b83b471c2fd7cb53b18516be03d46b] | committer: James Almer

avfilter/vf_showinfo: only print yaw, pitch, and roll if set

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavfilter/vf_showinfo.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 98c5632d52..bcf7c2159e 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -80,10 +80,12 @@ static void dump_spherical(AVFilterContext *ctx, AVFrame *frame, const AVFrameSi
 
     av_log(ctx, AV_LOG_INFO, "%s ", av_spherical_projection_name(spherical->projection));
 
-    yaw = ((double)spherical->yaw) / (1 << 16);
-    pitch = ((double)spherical->pitch) / (1 << 16);
-    roll = ((double)spherical->roll) / (1 << 16);
-    av_log(ctx, AV_LOG_INFO, "(%f/%f/%f) ", yaw, pitch, roll);
+    if (spherical->yaw || spherical->pitch || spherical->roll) {
+        yaw = ((double)spherical->yaw) / (1 << 16);
+        pitch = ((double)spherical->pitch) / (1 << 16);
+        roll = ((double)spherical->roll) / (1 << 16);
+        av_log(ctx, AV_LOG_INFO, "(%f/%f/%f) ", yaw, pitch, roll);
+    }
 
     if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR_TILE) {
         size_t l, t, r, b;



More information about the ffmpeg-cvslog mailing list