Index: apps/codecs/mpc.c
===================================================================
--- apps/codecs/mpc.c (Revision 30367)
+++ apps/codecs/mpc.c (Arbeitskopie)
@@ -125,6 +125,7 @@
/* Resume to saved sample offset. */
elapsed_time = 0;

+ /*
if (samplesdone > 0)
{
if (mpc_demux_seek_sample(demux, samplesdone) == MPC_STATUS_OK)
@@ -137,8 +138,11 @@
samplesdone = 0;
}
}
+ */

ci->set_elapsed(elapsed_time);
+ int loop_idx = 0;
+ int64_t resume_pos = 100 * (((mpc_uint64_t)ci->id3->offset * frequency) / byterate);

/* This is the decoding loop. */
do
@@ -148,6 +152,24 @@
if (action == CODEC_ACTION_HALT)
return CODEC_OK;

+ if (resume_pos > 0 && loop_idx == 0)
+ {
+ printf("start resume\n");
+ if (mpc_demux_seek_sample(demux, resume_pos) == MPC_STATUS_OK)
+ {
+ printf("resume ready\n");
+ samplesdone = resume_pos;
+ elapsed_time = (resume_pos*10)/frequency;
+ ci->set_elapsed(elapsed_time);
+ printf("resume set_elapsed\n");
+ }
+ else
+ {
+ samplesdone = 0;
+ }
+ }
+ ++loop_idx;
+
/* Complete seek handler. */
if (action == CODEC_ACTION_SEEK_TIME)
{