aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorRoberto Togni <r_togni@tiscali.it>2005-10-18 20:16:43 +0000
committerRoberto Togni <r_togni@tiscali.it>2005-10-18 20:16:43 +0000
commitd9b1c197e5f99655328b713b7100e3125139546a (patch)
tree341d43d7b40c5533c6f35db90c13050a2ff8200b /libavformat/mov.c
parentea7e68b1e2e3983198cac5814720d6f7655299bc (diff)
downloadffmpeg-d9b1c197e5f99655328b713b7100e3125139546a.tar.gz
QDM2 compatible decoder
Originally committed as revision 4649 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 09552a48d7..71cd5113b0 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -145,6 +145,7 @@ static const CodecTag mov_audio_tags[] = {
{ CODEC_ID_AMR_WB, MKTAG('s', 'a', 'w', 'b') }, /* AMR-WB 3gp */
{ CODEC_ID_AC3, MKTAG('m', 's', 0x20, 0x00) }, /* Dolby AC-3 */
{ CODEC_ID_ALAC,MKTAG('a', 'l', 'a', 'c') }, /* Apple Lossless */
+ { CODEC_ID_QDM2,MKTAG('Q', 'D', 'M', '2') }, /* QDM2 */
{ CODEC_ID_NONE, 0 },
};
@@ -709,6 +710,27 @@ static int mov_read_smi(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
return 0;
}
+static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
+{
+ AVStream *st = c->fc->streams[c->fc->nb_streams-1];
+
+ if((uint64_t)atom.size > (1<<30))
+ return -1;
+
+ // pass all frma atom to codec, needed at least for QDM2
+ av_free(st->codec->extradata);
+ st->codec->extradata_size = atom.size;
+ st->codec->extradata = (uint8_t*) av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+
+ if (st->codec->extradata) {
+ get_buffer(pb, st->codec->extradata, atom.size);
+ //av_log(NULL, AV_LOG_DEBUG, "Reading frma %Ld %s\n", atom.size, (char*)st->codec->extradata);
+ } else
+ url_fskip(pb, atom.size);
+
+ return 0;
+}
+
static int mov_read_avcC(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
AVStream *st = c->fc->streams[c->fc->nb_streams-1];
@@ -1605,7 +1627,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG( 'u', 'r', 'n', ' ' ), mov_read_leaf },
{ MKTAG( 'u', 'u', 'i', 'd' ), mov_read_leaf },
{ MKTAG( 'v', 'm', 'h', 'd' ), mov_read_leaf }, /* video media info header */
-{ MKTAG( 'w', 'a', 'v', 'e' ), mov_read_default },
+{ MKTAG( 'w', 'a', 'v', 'e' ), mov_read_wave },
/* extra mp4 */
{ MKTAG( 'M', 'D', 'E', 'S' ), mov_read_leaf },
/* QT atoms */