Merge commit 'c9d982aa11a6267611c3770792f0e04b48438348'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 28 Jul 2014 22:11:46 +0000 (00:11 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 28 Jul 2014 22:12:03 +0000 (00:12 +0200)
* commit 'c9d982aa11a6267611c3770792f0e04b48438348':
  mxf: Detect Vanc/Vbi SMPTE-436M mxf track

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/mxfdec.c

@@@ -1657,10 -1627,20 +1666,18 @@@ static int mxf_parse_structural_metadat
              } else if (st->codec->codec_id == AV_CODEC_ID_MP2) {
                  st->need_parsing = AVSTREAM_PARSE_FULL;
              }
+         } else if (st->codec->codec_type == AVMEDIA_TYPE_DATA) {
+             int codec_id = mxf_get_codec_ul(mxf_data_essence_container_uls,
+                                             essence_container_ul)->id;
+             if (codec_id >= 0 &&
+                 codec_id < FF_ARRAY_ELEMS(mxf_data_essence_descriptor)) {
+                 av_dict_set(&st->metadata, "data_type",
+                             mxf_data_essence_descriptor[codec_id], 0);
+             }
          }
          if (descriptor->extradata) {
 -            st->codec->extradata = av_mallocz(descriptor->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
 -            if (st->codec->extradata) {
 +            if (!ff_alloc_extradata(st->codec, descriptor->extradata_size)) {
                  memcpy(st->codec->extradata, descriptor->extradata, descriptor->extradata_size);
 -                st->codec->extradata_size = descriptor->extradata_size;
              }
          } else if (st->codec->codec_id == AV_CODEC_ID_H264) {
              ret = ff_generate_avci_extradata(st);
@@@ -1826,9 -1807,9 +1843,10 @@@ static const MXFMetadataReadTableEntry 
      { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x51,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* MPEG 2 Video */
      { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* Wave */
      { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x47,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* AES3 */
+     { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x5c,0x00 }, mxf_read_generic_descriptor, sizeof(MXFDescriptor), Descriptor }, /* VANC/VBI - SMPTE 436M */
      { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3A,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Static Track */
      { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x3B,0x00 }, mxf_read_track, sizeof(MXFTrack), Track }, /* Generic Track */
 +    { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x14,0x00 }, mxf_read_timecode_component, sizeof(MXFTimecodeComponent), TimecodeComponent },
      { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x04,0x01,0x02,0x02,0x00,0x00 }, mxf_read_cryptographic_context, sizeof(MXFCryptoContext), CryptoContext },
      { { 0x06,0x0e,0x2b,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x02,0x01,0x01,0x10,0x01,0x00 }, mxf_read_index_table_segment, sizeof(MXFIndexTableSegment), IndexTableSegment },
      { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, NULL, 0, AnyType },