Mercurial > libavformat.hg
comparison rmdec.c @ 3945:4928ebaaf2bd libavformat
add ok parts to the rm demuxer for SIPRO support
author | banan |
---|---|
date | Fri, 26 Sep 2008 12:12:25 +0000 |
parents | 77b99eddf88a |
children | 2e7994e45100 |
comparison
equal
deleted
inserted
replaced
3944:7141e56c9f69 | 3945:4928ebaaf2bd |
---|---|
125 av_log(s, AV_LOG_ERROR, "rm->audio_framesize * sub_packet_h too large\n"); | 125 av_log(s, AV_LOG_ERROR, "rm->audio_framesize * sub_packet_h too large\n"); |
126 return -1; | 126 return -1; |
127 } | 127 } |
128 | 128 |
129 rm->audiobuf = av_malloc(rm->audio_framesize * sub_packet_h); | 129 rm->audiobuf = av_malloc(rm->audio_framesize * sub_packet_h); |
130 } else if ((!strcmp(buf, "cook")) || (!strcmp(buf, "atrc"))) { | 130 } else if ((!strcmp(buf, "cook")) || (!strcmp(buf, "atrc")) || (!strcmp(buf, "sipr"))) { |
131 int codecdata_length, i; | 131 int codecdata_length, i; |
132 get_be16(pb); get_byte(pb); | 132 get_be16(pb); get_byte(pb); |
133 if (((version >> 16) & 0xff) == 5) | 133 if (((version >> 16) & 0xff) == 5) |
134 get_byte(pb); | 134 get_byte(pb); |
135 codecdata_length = get_be32(pb); | 135 codecdata_length = get_be32(pb); |
137 av_log(s, AV_LOG_ERROR, "codecdata_length too large\n"); | 137 av_log(s, AV_LOG_ERROR, "codecdata_length too large\n"); |
138 return -1; | 138 return -1; |
139 } | 139 } |
140 | 140 |
141 if (!strcmp(buf, "cook")) st->codec->codec_id = CODEC_ID_COOK; | 141 if (!strcmp(buf, "cook")) st->codec->codec_id = CODEC_ID_COOK; |
142 else if (!strcmp(buf, "sipr")) st->codec->codec_id = CODEC_ID_SIPR; | |
142 else st->codec->codec_id = CODEC_ID_ATRAC3; | 143 else st->codec->codec_id = CODEC_ID_ATRAC3; |
143 st->codec->extradata_size= codecdata_length; | 144 st->codec->extradata_size= codecdata_length; |
144 st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); | 145 st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); |
145 for(i = 0; i < codecdata_length; i++) | 146 for(i = 0; i < codecdata_length; i++) |
146 ((uint8_t*)st->codec->extradata)[i] = get_byte(pb); | 147 ((uint8_t*)st->codec->extradata)[i] = get_byte(pb); |
555 if(rm_assemble_video_frame(s, rm, pkt, len) == 1) | 556 if(rm_assemble_video_frame(s, rm, pkt, len) == 1) |
556 return -1; //got partial frame | 557 return -1; //got partial frame |
557 } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { | 558 } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
558 if ((st->codec->codec_id == CODEC_ID_RA_288) || | 559 if ((st->codec->codec_id == CODEC_ID_RA_288) || |
559 (st->codec->codec_id == CODEC_ID_COOK) || | 560 (st->codec->codec_id == CODEC_ID_COOK) || |
560 (st->codec->codec_id == CODEC_ID_ATRAC3)) { | 561 (st->codec->codec_id == CODEC_ID_ATRAC3) || |
562 (st->codec->codec_id == CODEC_ID_SIPR)) { | |
561 int x; | 563 int x; |
562 int sps = rm->sub_packet_size; | 564 int sps = rm->sub_packet_size; |
563 int cfs = rm->coded_framesize; | 565 int cfs = rm->coded_framesize; |
564 int h = rm->sub_packet_h; | 566 int h = rm->sub_packet_h; |
565 int y = rm->sub_packet_cnt; | 567 int y = rm->sub_packet_cnt; |