- if (enc->codec_type == CODEC_TYPE_AUDIO) {
- switch (enc->codec_id) {
- case CODEC_ID_AMR_NB:
- { /* We must find out how many AMR blocks there are in one packet */
- static uint16_t packed_size[16] =
- {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 0};
- int len = 0;
-
- while (len < size && samplesInChunk < 100) {
- len += packed_size[(pkt->data[len] >> 3) & 0x0F];
- samplesInChunk++;
- }
- }
- break;
- case CODEC_ID_PCM_MULAW:
- case CODEC_ID_PCM_ALAW:
- samplesInChunk = size/enc->channels;
- break;
- case CODEC_ID_PCM_S16BE:
- case CODEC_ID_PCM_S16LE:
- samplesInChunk = size/(2*enc->channels);
- break;
- case CODEC_ID_PCM_S24BE:
- case CODEC_ID_PCM_S24LE:
- samplesInChunk = size/(3*enc->channels);
- break;
- case CODEC_ID_PCM_S32BE:
- case CODEC_ID_PCM_S32LE:
- samplesInChunk = size/(4*enc->channels);
- break;
- default:
- samplesInChunk = 1;
+ if (enc->codec_id == CODEC_ID_AMR_NB) {
+ /* We must find out how many AMR blocks there are in one packet */
+ static uint16_t packed_size[16] =
+ {13, 14, 16, 18, 20, 21, 27, 32, 6, 0, 0, 0, 0, 0, 0, 0};
+ int len = 0;
+
+ while (len < size && samplesInChunk < 100) {
+ len += packed_size[(pkt->data[len] >> 3) & 0x0F];
+ samplesInChunk++;