Anton Khirnov <an...@khirnov.net> writes:

> From: Stefano Sabatini <stefano.sabatini-l...@poste.it>
>
> The sample aspect ratio is a per-frame property, so it makes sense to
> define it in AVFrame rather than in the codec/stream context.
> Simplify application-level sample aspect ratio information extraction,
> and allow further simplifications.
> ---
>  avplay.c                 |    2 +-
>  cmdutils.c               |    1 +
>  libavcodec/avcodec.h     |    7 +++++++
>  libavcodec/utils.c       |    3 +++
>  libavfilter/vsrc_movie.c |    4 ++--
>  5 files changed, 14 insertions(+), 3 deletions(-)

[...]

> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 5d39b98..108e8b0 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -1258,6 +1258,13 @@ typedef struct AVFrame {
>       * decoding: set by AVCodecContext.get_buffer()
>       */
>      uint8_t **extended_data;
> +
> +    /**
> +     * reordered sample aspect ratio for the video frame, 0/1 if 
> unknown\unspecified
> +     * - encoding: unused
> +     * - decoding: Read by user.
> +     */
> +    AVRational sample_aspect_ratio;
>  } AVFrame;

Drop "reordered".  It is confusing.

> @@ -858,6 +859,8 @@ int attribute_align_arg 
> avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
>              ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
>                                avpkt);
>              picture->pkt_dts= avpkt->dts;
> +            if (!picture->sample_aspect_ratio.num)
> +                picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
>          }

What is the rationale for this condition?  When would it be set to a
valid value different from what this would write?

-- 
Måns Rullgård
m...@mansr.com
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to