Skip to content

Commit 43da7c1

Browse files
committed
core mcd, more fixes for ogg
1 parent 3571dc8 commit 43da7c1

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
- uses: actions/checkout@v4
2323
with:
2424
submodules: true
25+
- name: Install dependencies
26+
run: |
27+
sudo apt-get update -qq
28+
sudo apt-get install -y libvorbis-dev
2529
- name: make
2630
run: LDFLAGS=-Wl,--no-undefined make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.libretro
2731
- name: artifacts

pico/cd/cd_image.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static int handle_ogg(const char *fname, int index)
6868

6969
if (fs <= 0)
7070
{
71-
elprintf(EL_STATUS, "track %2i: mp3 length %i", index+1, fs);
71+
elprintf(EL_STATUS, "track %2i: ogg length %i", index+1, fs);
7272
fclose(tmp_file);
7373
return -1;
7474
}

platform/common/ogg.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,21 @@ static int decoder_active;
2626

2727
// need this as ov_clear would close the FILE* otherwise
2828
static int ov_fseek(void *f, ogg_int64_t off, int wence)
29-
{
30-
return fseek(f, off, wence);
31-
}
32-
ov_callbacks ogg_cb = {
33-
(size_t (*)(void *, size_t, size_t, void *)) fread,
34-
(int (*)(void *, ogg_int64_t, int)) ov_fseek,
35-
(int (*)(void *)) NULL /*fclose*/,
36-
(long (*)(void *)) ftell
37-
};
29+
{ return fseek(f, off, wence); }
30+
static size_t ov_fread(void *buf, size_t sz, size_t n, void *f)
31+
{ return fread(buf, sz, n, f); }
32+
static long ov_ftell(void *f)
33+
{ return ftell(f); }
34+
static ov_callbacks ogg_cb = { ov_fread, ov_fseek, NULL /*fclose*/, ov_ftell };
3835

3936
int ogg_get_length(void *f_)
4037
{
4138
FILE *f = f_;
42-
int fs;
39+
int fs, ret;
4340

44-
if (ov_open_callbacks(f, &ogg_current_file, NULL, 0, ogg_cb))
45-
return -1;
41+
ret = ov_open_callbacks(f, &ogg_current_file, NULL, 0, ogg_cb);
42+
if (ret < 0)
43+
return ret;
4644

4745
fs = ov_time_total(&ogg_current_file, -1);
4846
ov_clear(&ogg_current_file);

0 commit comments

Comments
 (0)