diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-29 01:40:34 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-29 01:40:34 +0100 |
commit | 6071e4d87a9b257c3f7b5912825ede9caa757624 (patch) | |
tree | aeaad3a1d7eb0b27f20a66665740d2a96e99f7c2 /libavformat/smjpeg.c | |
parent | 7e5cbb3c2d96c27d526aa69cbdbd1ab23739d7e5 (diff) | |
parent | 8f5216905f88510c9a74cd91a424902aa989b9a1 (diff) | |
download | ffmpeg-6071e4d87a9b257c3f7b5912825ede9caa757624.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
v410dec: Check for sufficient input data. Fixes crash
fate: Add v210 codec regression tests
mpegts: adjustable minimum PES payload
mpegts: properly output large audio packets
avformat: Add SMJPEG demuxer.
Indeo 4 decoder
Conflicts:
doc/general.texi
libavcodec/v410dec.c
libavcodec/version.h
libavformat/mpegtsenc.c
libavformat/smjpeg.c
libavformat/version.h
tests/codec-regression.sh
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/smjpeg.c')
-rw-r--r-- | libavformat/smjpeg.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libavformat/smjpeg.c b/libavformat/smjpeg.c index 86cdc46570..e23e0cb7a2 100644 --- a/libavformat/smjpeg.c +++ b/libavformat/smjpeg.c @@ -21,17 +21,21 @@ /** * @file - * This is a demuxer for Loki SDL MJPEG files + * This is a demuxer for Loki SDL Motion JPEG files */ #include "avformat.h" #include "internal.h" #include "riff.h" -static const AVCodecTag codec_smjpeg_tags[] = { +static const AVCodecTag codec_smjpeg_video_tags[] = { + { CODEC_ID_MJPEG, MKTAG('J', 'F', 'I', 'F') }, + { CODEC_ID_NONE, 0 }, +}; + +static const AVCodecTag codec_smjpeg_audio_tags[] = { { CODEC_ID_ADPCM_IMA_SMJPEG, MKTAG('A', 'P', 'C', 'M') }, { CODEC_ID_PCM_S16LE, MKTAG('N', 'O', 'N', 'E') }, - { CODEC_ID_MJPEG, MKTAG('J', 'F', 'I', 'F') }, { CODEC_ID_NONE, 0 }, }; @@ -57,9 +61,9 @@ static int smjpeg_read_header(AVFormatContext *s, AVFormatParameters *ap) avio_skip(pb, 8); // magic version = avio_rb32(pb); - if (version) { + if (version) av_log_ask_for_sample(s, "unknown version %d\n", version); - } + duration = avio_rb32(pb); // in msec while (!pb->eof_reached) { @@ -97,7 +101,7 @@ static int smjpeg_read_header(AVFormatContext *s, AVFormatParameters *ap) ast->codec->bits_per_coded_sample = avio_r8(pb); ast->codec->channels = avio_r8(pb); ast->codec->codec_tag = avio_rl32(pb); - ast->codec->codec_id = ff_codec_get_id(codec_smjpeg_tags, + ast->codec->codec_id = ff_codec_get_id(codec_smjpeg_audio_tags, ast->codec->codec_tag); ast->duration = duration; sc->audio_stream_index = ast->index; @@ -120,7 +124,7 @@ static int smjpeg_read_header(AVFormatContext *s, AVFormatParameters *ap) vst->codec->width = avio_rb16(pb); vst->codec->height = avio_rb16(pb); vst->codec->codec_tag = avio_rl32(pb); - vst->codec->codec_id = ff_codec_get_id(codec_smjpeg_tags, + vst->codec->codec_id = ff_codec_get_id(codec_smjpeg_video_tags, vst->codec->codec_tag); vst->duration = duration; sc->video_stream_index = vst->index; |