mod = load_start_module("flash0:/kd/audiocodec.prx");
else mod = load_start_module("flash0:/kd/avcodec.prx");
if (mod < 0) {
- ret = mod = load_start_module("flash0:/kd/audiocodec_260.prx"); // last chance..
+ ret = mod;
+ mod = load_start_module("flash0:/kd/audiocodec_260.prx"); // last chance..
if (mod < 0) goto fail;
}
goto fail2;
}
+ /* use slightly higher prio then main */
thread_exit = 0;
- thid = sceKernelCreateThread("mp3decode_thread", decode_thread, 30, 0x2000, 0, 0); /* use slightly higher prio then main */
+ thid = sceKernelCreateThread("mp3decode_thread", decode_thread, 30, 0x2000, 0, NULL);
if (thid < 0) {
lprintf("failed to create decode thread: %08x\n", thid);
ret = thid;
}
+void mp3_reopen_file(void)
+{
+ if (mp3_fname == NULL) return;
+ lprintf("mp3_reopen_file(%s)\n", mp3_fname);
+
+ // try closing, just in case
+ if (mp3_handle >= 0) sceIoClose(mp3_handle);
+
+ mp3_handle = sceIoOpen(mp3_fname, PSP_O_RDONLY, 0777);
+ if (mp3_handle >= 0)
+ sceIoLseek32(mp3_handle, mp3_src_pos, PSP_SEEK_SET);
+ lprintf("mp3_reopen_file %s\n", mp3_handle >= 0 ? "ok" : "failed");
+}
+