diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-20 22:20:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-20 22:20:28 +0200 |
commit | 0dceefc5fa81a6c851b51acab695a8c149ec8e3b (patch) | |
tree | d26bf3f752e6fa622d14f44e091930004b2d12de /libavcodec/dvdec.c | |
parent | 329898aa45f5f8e8b89386ecd40b8db96746d53c (diff) | |
parent | 9e500efdbe0deeff1602500ebc229a0a6b6bb1a2 (diff) | |
download | ffmpeg-0dceefc5fa81a6c851b51acab695a8c149ec8e3b.tar.gz |
Merge commit '9e500efdbe0deeff1602500ebc229a0a6b6bb1a2'
* commit '9e500efdbe0deeff1602500ebc229a0a6b6bb1a2':
Add av_image_check_sar() and use it to validate SAR
Conflicts:
libavcodec/dpx.c
libavcodec/dvdec.c
libavcodec/ffv1dec.c
libavcodec/utils.c
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dvdec.c')
-rw-r--r-- | libavcodec/dvdec.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index e555f31edf..d7aaa5f0f2 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -37,6 +37,7 @@ #include "libavutil/avassert.h" #include "libavutil/internal.h" +#include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" #include "avcodec.h" #include "internal.h" @@ -348,17 +349,21 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, if (ret < 0) return ret; + /* Determine the codec's sample_aspect ratio from the packet */ + vsc_pack = buf + 80*5 + 48 + 5; + 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))); + ff_set_sar(avctx, s->sys->sar[is16_9]); + } + if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0) return ret; s->frame->interlaced_frame = 1; s->frame->top_field_first = 0; - /* Determine the codec's sample_aspect ratio and field order from the packet */ - vsc_pack = buf + 80*5 + 48 + 5; + /* Determine the codec's field order from the packet */ if ( *vsc_pack == dv_video_control ) { - apt = buf[4] & 0x07; - is16_9 = (vsc_pack[2] & 0x07) == 0x02 || (!apt && (vsc_pack[2] & 0x07) == 0x07); - avctx->sample_aspect_ratio = s->sys->sar[is16_9]; s->frame->top_field_first = !(vsc_pack[3] & 0x40); } |