On 02/07/2013 02:34 PM, Luca Barbato wrote:
On 07/02/13 14:09, Vladimir Pantelic wrote:
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(


I wonder if we shouldn't always provide the information per-frame.

The patch doesn't seem wrong if we agree to keep the situation as is.

for now it mirrors a bit what is being done in video_image_display() in case there is no lavfi usage:

        /* XXX: use variable in the frame */
        if (is->video_st->sample_aspect_ratio.num)
            aspect_ratio = av_q2d(is->video_st->sample_aspect_ratio);
        else if (is->video_st->codec->sample_aspect_ratio.num)
aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio);
        else
            aspect_ratio = 0;

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

Reply via email to