mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-28 16:30:54 +01:00
Simplify switch_opus_get_samples usage
This commit is contained in:
parent
d7c5c3feaf
commit
d2798c946a
@ -280,7 +280,7 @@ ffmpeg_codec_data * init_ffmpeg_switch_opus(STREAMFILE *streamFile, off_t start_
|
||||
ffmpeg_codec_data * init_ffmpeg_ue4_opus(STREAMFILE *streamFile, off_t start_offset, size_t data_size, int channels, int skip, int sample_rate);
|
||||
ffmpeg_codec_data * init_ffmpeg_ea_opus(STREAMFILE *streamFile, off_t start_offset, size_t data_size, int channels, int skip, int sample_rate);
|
||||
|
||||
size_t switch_opus_get_samples(off_t offset, size_t data_size, int sample_rate, STREAMFILE *streamFile);
|
||||
size_t switch_opus_get_samples(off_t offset, size_t data_size, STREAMFILE *streamFile);
|
||||
|
||||
size_t switch_opus_get_encoder_delay(off_t offset, STREAMFILE *streamFile);
|
||||
size_t ue4_opus_get_encoder_delay(off_t offset, STREAMFILE *streamFile);
|
||||
|
@ -468,7 +468,7 @@ static size_t opus_get_packet_samples(const uint8_t * buf, int len) {
|
||||
return opus_packet_get_nb_frames(buf, len) * opus_packet_get_samples_per_frame(buf, 48000);
|
||||
}
|
||||
|
||||
static size_t custom_opus_get_samples(off_t offset, size_t data_size, int sample_rate, STREAMFILE *streamFile, opus_type_t type) {
|
||||
static size_t custom_opus_get_samples(off_t offset, size_t data_size, STREAMFILE *streamFile, opus_type_t type) {
|
||||
size_t num_samples = 0;
|
||||
off_t end_offset = offset + data_size;
|
||||
|
||||
@ -508,8 +508,8 @@ static size_t custom_opus_get_samples(off_t offset, size_t data_size, int sample
|
||||
return num_samples;
|
||||
}
|
||||
|
||||
size_t switch_opus_get_samples(off_t offset, size_t data_size, int sample_rate, STREAMFILE *streamFile) {
|
||||
return custom_opus_get_samples(offset, data_size, sample_rate, streamFile, OPUS_SWITCH);
|
||||
size_t switch_opus_get_samples(off_t offset, size_t data_size, STREAMFILE *streamFile) {
|
||||
return custom_opus_get_samples(offset, data_size, streamFile, OPUS_SWITCH);
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ VGMSTREAM * init_vgmstream_opus_nxa(STREAMFILE *streamFile) {
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
if (vgmstream->num_samples == 0) {
|
||||
vgmstream->num_samples = switch_opus_get_samples(start_offset, data_size, vgmstream->sample_rate, streamFile) - skip;
|
||||
vgmstream->num_samples = switch_opus_get_samples(start_offset, data_size, streamFile) - skip;
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -50,7 +50,7 @@ static VGMSTREAM * init_vgmstream_opus(STREAMFILE *streamFile, meta_t meta_type,
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
if (vgmstream->num_samples == 0) {
|
||||
vgmstream->num_samples = switch_opus_get_samples(start_offset, data_size, vgmstream->sample_rate, streamFile) - skip;
|
||||
vgmstream->num_samples = switch_opus_get_samples(start_offset, data_size, streamFile) - skip;
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user