Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
avidec: XMPG support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Jan 14, 2012
1 parent 83b12c1 commit b26f0ee
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions libavformat/avidec.c
Expand Up @@ -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 &&
Expand Down
1 change: 1 addition & 0 deletions libavformat/riff.c
Expand Up @@ -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') },
Expand Down

0 comments on commit b26f0ee

Please sign in to comment.