Mercurial > libavformat.hg
comparison flvdec.c @ 887:d70e50f1495f libavformat
COSMETICS: tabs --> spaces, some prettyprinting
author | diego |
---|---|
date | Thu, 22 Dec 2005 01:10:11 +0000 |
parents | da1d5db0ce5c |
children | edbe5c3717f9 |
comparison
equal
deleted
inserted
replaced
886:7ed1351f8c7e | 887:d70e50f1495f |
---|---|
153 if((flags >> 4) == 5) | 153 if((flags >> 4) == 5) |
154 st->codec->sample_rate= 8000; | 154 st->codec->sample_rate= 8000; |
155 else | 155 else |
156 st->codec->sample_rate = (44100<<((flags>>2)&3))>>3; | 156 st->codec->sample_rate = (44100<<((flags>>2)&3))>>3; |
157 switch(flags >> 4){/* 0: uncompressed 1: ADPCM 2: mp3 5: Nellymoser 8kHz mono 6: Nellymoser*/ | 157 switch(flags >> 4){/* 0: uncompressed 1: ADPCM 2: mp3 5: Nellymoser 8kHz mono 6: Nellymoser*/ |
158 case 0: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16BE; | 158 case 0: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16BE; |
159 else st->codec->codec_id = CODEC_ID_PCM_S8; break; | 159 else st->codec->codec_id = CODEC_ID_PCM_S8; break; |
160 case 1: st->codec->codec_id = CODEC_ID_ADPCM_SWF; break; | 160 case 1: st->codec->codec_id = CODEC_ID_ADPCM_SWF; break; |
161 case 2: st->codec->codec_id = CODEC_ID_MP3; break; | 161 case 2: st->codec->codec_id = CODEC_ID_MP3; break; |
162 // this is not listed at FLV but at SWF, strange... | 162 // this is not listed at FLV but at SWF, strange... |
163 case 3: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16LE; | 163 case 3: if (flags&2) st->codec->codec_id = CODEC_ID_PCM_S16LE; |
164 else st->codec->codec_id = CODEC_ID_PCM_S8; break; | 164 else st->codec->codec_id = CODEC_ID_PCM_S8; break; |
165 default: | 165 default: |
166 av_log(s, AV_LOG_INFO, "Unsupported audio codec (%x)\n", flags >> 4); | 166 av_log(s, AV_LOG_INFO, "Unsupported audio codec (%x)\n", flags >> 4); |
167 st->codec->codec_tag= (flags >> 4); | 167 st->codec->codec_tag= (flags >> 4); |
168 } | 168 } |
169 st->codec->bits_per_sample = (flags & 2) ? 16 : 8; | 169 st->codec->bits_per_sample = (flags & 2) ? 16 : 8; |
170 } | 170 } |
171 }else{ | 171 }else{ |
172 st->codec->codec_type = CODEC_TYPE_VIDEO; | 172 st->codec->codec_type = CODEC_TYPE_VIDEO; |
173 switch(flags & 0xF){ | 173 switch(flags & 0xF){ |
174 case 2: st->codec->codec_id = CODEC_ID_FLV1; break; | 174 case 2: st->codec->codec_id = CODEC_ID_FLV1; break; |
175 default: | 175 default: |
176 av_log(s, AV_LOG_INFO, "Unsupported video codec (%x)\n", flags & 0xf); | 176 av_log(s, AV_LOG_INFO, "Unsupported video codec (%x)\n", flags & 0xf); |
177 st->codec->codec_tag= flags & 0xF; | 177 st->codec->codec_tag= flags & 0xF; |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 ret= av_get_packet(&s->pb, pkt, size - 1); | 181 ret= av_get_packet(&s->pb, pkt, size - 1); |
187 pkt->size = ret; | 187 pkt->size = ret; |
188 pkt->pts = pts; | 188 pkt->pts = pts; |
189 pkt->stream_index = st->index; | 189 pkt->stream_index = st->index; |
190 | 190 |
191 if (is_audio || ((flags >> 4)==1)) | 191 if (is_audio || ((flags >> 4)==1)) |
192 pkt->flags |= PKT_FLAG_KEY; | 192 pkt->flags |= PKT_FLAG_KEY; |
193 | 193 |
194 return ret; | 194 return ret; |
195 } | 195 } |
196 | 196 |
197 static int flv_read_close(AVFormatContext *s) | 197 static int flv_read_close(AVFormatContext *s) |