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>
This commit is contained in:
Michael Niedermayer
2013-11-14 20:56:44 +01:00
5 changed files with 38 additions and 10 deletions

View File

@@ -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;
}