···625625}
626626627627mpc_status mpc_demux_decode(mpc_demux * d, mpc_frame_info * i) {
628628- mpc_status s = mpc_demux_decode_inner(d, i);
629629- if (MPC_IS_FAILURE(s))
630630- i->bits = -1; // we pretend it's end of file
631631- return s;
628628+ for(;;) {
629629+ // mpc_demux_decode_inner may return 0 samples and require repeated calls after a seek. Loop over until we have data to return.
630630+ mpc_status s = mpc_demux_decode_inner(d, i);
631631+ if (MPC_IS_FAILURE(s))
632632+ i->bits = -1; // we pretend it's end of file
633633+634634+ if (MPC_IS_FAILURE(s) || i->samples > 0)
635635+ return s;
636636+ }
632637}
633638634639/* rockbox: not used