diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-13 05:56:20 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-14 19:25:08 +0100 |
commit | b26f0ee39fed503a05dcbc870ea20bce1ca9caf5 (patch) | |
tree | afdfeb59f53a19295def675ac07faa6eca39dd9c | |
parent | 83b12c16af4f75ff21faaa6c4bff5c71edff3ba0 (diff) | |
download | ffmpeg-b26f0ee39fed503a05dcbc870ea20bce1ca9caf5.tar.gz |
avidec: XMPG support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/avidec.c | 23 | ||||
-rw-r--r-- | libavformat/riff.c | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index c8932541c8..76dda0f8f7 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -698,6 +698,29 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) } } break; + case MKTAG('s', 't', 'r', 'd'): + if (stream_index >= (unsigned)s->nb_streams || st->codec->extradata_size) { + avio_skip(pb, size); + } else { + uint64_t cur_pos = avio_tell(pb); + if (cur_pos < list_end) + size = FFMIN(size, list_end - cur_pos); + st = s->streams[stream_index]; + + if(size<(1<<30)){ + st->codec->extradata_size= size; + st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + if (!st->codec->extradata) { + st->codec->extradata_size= 0; + return AVERROR(ENOMEM); + } + avio_read(pb, st->codec->extradata, st->codec->extradata_size); + } + + if(st->codec->extradata_size & 1) //FIXME check if the encoder really did this correctly + avio_r8(pb); + } + break; case MKTAG('i', 'n', 'd', 'x'): i= avio_tell(pb); if(pb->seekable && !(s->flags & AVFMT_FLAG_IGNIDX) && avi->use_odml && diff --git a/libavformat/riff.c b/libavformat/riff.c index cd2c9a0f0c..712488d337 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -135,6 +135,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { { CODEC_ID_MPEG2VIDEO, MKTAG('E', 'M', '2', 'V') }, { CODEC_ID_MPEG2VIDEO, MKTAG('M', '7', '0', '1') }, /* Matrox MPEG2 intra-only */ { CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', 'g', 'v') }, + { CODEC_ID_MPEG1VIDEO, MKTAG('X', 'M', 'P', 'G') }, /* Xing MPEG intra only */ { CODEC_ID_MJPEG, MKTAG('M', 'J', 'P', 'G') }, { CODEC_ID_MJPEG, MKTAG('L', 'J', 'P', 'G') }, { CODEC_ID_MJPEG, MKTAG('d', 'm', 'b', '1') }, |