mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-02-20 20:41:08 +01:00
Use libvorbis instead of FFmpeg
This commit is contained in:
parent
c4b259f5d8
commit
abbe2ae80f
@ -379,22 +379,17 @@ static VGMSTREAM * init_vgmstream_ubi_bao_base(ubi_bao_header * bao, STREAMFILE
|
||||
vgmstream->layout_type = layout_none;
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef VGM_USE_VORBIS
|
||||
case FMT_OGG: {
|
||||
ffmpeg_codec_data *ffmpeg_data;
|
||||
|
||||
ffmpeg_data = init_ffmpeg_offset(streamData, start_offset, bao->stream_size);
|
||||
if (!ffmpeg_data) goto fail;
|
||||
vgmstream->codec_data = ffmpeg_data;
|
||||
vgmstream->coding_type = coding_FFmpeg;
|
||||
vgmstream->codec_data = init_ogg_vorbis(streamData, start_offset, bao->stream_size, NULL);
|
||||
if (!vgmstream->codec_data) goto fail;
|
||||
vgmstream->coding_type = coding_OGG_VORBIS;
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
vgmstream->num_samples = bao->num_samples; /* ffmpeg_data->totalSamples */
|
||||
VGM_ASSERT(bao->num_samples != ffmpeg_data->totalSamples,
|
||||
"UBI BAO: header samples %i vs ffmpeg %i differ\n", bao->num_samples, (uint32_t)ffmpeg_data->totalSamples);
|
||||
vgmstream->num_samples = bao->num_samples; /* same as Ogg samples */
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
default:
|
||||
goto fail;
|
||||
|
@ -661,14 +661,12 @@ static VGMSTREAM * init_vgmstream_ubi_sb_base(ubi_sb_header *sb, STREAMFILE *str
|
||||
xma_fix_raw_samples_ch(vgmstream, streamData, start_offset, sb->stream_size, sb->channels, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef VGM_USE_VORBIS
|
||||
case FMT_OGG: {
|
||||
ffmpeg_codec_data *ffmpeg_data;
|
||||
|
||||
ffmpeg_data = init_ffmpeg_offset(streamData, start_offset, sb->stream_size);
|
||||
if ( !ffmpeg_data ) goto fail;
|
||||
vgmstream->codec_data = ffmpeg_data;
|
||||
vgmstream->coding_type = coding_FFmpeg;
|
||||
vgmstream->codec_data = init_ogg_vorbis(streamData, start_offset, sb->stream_size, NULL);
|
||||
if (!vgmstream->codec_data) goto fail;
|
||||
vgmstream->coding_type = coding_OGG_VORBIS;
|
||||
vgmstream->layout_type = layout_none;
|
||||
break;
|
||||
}
|
||||
|
@ -540,11 +540,12 @@ VGMSTREAM * init_vgmstream_xwb(STREAMFILE *streamFile) {
|
||||
vgmstream->layout_type = layout_none;
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef VGM_USE_VORBIS
|
||||
case OGG: { /* Oddworld: Strangers Wrath (iOS/Android) extension */
|
||||
vgmstream->codec_data = init_ffmpeg_offset(streamFile, xwb.stream_offset, xwb.stream_size);
|
||||
if ( !vgmstream->codec_data ) goto fail;
|
||||
vgmstream->coding_type = coding_FFmpeg;
|
||||
vgmstream->codec_data = init_ogg_vorbis(streamFile, xwb.stream_offset, xwb.stream_size, NULL);
|
||||
if (!vgmstream->codec_data) goto fail;
|
||||
vgmstream->coding_type = coding_OGG_VORBIS;
|
||||
vgmstream->layout_type = layout_none;
|
||||
break;
|
||||
}
|
||||
|
@ -97,14 +97,15 @@ VGMSTREAM * init_vgmstream_xwc(STREAMFILE *streamFile) {
|
||||
xma_fix_raw_samples(vgmstream, streamFile, start_offset,data_size, 0, 0,0); /* samples are ok, fix delay */
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
#ifdef VGM_USE_VORBIS
|
||||
case 0x564F5242: { /* "VORB" (PC) */
|
||||
start_offset = 0x30;
|
||||
data_size = data_size - start_offset;
|
||||
|
||||
vgmstream->codec_data = init_ffmpeg_offset(streamFile, start_offset,data_size);
|
||||
vgmstream->codec_data = init_ogg_vorbis(streamFile, start_offset, data_size, NULL);
|
||||
if ( !vgmstream->codec_data ) goto fail;
|
||||
vgmstream->coding_type = coding_FFmpeg;
|
||||
vgmstream->coding_type = coding_OGG_VORBIS;
|
||||
vgmstream->layout_type = layout_none;
|
||||
|
||||
vgmstream->sample_rate = read_32bitLE(start_offset + 0x28, streamFile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user