if(avctx->channels > MAX_CHANNELS)
return -1;
+ if(avctx->bit_rate < 24*1000)
+ return -1;
+
/* extract flag infos */
flags1 = 0;
flags2 = 1;
if (avctx->codec->id == CODEC_ID_WMAV1) {
extradata= av_malloc(4);
avctx->extradata_size= 4;
- extradata[0] = flags1;
- extradata[1] = flags1>>8;
- extradata[2] = flags2;
- extradata[3] = flags2>>8;
+ AV_WL16(extradata, flags1);
+ AV_WL16(extradata+2, flags2);
} else if (avctx->codec->id == CODEC_ID_WMAV2) {
extradata= av_mallocz(10);
avctx->extradata_size= 10;
- extradata[0] = flags1;
- extradata[1] = flags1>>8;
- extradata[2] = flags1>>16;
- extradata[3] = flags1>>24;
- extradata[4] = flags2;
- extradata[5] = flags2>>8;
+ AV_WL32(extradata, flags1);
+ AV_WL16(extradata+4, flags2);
}else
assert(0);
avctx->extradata= extradata;
memcpy(s->output, s->frame_out[channel], sizeof(float)*window_len);
j = channel;
for (i = 0; i < len; i++, j += avctx->channels){
- s->output[i+window_len] = audio[j] / n * win[i];
- s->frame_out[channel][i] = audio[j] / n * win[window_len - i - 1];
+ s->output[i+window_len] = audio[j] / n * win[window_len - i - 1];
+ s->frame_out[channel][i] = audio[j] / n * win[i];
}
ff_mdct_calc(&s->mdct_ctx[window_index], s->coefs[channel], s->output, s->mdct_tmp);
}