Browse code

Revert "do not write f2 if not interlaced"

This reverts commit 8ed82d8174a666f80ab8834e3617cbe91ae740a9.

SMPTE S377-1-2009c defines in F.4.1 that the Video Line Map should
always be an array with two 32 bit integers as elements. This is
repeated in G.2.12 with actual examples for progressive content,
where the second value would always be 0.

Additionally, the IRT MXF analyser also lists this as the only
error in the MXF output from ffmpeg: https://mxf-analyser-cloud.irt.de

Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Sebastian Dröge authored on 2016/01/30 01:45:05
Showing 3 changed files
... ...
@@ -1013,7 +1013,7 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
1013 1013
     int stored_height = (st->codec->height+15)/16*16;
1014 1014
     int display_height;
1015 1015
     int f1, f2;
1016
-    unsigned desc_size = size+8+8+8+8+8+8+8+5+16+sc->interlaced*4+12+20+5;
1016
+    unsigned desc_size = size+8+8+8+8+8+8+8+5+16+4+12+20+5;
1017 1017
     if (sc->interlaced && sc->field_dominance)
1018 1018
         desc_size += 5;
1019 1019
     if (sc->signal_standard)
... ...
@@ -1081,12 +1081,12 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
1081 1081
         f1 *= 2;
1082 1082
     }
1083 1083
 
1084
-    mxf_write_local_tag(pb, 12+sc->interlaced*4, 0x320D);
1085
-    avio_wb32(pb, sc->interlaced ? 2 : 1);
1084
+
1085
+    mxf_write_local_tag(pb, 16, 0x320D);
1086
+    avio_wb32(pb, 2);
1086 1087
     avio_wb32(pb, 4);
1087 1088
     avio_wb32(pb, f1);
1088
-    if (sc->interlaced)
1089
-        avio_wb32(pb, f2);
1089
+    avio_wb32(pb, f2);
1090 1090
 
1091 1091
     mxf_write_local_tag(pb, 8, 0x320E);
1092 1092
     avio_wb32(pb, sc->aspect_ratio.num);
... ...
@@ -1,9 +1,9 @@
1
-6d00bf68ec95d0aac959defccdb0190e *./tests/data/lavf/lavf.mxf
1
+f9b570c7b4fbbc2b71f2236b32e7cbb6 *./tests/data/lavf/lavf.mxf
2 2
 525369 ./tests/data/lavf/lavf.mxf
3 3
 ./tests/data/lavf/lavf.mxf CRC=0xdbfff6f1
4
-0bbdd13de78db8ab9314f083b7da0f30 *./tests/data/lavf/lavf.mxf
4
+8f6a9a6b409f0f5a0bf003f8dea26314 *./tests/data/lavf/lavf.mxf
5 5
 560697 ./tests/data/lavf/lavf.mxf
6 6
 ./tests/data/lavf/lavf.mxf CRC=0x11a6178e
7
-462f95f19b3e0fd119a204a96eb6f424 *./tests/data/lavf/lavf.mxf
7
+10ac0f158fc0af356439b818de7601e3 *./tests/data/lavf/lavf.mxf
8 8
 525369 ./tests/data/lavf/lavf.mxf
9 9
 ./tests/data/lavf/lavf.mxf CRC=0xdbfff6f1
... ...
@@ -1,3 +1,3 @@
1
-2205907020248f73876eaad745d2f5b5 *./tests/data/lavf/lavf.mxf_opatom
1
+962c2cd582340f8961a8283636093abf *./tests/data/lavf/lavf.mxf_opatom
2 2
 4717113 ./tests/data/lavf/lavf.mxf_opatom
3 3
 ./tests/data/lavf/lavf.mxf_opatom CRC=0xf55aa22a