changeset 11672:62ca7e82de82

better top_field_first behaviour (mostly what rich suggested)
author michael
date Mon, 22 Dec 2003 20:22:06 +0000
parents f7e10875d102
children 8699b147de8c
files libmpcodecs/ve_lavc.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ve_lavc.c	Mon Dec 22 17:57:15 2003 +0000
+++ b/libmpcodecs/ve_lavc.c	Mon Dec 22 20:22:06 2003 +0000
@@ -701,11 +701,15 @@
     pic->linesize[2]=mpi->stride[2];
 
 #if LIBAVCODEC_BUILD >= 4697
-    if(mpi->fields & MP_IMGFIELD_ORDERED)
-        pic->top_field_first= !!(mpi->fields & MP_IMGFIELD_TOP_FIRST);
+    if(lavc_param_interlaced_dct){
+        if((mpi->fields & MP_IMGFIELD_ORDERED) && (mpi->fields & MP_IMGFIELD_INTERLACED))
+            pic->top_field_first= !!(mpi->fields & MP_IMGFIELD_TOP_FIRST);
+        else 
+            pic->top_field_first= 1;
     
-    if(lavc_param_top!=-1)
-        pic->top_field_first= lavc_param_top;
+        if(lavc_param_top!=-1)
+            pic->top_field_first= lavc_param_top;
+    }
 #endif
 
 	out_size = avcodec_encode_video(lavc_venc_context, mux_v->buffer, mux_v->buffer_size,