So far we took only the codec sample aspect ratio into account
and ignored the one from the stream when using libavfilter.

Signed-off-by: Vladimir Pantelic <vlado...@gmail.com>
---
 avplay.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/avplay.c b/avplay.c
index 3e2110f..58b16d5 100644
--- a/avplay.c
+++ b/avplay.c
@@ -1636,6 +1636,12 @@ static int video_thread(void *arg)
         }
 
         frame->pts = pts_int;
+        if (!frame->sample_aspect_ratio.num) {
+            /* no aspect ratio in frame, check if the stream has one*/
+            if (is->video_st->sample_aspect_ratio.num) {
+                frame->sample_aspect_ratio = is->video_st->sample_aspect_ratio;
+            }
+        }
         if (is->use_dr1) {
             FrameBuffer      *buf = frame->opaque;
             AVFilterBufferRef *fb = avfilter_get_video_buffer_ref_from_arrays(
-- 
1.7.6.1

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to