CFfmpegDec::Decoder -fix possible floating point exception

This commit is contained in:
Jacek Jendrzej
2014-02-17 16:24:44 +01:00
parent 27c6bdccaf
commit 9a6a2f70c6

View File

@@ -247,16 +247,20 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state,
AVFrame *frame = NULL;
AVPacket rpacket;
av_init_packet(&rpacket);
c->channel_layout = c->channel_layout ? c->channel_layout : AV_CH_LAYOUT_STEREO;
av_opt_set_int(swr, "in_channel_layout", c->channel_layout, 0);
//av_opt_set_int(swr, "out_channel_layout", c->channel_layout, 0);
av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0);
av_opt_set_int(swr, "in_sample_rate", c->sample_rate, 0);
av_opt_set_int(swr, "out_sample_rate", c->sample_rate, 0);
av_opt_set_int(swr, "in_sample_fmt", c->sample_fmt, 0);
av_opt_set_int(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0);
av_opt_set_sample_fmt(swr, "in_sample_fmt", c->sample_fmt, 0);
av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0);
swr_init(swr);
if (( swr_init(swr)) < 0) {
Status=DATA_ERR;
return Status;
}
uint8_t *outbuf = NULL;
int outsamples = 0;