diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-01-19 19:58:48 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-01-19 19:58:48 +0000 |
commit | bb085dd6f162145d753f50262ff4407e38fee8e4 (patch) | |
tree | e0eadfdb9107a2e1dfdb6ab2259215a08e49b475 /libavformat/mxf.c | |
parent | 6e3ea4461fa9a77964efd2fa7ed1250dd1c8d43d (diff) | |
download | ffmpeg-bb085dd6f162145d753f50262ff4407e38fee8e4.tar.gz |
correctly handle sony mpeg4 extradata
Originally committed as revision 11571 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mxf.c')
-rw-r--r-- | libavformat/mxf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/mxf.c b/libavformat/mxf.c index 39628d54e5..098649f7d3 100644 --- a/libavformat/mxf.c +++ b/libavformat/mxf.c @@ -180,6 +180,7 @@ static const uint8_t mxf_klv_key[] = { 0x06,0x0e,0x2b,0x static const uint8_t mxf_crypto_source_container_ul[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x02,0x02,0x00,0x00,0x00 }; static const uint8_t mxf_encrypted_triplet_key[] = { 0x06,0x0e,0x2b,0x34,0x02,0x04,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x7e,0x01,0x00 }; static const uint8_t mxf_encrypted_essence_container[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x07,0x0d,0x01,0x03,0x01,0x02,0x0b,0x01,0x00 }; +static const uint8_t mxf_sony_mpeg4_extradata[] = { 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x01,0x0e,0x06,0x06,0x02,0x02,0x01,0x00,0x00 }; #define IS_KLV_KEY(x, y) (!memcmp(x, y, sizeof(y))) @@ -553,7 +554,7 @@ static void mxf_read_pixel_layout(ByteIOContext *pb, MXFDescriptor *descriptor) } while (code != 0); /* SMPTE 377M E.2.46 */ } -static int mxf_read_generic_descriptor(MXFDescriptor *descriptor, ByteIOContext *pb, int tag, int size) +static int mxf_read_generic_descriptor(MXFDescriptor *descriptor, ByteIOContext *pb, int tag, int size, UID uid) { switch(tag) { case 0x3F01: @@ -601,12 +602,15 @@ static int mxf_read_generic_descriptor(MXFDescriptor *descriptor, ByteIOContext case 0x3401: mxf_read_pixel_layout(pb, descriptor); break; - case 0x8201: /* Private tag used by SONY C0023S01.mxf */ + default: + /* Private uid used by SONY C0023S01.mxf */ + if (IS_KLV_KEY(uid, mxf_sony_mpeg4_extradata)) { descriptor->extradata = av_malloc(size); if (!descriptor->extradata) return -1; descriptor->extradata_size = size; get_buffer(pb, descriptor->extradata, size); + } break; } return 0; |