diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-09-26 12:13:53 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-11-14 18:59:39 +0100 |
commit | ecf442a58b09bdb1dc1d2c3904b82ac5f79b2878 (patch) | |
tree | b82cc9d1c164106eac10095d6c92994811787f1a /libavformat/mxfdec.c | |
parent | 951d819006730145255333749367c4ea722ffd9b (diff) | |
download | ffmpeg-ecf442a58b09bdb1dc1d2c3904b82ac5f79b2878.tar.gz |
lavf: improve support for AVC-Intra files.
Generate extradata with SPS/PPS based on container dimensions.
Authors of this commit are: Reimar and Thomas Mundt
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r-- | libavformat/mxfdec.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 3fcdb8220f..a947c6794d 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1466,10 +1466,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) /* TODO: drop PictureEssenceCoding and SoundEssenceCompression, only check EssenceContainer */ codec_ul = mxf_get_codec_ul(ff_mxf_codec_uls, &descriptor->essence_codec_ul); st->codec->codec_id = codec_ul->id; - if (descriptor->extradata) { - st->codec->extradata = descriptor->extradata; - st->codec->extradata_size = descriptor->extradata_size; - } + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { source_track->intra_only = mxf_is_intra_only(descriptor); container_ul = mxf_get_codec_ul(mxf_picture_essence_container_uls, essence_container_ul); @@ -1555,6 +1552,15 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) st->need_parsing = AVSTREAM_PARSE_FULL; } } + if (descriptor->extradata) { + st->codec->extradata = av_mallocz(descriptor->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + if (st->codec->extradata) + memcpy(st->codec->extradata, descriptor->extradata, descriptor->extradata_size); + } else if (st->codec->codec_id == AV_CODEC_ID_H264) { + ret = ff_generate_avci_extradata(st); + if (ret < 0) + return ret; + } if (st->codec->codec_type != AVMEDIA_TYPE_DATA && (*essence_container_ul)[15] > 0x01) { /* TODO: decode timestamps */ st->need_parsing = AVSTREAM_PARSE_TIMESTAMPS; |