Revision d9b1c197 libavformat/mov.c

View differences:

libavformat/mov.c
145 145
    { CODEC_ID_AMR_WB, MKTAG('s', 'a', 'w', 'b') }, /* AMR-WB 3gp */
146 146
    { CODEC_ID_AC3, MKTAG('m', 's', 0x20, 0x00) }, /* Dolby AC-3 */
147 147
    { CODEC_ID_ALAC,MKTAG('a', 'l', 'a', 'c') }, /* Apple Lossless */
148
    { CODEC_ID_QDM2,MKTAG('Q', 'D', 'M', '2') }, /* QDM2 */
148 149
    { CODEC_ID_NONE, 0 },
149 150
};
150 151

  
......
709 710
    return 0;
710 711
}
711 712

  
713
static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
714
{
715
    AVStream *st = c->fc->streams[c->fc->nb_streams-1];
716

  
717
    if((uint64_t)atom.size > (1<<30))
718
        return -1;
719
    
720
    // pass all frma atom to codec, needed at least for QDM2
721
    av_free(st->codec->extradata);
722
    st->codec->extradata_size = atom.size;
723
    st->codec->extradata = (uint8_t*) av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
724

  
725
    if (st->codec->extradata) {
726
	get_buffer(pb, st->codec->extradata, atom.size);
727
	//av_log(NULL, AV_LOG_DEBUG, "Reading frma %Ld  %s\n", atom.size, (char*)st->codec->extradata);
728
    } else
729
	url_fskip(pb, atom.size);
730

  
731
    return 0;
732
}
733

  
712 734
static int mov_read_avcC(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
713 735
{
714 736
    AVStream *st = c->fc->streams[c->fc->nb_streams-1];
......
1605 1627
{ MKTAG( 'u', 'r', 'n', ' ' ), mov_read_leaf },
1606 1628
{ MKTAG( 'u', 'u', 'i', 'd' ), mov_read_leaf },
1607 1629
{ MKTAG( 'v', 'm', 'h', 'd' ), mov_read_leaf }, /* video media info header */
1608
{ MKTAG( 'w', 'a', 'v', 'e' ), mov_read_default },
1630
{ MKTAG( 'w', 'a', 'v', 'e' ), mov_read_wave },
1609 1631
/* extra mp4 */
1610 1632
{ MKTAG( 'M', 'D', 'E', 'S' ), mov_read_leaf },
1611 1633
/* QT atoms */

Also available in: Unified diff