Revision 10e26bc7 libavformat/rm.c

View differences:

libavformat/rm.c
565 565
            }
566 566

  
567 567
            rm->audiobuf = av_malloc(rm->audio_framesize * sub_packet_h);
568
        } else if (!strcmp(buf, "cook")) {
568
        } else if ((!strcmp(buf, "cook")) || (!strcmp(buf, "atrc"))) {
569 569
            int codecdata_length, i;
570 570
            get_be16(pb); get_byte(pb);
571 571
            if (((version >> 16) & 0xff) == 5)
......
576 576
                return -1;
577 577
            }
578 578

  
579
            st->codec->codec_id = CODEC_ID_COOK;
579
            if (!strcmp(buf, "cook")) st->codec->codec_id = CODEC_ID_COOK;
580
            else st->codec->codec_id = CODEC_ID_ATRAC3;
580 581
            st->codec->extradata_size= codecdata_length;
581 582
            st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
582 583
            for(i = 0; i < codecdata_length; i++)
......
957 958

  
958 959
        } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
959 960
            if ((st->codec->codec_id == CODEC_ID_RA_288) ||
960
                (st->codec->codec_id == CODEC_ID_COOK)) {
961
                (st->codec->codec_id == CODEC_ID_COOK) ||
962
                (st->codec->codec_id == CODEC_ID_ATRAC3)) {
961 963
                int x;
962 964
                int sps = rm->sub_packet_size;
963 965
                int cfs = rm->coded_framesize;
......
975 977
                        for (x = 0; x < h/2; x++)
976 978
                            get_buffer(pb, rm->audiobuf+x*2*w+y*cfs, cfs);
977 979
                        break;
980
                    case CODEC_ID_ATRAC3:
978 981
                    case CODEC_ID_COOK:
979 982
                        for (x = 0; x < w/sps; x++)
980 983
                            get_buffer(pb, rm->audiobuf+sps*(h*x+((h+1)/2)*(y&1)+(y>>1)), sps);

Also available in: Unified diff