further unification and refactoring
[libpicofe.git] / psp / mp3.c
index af50611..c1e6089 100644 (file)
--- a/psp/mp3.c
+++ b/psp/mp3.c
@@ -11,8 +11,8 @@
 #include <pspaudiocodec.h>
 #include <kubridge.h>
 
-#include "../../Pico/PicoInt.h"
-#include "../../Pico/sound/mix.h"
+#include "../../pico/pico_int.h"
+#include "../../pico/sound/mix.h"
 #include "../common/lprintf.h"
 
 int mp3_last_error = 0;
@@ -373,6 +373,9 @@ void mp3_start_play(FILE *f, int pos)
                mp3_fname = fname;
        }
 
+       // clear decoder state
+       sceAudiocodecInit(mp3_codec_struct, 0x1002);
+
        // seek..
        mp3_src_pos = (int) (((float)pos / 1023.0f) * (float)mp3_src_size);
        sceIoLseek32(mp3_handle, mp3_src_pos, PSP_SEEK_SET);
@@ -460,7 +463,7 @@ int mp3_get_offset(void) // 0-1023
        unsigned int offs1024 = 0;
        int cdda_on;
 
-       cdda_on = (PicoMCD & 1) && (PicoOpt&0x800) && !(Pico_mcd->s68k_regs[0x36] & 1) &&
+       cdda_on = (PicoAHW & PAHW_MCD) && (PicoOpt&0x800) && !(Pico_mcd->s68k_regs[0x36] & 1) &&
                        (Pico_mcd->scd.Status_CDC & 1) && mp3_handle >= 0;
 
        if (cdda_on) {