vgmstream/src/meta/mogg.c
bnnm e2a3590158 Remove layout_ogg and cleanup
Layout was not actually needed, remove to simplify. Rename
vgm_vorbis_info_t to ogg_vorbis_meta_info_t to clarify it's only for
meta, also don't pass filename to init ogg (not useful even as an
optimization since getting the name is a minuscule part in parsing a
meta)
2018-03-23 16:34:48 +01:00

40 lines
1.0 KiB
C

/*
2017-12-10: Preliminary MOGG Support. As long as the stream is unencrypted, this should be fine.
This will also work on unconventional 5 channel Vorbis streams but some sound cards might not like it.
TODO (Eventually): Add decryption for encrypted MOGG types (Rock Band, etc.)
-bxaimc
*/
#include "meta.h"
#include "../coding/coding.h"
/* MOGG - Harmonix Music Systems (Guitar Hero)[Unencrypted Type] */
VGMSTREAM * init_vgmstream_mogg(STREAMFILE *streamFile) {
#ifdef VGM_USE_VORBIS
off_t start_offset;
/* checks */
if (!check_extensions(streamFile, "mogg"))
goto fail;
{
ogg_vorbis_meta_info_t ovmi = {0};
VGMSTREAM * result = NULL;
ovmi.meta_type = meta_MOGG;
start_offset = read_32bitLE(0x04, streamFile);
result = init_vgmstream_ogg_vorbis_callbacks(streamFile, NULL, start_offset, &ovmi);
if (result != NULL) {
return result;
}
}
fail:
/* clean up anything we may have opened */
#endif
return NULL;
}