Ticket #263: chan.diff

File chan.diff, 1.3 KB (added by Andrew Wason, 15 years ago)

patch to handle other 'chan' atom sizes

  • libavformat/isom.c

    diff --git a/libavformat/isom.c b/libavformat/isom.c
    index 45ccdd2..dcc3b74 100644
    a b void ff_mov_read_chan(AVFormatContext *s, int64_t size, AVCodecContext *codec)  
    459459    uint32_t layout_tag;
    460460    AVIOContext *pb = s->pb;
    461461    const MovChannelLayout *layouts = mov_channel_layout;
    462     if (size != 12) {
     462    layout_tag = avio_rb32(pb);
     463    size -= 4;
     464    if (layout_tag == 0) { //< kCAFChannelLayoutTag_UseChannelDescriptions
    463465        // Channel descriptions not implemented
    464466        av_log_ask_for_sample(s, "Unimplemented container channel layout.\n");
    465467        avio_skip(pb, size);
    466468        return;
    467469    }
    468     layout_tag = avio_rb32(pb);
    469470    if (layout_tag == 0x10000) { //< kCAFChannelLayoutTag_UseChannelBitmap
    470471        codec->channel_layout = avio_rb32(pb);
    471         avio_skip(pb, 4);
     472        size -= 4;
     473        avio_skip(pb, size);
    472474        return;
    473475    }
    474476    while (layouts->channel_layout) {
    void ff_mov_read_chan(AVFormatContext *s, int64_t size, AVCodecContext *codec)  
    480482    }
    481483    if (!codec->channel_layout)
    482484        av_log(s, AV_LOG_WARNING, "Unknown container channel layout.\n");
    483     avio_skip(pb, 8);
     485    avio_skip(pb, size);
    484486}
    485487
    486488void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout)