CFfmpegDec::Decoder -fix possible floating point exception

Origin commit data
------------------
Commit: 9a6a2f70c6
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2014-02-17 (Mon, 17 Feb 2014)
This commit is contained in:
Jacek Jendrzej
2014-02-17 16:24:44 +01:00
parent 1b4e545c5d
commit b136c4cf32

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;