Skip to content

Commit

Permalink
build for toaru64
Browse files Browse the repository at this point in the history
  • Loading branch information
klange committed Jun 11, 2021
1 parent ca765b3 commit 489a515
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CC = i686-pc-toaru-gcc
CC = x86_64-pc-toaru-gcc

all: playmp3 libminimp3.so

libminimp3.so: minimp3.c
$(CC) -shared -fPIC -o $@ $< -lm
$(CC) -O2 -shared -fPIC -o $@ $< -lm

playmp3: playmp3.c libminimp3.so
$(CC) -o $@ $< -L. -lminimp3 -lm -lc
Expand Down
5 changes: 4 additions & 1 deletion playmp3.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ int main(int argc, char * argv[]) {
fprintf(stderr, "Frame size is %d, file data is at 0x%x\n", frame_size, file_data);

while ((bytes_left >= 0) && (frame_size > 0)) {
size_t w = 0;
while (w < info.audio_bytes) {
w += write(spkr, (const void *)( (char *)sample_buf + w), info.audio_bytes - w);
}
stream_pos += frame_size;
bytes_left -= frame_size;
write(spkr, (const void *) sample_buf, info.audio_bytes);
frame_size = mp3_decode(mp3, stream_pos, bytes_left, sample_buf, NULL);
}

Expand Down

0 comments on commit 489a515

Please sign in to comment.