diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2019-06-28 20:33:05 +0300 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2019-11-06 19:40:08 +0300 |
commit | 33203a08e0a26598cb103508327a1dc184b27bc6 (patch) | |
tree | cc5527d86e53deeb8f2709dab166251580a3fc85 /libavcodec | |
parent | c54268ce02f71c144d444a5e6d35417d5f043ed5 (diff) |
avcodec/dvdec: correctly set interlaced and tff
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dvdec.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 89864f2edc..daa8c74328 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -542,12 +542,19 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, void *data, if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0) return ret; - frame.f->interlaced_frame = 1; - frame.f->top_field_first = 0; /* Determine the codec's field order from the packet */ if ( *vsc_pack == dv_video_control ) { - frame.f->top_field_first = !(vsc_pack[3] & 0x40); + if (avctx->height == 720) { + frame.f->interlaced_frame = 0; + frame.f->top_field_first = 0; + } else if (avctx->height == 1080) { + frame.f->interlaced_frame = 1; + frame.f->top_field_first = (vsc_pack[3] & 0x40) == 0x40; + } else { + frame.f->interlaced_frame = (vsc_pack[3] & 0x10) == 0x10; + frame.f->top_field_first = !(vsc_pack[3] & 0x40); + } } s->buf = buf; |