diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-14 20:56:44 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-14 21:04:44 +0100 |
commit | 074bae745d9d99d94ef99f870d0a6bb50d1e7a0b (patch) | |
tree | e340d9c145fd783a87b7574ebd6211c13a832d19 /libavformat/utils.c | |
parent | 0f969c00c6a32ea66da00e3b3f70fc62933968d1 (diff) | |
parent | ecf442a58b09bdb1dc1d2c3904b82ac5f79b2878 (diff) | |
download | ffmpeg-074bae745d9d99d94ef99f870d0a6bb50d1e7a0b.tar.gz |
Merge commit 'ecf442a58b09bdb1dc1d2c3904b82ac5f79b2878'
* commit 'ecf442a58b09bdb1dc1d2c3904b82ac5f79b2878':
lavf: improve support for AVC-Intra files.
Conflicts:
libavformat/internal.h
libavformat/isom.c
libavformat/mxfdec.c
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index f02312f372..4b5c014b9f 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -4171,7 +4171,7 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, return AVERROR(EINVAL); } -void ff_generate_avci_extradata(AVStream *st) +int ff_generate_avci_extradata(AVStream *st) { static const uint8_t avci100_1080p_extradata[] = { // SPS @@ -4238,8 +4238,10 @@ void ff_generate_avci_extradata(AVStream *st) 0x00, 0x00, 0x00, 0x01, 0x68, 0xce, 0x31, 0x12, 0x11 }; + + const uint8_t *data = NULL; int size = 0; - const uint8_t *data = 0; + if (st->codec->width == 1920) { if (st->codec->field_order == AV_FIELD_PROGRESSIVE) { data = avci100_1080p_extradata; @@ -4255,10 +4257,14 @@ void ff_generate_avci_extradata(AVStream *st) data = avci100_720p_extradata; size = sizeof(avci100_720p_extradata); } + if (!size) - return; + return 0; + av_freep(&st->codec->extradata); if (ff_alloc_extradata(st->codec, size)) - return; + return AVERROR(ENOMEM); memcpy(st->codec->extradata, data, size); + + return 0; } |