Revision 3840147e libavformat/mov.c

View differences:

libavformat/mov.c
831 831
    if((uint64_t)atom.size > (1<<30))
832 832
        return -1;
833 833

  
834
    // pass all frma atom to codec, needed at least for QDM2
835
    av_free(st->codec->extradata);
836
    st->codec->extradata_size = atom.size;
837
    st->codec->extradata = (uint8_t*) av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
838

  
839
    if (st->codec->extradata) {
840
        get_buffer(pb, st->codec->extradata, atom.size);
841
        //av_log(NULL, AV_LOG_DEBUG, "Reading frma %Ld  %s\n", atom.size, (char*)st->codec->extradata);
842
    } else
834
    if (st->codec->codec_id == CODEC_ID_QDM2) {
835
        // pass all frma atom to codec, needed at least for QDM2
836
        av_free(st->codec->extradata);
837
        st->codec->extradata_size = atom.size;
838
        st->codec->extradata = (uint8_t*) av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
839

  
840
        if (st->codec->extradata) {
841
            get_buffer(pb, st->codec->extradata, atom.size);
842
            //av_log(NULL, AV_LOG_DEBUG, "Reading frma %Ld  %s\n", atom.size, (char*)st->codec->extradata);
843
        } else
844
            url_fskip(pb, atom.size);
845
    } else if (atom.size > 8) { /* to read frma, esds atoms */
846
        mov_read_default(c, pb, atom);
847
    } else if (atom.size > 0)
843 848
        url_fskip(pb, atom.size);
844

  
845 849
    return 0;
846 850
}
847 851

  
......
944 948

  
945 949
    while(entries--) { //Parsing Sample description table
946 950
        enum CodecID id;
951
        offset_t start_pos = url_ftell(pb);
947 952
        int size = get_be32(pb); /* size */
948 953
        format = get_le32(pb); /* data format */
949 954

  
......
1006 1011
            st->codec->time_base.den      = 25;
1007 1012
            st->codec->time_base.num = 1;
1008 1013
*/
1009
            size -= (16+8*4+2+32+2*2);
1010 1014
#if 0
1011 1015
            while (size >= 8) {
1012 1016
                MOV_atom_t a;
......
1147 1151
            } else
1148 1152
                st->codec->palctrl = NULL;
1149 1153

  
1150
            a.size = size;
1151
            mov_read_default(c, pb, a);
1154
            a.size = size - (url_ftell(pb) - start_pos);
1155
            if (a.size > 8)
1156
                mov_read_default(c, pb, a);
1157
            else if (a.size > 0)
1158
                url_fskip(pb, a.size);
1152 1159
#endif
1153 1160
        } else {
1154 1161
            st->codec->codec_id = codec_get_id(mov_audio_tags, format);

Also available in: Unified diff