Add .ogv [Bloody Rondo (PC)]

This commit is contained in:
bnnm 2021-04-10 22:47:11 +02:00
parent 157c50f2e1
commit 1f0abe0c64
9 changed files with 56 additions and 0 deletions

View File

@ -369,6 +369,7 @@ static const char* extension_list[] = {
//"ogg", //common
"ogl",
"ogv",
"oma", //FFmpeg/not parsed (ATRAC3/ATRAC3PLUS/MP3/LPCM/WMA)
"omu",
//"opus", //common
@ -1348,6 +1349,7 @@ static const meta_info meta_info_list[] = {
{meta_TAC, "tri-Ace Codec header"},
{meta_IDSP_TOSE, "TOSE .IDSP header"},
{meta_DSP_KWA, "Kuju London .KWA header"},
{meta_OGV_3RDEYE, "3rdEye .OGV header"},
};
void get_vgmstream_coding_description(VGMSTREAM* vgmstream, char* out, size_t out_size) {

View File

@ -1154,6 +1154,10 @@
RelativePath=".\meta\ogl.c"
>
</File>
<File
RelativePath=".\meta\ogv_3rdeye.c"
>
</File>
<File
RelativePath=".\meta\omu.c"
>

View File

@ -421,6 +421,7 @@
<ClCompile Include="meta\ogg_opus.c" />
<ClCompile Include="meta\ogg_vorbis.c" />
<ClCompile Include="meta\ogl.c" />
<ClCompile Include="meta\ogv_3rdeye.c" />
<ClCompile Include="meta\omu.c" />
<ClCompile Include="meta\otm.c" />
<ClCompile Include="meta\p3d.c" />

View File

@ -760,6 +760,9 @@
<ClCompile Include="meta\ogl.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="meta\ogv_3rdeye.c">
<Filter>meta\Source Files</Filter>
</ClCompile>
<ClCompile Include="meta\omu.c">
<Filter>meta\Source Files</Filter>
</ClCompile>

View File

@ -949,4 +949,6 @@ VGMSTREAM* init_vgmstream_mjb_mjh(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_tac(STREAMFILE* sf);
VGMSTREAM* init_vgmstream_ogv_3rdeye(STREAMFILE* sf);
#endif /*_META_H*/

View File

@ -583,6 +583,8 @@ VGMSTREAM* init_vgmstream_ogg_vorbis_callbacks(STREAMFILE* sf, ov_callbacks* cal
vgmstream->coding_type = coding_OGG_VORBIS;
vgmstream->layout_type = layout_none;
vgmstream->meta_type = ovmi->meta_type;
if (!vgmstream->meta_type)
vgmstream->meta_type = meta_OGG_VORBIS;
vgmstream->sample_rate = sample_rate;
vgmstream->stream_size = stream_size;

40
src/meta/ogv_3rdeye.c Normal file
View File

@ -0,0 +1,40 @@
#include "meta.h"
#include "../coding/coding.h"
/* OGV - .ogg container (not related to ogv video) [Bloody Rondo (PC)] */
VGMSTREAM* init_vgmstream_ogv_3rdeye(STREAMFILE* sf) {
VGMSTREAM* vgmstream = NULL;
off_t subfile_offset, subfile_size;
/* checks */
if (!check_extensions(sf,"ogv"))
goto fail;
if (!is_id32be(0x00,sf, "OGV\0"))
goto fail;
/* 0x04: PCM size */
subfile_size = read_u32le(0x08, sf);
/* 0x0c: "fmt" + RIFF fmt + "data" (w/ PCM size too) */
subfile_offset = 0x2c;
/* no loops (files bgm does full loops but sfx doesn't) */
#ifdef VGM_USE_VORBIS
{
ogg_vorbis_meta_info_t ovmi = {0};
ovmi.meta_type = meta_OGV_3RDEYE;
ovmi.stream_size = subfile_size;
vgmstream = init_vgmstream_ogg_vorbis_callbacks(sf, NULL, subfile_offset, &ovmi);
}
#else
goto fail;
#endif
return vgmstream;
fail:
close_vgmstream(vgmstream);
return NULL;
}

View File

@ -526,6 +526,7 @@ VGMSTREAM* (*init_vgmstream_functions[])(STREAMFILE* sf) = {
init_vgmstream_tac,
init_vgmstream_idsp_tose,
init_vgmstream_dsp_kwa,
init_vgmstream_ogv_3rdeye,
/* lowest priority metas (should go after all metas, and TXTH should go before raw formats) */
init_vgmstream_txth, /* proper parsers should supersede TXTH, once added */

View File

@ -759,6 +759,7 @@ typedef enum {
meta_TAC,
meta_IDSP_TOSE,
meta_DSP_KWA,
meta_OGV_3RDEYE,
} meta_t;
/* standard WAVEFORMATEXTENSIBLE speaker positions */