changeset 4337:3d3c7fbfd910 libavformat

do not write f2 if not interlaced
author bcoudurier
date Mon, 02 Feb 2009 03:49:23 +0000
parents 87455a164f2b
children e8dd4b55d8d1
files mxfenc.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mxfenc.c	Mon Feb 02 03:45:03 2009 +0000
+++ b/mxfenc.c	Mon Feb 02 03:49:23 2009 +0000
@@ -620,9 +620,6 @@
     put_byte(pb, sc->interlaced);
 
     // video line map
-    mxf_write_local_tag(pb, 16, 0x320D);
-    put_be32(pb, 2);
-    put_be32(pb, 4);
     switch (st->codec->height) {
     case  576: f1 = 23; f2 = 336; break;
     case  608: f1 =  7; f2 = 320; break;
@@ -638,8 +635,12 @@
         f1 *= 2;
     }
 
+    mxf_write_local_tag(pb, 16, 0x320D);
+    put_be32(pb, sc->interlaced ? 2 : 1);
+    put_be32(pb, 4);
     put_be32(pb, f1);
-    put_be32(pb, f2);
+    if (sc->interlaced)
+        put_be32(pb, f2);
 
     av_reduce(&dar.num, &dar.den,
               st->codec->width*st->codec->sample_aspect_ratio.num,