summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2019-06-28 10:33:05 -0700
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2019-11-06 08:40:08 -0800
commit33203a08e0a26598cb103508327a1dc184b27bc6 (patch)
treecc5527d86e53deeb8f2709dab166251580a3fc85 /libavcodec
parentc54268ce02f71c144d444a5e6d35417d5f043ed5 (diff)
downloadffmpeg-streaming-33203a08e0a26598cb103508327a1dc184b27bc6.zip
ffmpeg-streaming-33203a08e0a26598cb103508327a1dc184b27bc6.tar.gz
avcodec/dvdec: correctly set interlaced and tff
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dvdec.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index 89864f2..daa8c74 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;
OpenPOWER on IntegriCloud