diff --git a/Frameworks/vgmstream/vgmstream/src/meta/ffmpeg.c b/Frameworks/vgmstream/vgmstream/src/meta/ffmpeg.c index ec509ac32..96ae82be1 100644 --- a/Frameworks/vgmstream/vgmstream/src/meta/ffmpeg.c +++ b/Frameworks/vgmstream/vgmstream/src/meta/ffmpeg.c @@ -277,7 +277,7 @@ ffmpeg_codec_data * init_ffmpeg_faux_riff(STREAMFILE *streamFile, int64_t fmt_of tb.num = 1; tb.den = data->codecCtx->sample_rate; data->totalFrames = av_rescale_q(data->formatCtx->streams[streamIndex]->duration, data->formatCtx->streams[streamIndex]->time_base, tb); - data->bitrate = (int)((data->codecCtx->bit_rate) / 1000); + data->bitrate = (int)(data->codecCtx->bit_rate); data->framesRead = 0; data->endOfStream = 0; data->endOfAudio = 0; diff --git a/Frameworks/vgmstream/vgmstream/src/vgmstream.c b/Frameworks/vgmstream/vgmstream/src/vgmstream.c index 972130324..9d76655a8 100644 --- a/Frameworks/vgmstream/vgmstream/src/vgmstream.c +++ b/Frameworks/vgmstream/vgmstream/src/vgmstream.c @@ -3540,7 +3540,7 @@ static STREAMFILE * get_vgmstream_streamfile(VGMSTREAM * vgmstream, int channel) static int get_vgmstream_channel_average_bitrate(STREAMFILE * streamfile, int sample_rate, int length_samples) { - return (int)((int64_t)get_streamfile_size(streamfile) * 8 * sample_rate / length_samples); + return length_samples ? (int)((int64_t)get_streamfile_size(streamfile) * 8 * sample_rate / length_samples) : 0; } int get_vgmstream_average_bitrate(VGMSTREAM * vgmstream)