Update VGMStream.
parent
e94cb95bf5
commit
42a43316b8
|
@ -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;
|
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->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->framesRead = 0;
|
||||||
data->endOfStream = 0;
|
data->endOfStream = 0;
|
||||||
data->endOfAudio = 0;
|
data->endOfAudio = 0;
|
||||||
|
|
|
@ -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)
|
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)
|
int get_vgmstream_average_bitrate(VGMSTREAM * vgmstream)
|
||||||
|
|
Loading…
Reference in New Issue