On Mon, 28 Apr 2014 18:21:38 -0400, Justin Ruggles <[email protected]> 
wrote:
> ---
>  doc/APIchanges           |  3 +++
>  libavcodec/dirac.c       |  2 ++
>  libavcodec/dpx.c         |  2 ++
>  libavcodec/dvdec.c       |  4 +++-
>  libavcodec/exr.c         |  4 ++--
>  libavcodec/ffv1dec.c     |  8 ++++++++
>  libavcodec/h263dec.c     |  2 ++
>  libavcodec/h264_slice.c  |  3 +--
>  libavcodec/hevc.c        |  3 ++-
>  libavcodec/internal.h    |  6 ++++++
>  libavcodec/mjpegdec.c    |  1 +
>  libavcodec/mpeg12dec.c   |  2 ++
>  libavcodec/truemotion1.c |  2 ++
>  libavcodec/utils.c       | 33 +++++++++++++++++++++++++++++++++
>  libavcodec/vc1.c         |  1 +
>  libavcodec/vp3.c         |  1 +
>  libavutil/imgutils.c     | 23 +++++++++++++++++++++++
>  libavutil/imgutils.h     | 15 +++++++++++++++
>  libavutil/version.h      |  2 +-
>  19 files changed, 110 insertions(+), 7 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 28afc9b..d95dbd9 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -13,6 +13,9 @@ libavutil:     2013-12-xx
>  
>  API changes, most recent first:
>  
> +2014-04-xx - xxxxxxx - lavu 53.14.0 - imgutils.h
> +  Add av_image_check_sar().
> +
>  2014-04-xx - xxxxxxx - lavc 55.50.0 - dxva2.h
>    Add FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO for old Intel GPUs.
>  
> diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c
> index f0fb85d..ed0ea9f 100644
> --- a/libavcodec/dirac.c
> +++ b/libavcodec/dirac.c
> @@ -316,6 +316,8 @@ int avpriv_dirac_parse_sequence_header(AVCodecContext 
> *avctx, GetBitContext *gb,
>      if (ret < 0)
>          return ret;
>  
> +    ff_set_sar(avctx, avctx->sample_aspect_ratio);
> +
>      /* [DIRAC_STD] picture_coding_mode shall be 0 for fields and 1 for frames
>       * currently only used to signal field coding */
>      picture_coding_mode = svq3_get_ue_golomb(gb);
> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
> index 0dfa538..c796387 100644
> --- a/libavcodec/dpx.c
> +++ b/libavcodec/dpx.c
> @@ -150,6 +150,8 @@ static int decode_frame(AVCodecContext *avctx,
>      if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
>          return ret;
>  
> +    ff_set_sar(avctx, avctx->sample_aspect_ratio);
> +
>      if ((ret = ff_get_buffer(avctx, p, 0)) < 0) {
>          av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
>          return ret;
> diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
> index ef9ba4c..3c6654a 100644
> --- a/libavcodec/dvdec.c
> +++ b/libavcodec/dvdec.c
> @@ -36,6 +36,7 @@
>   */
>  
>  #include "libavutil/internal.h"
> +#include "libavutil/imgutils.h"
>  #include "libavutil/pixdesc.h"
>  #include "avcodec.h"
>  #include "internal.h"
> @@ -358,7 +359,8 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
>      if ( *vsc_pack == dv_video_control ) {
>          apt = buf[4] & 0x07;
>          is16_9 = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 || (!apt && 
> (vsc_pack[2] & 0x07) == 0x07)));
> -        avctx->sample_aspect_ratio = s->sys->sar[is16_9];
> +        ff_set_sar(avctx, s->sys->sar[is16_9]);
> +        s->frame->sample_aspect_ratio = avctx->sample_aspect_ratio;
>      }
>  

Seems to me you could move this whole if() block right before get_buffer(), and
so avoid setting the frame sar manually.

Otherwise looks ok

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to