From 7876eed573331c01fb8e675c8f70b7b8062d122f Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Thu, 24 Apr 2014 18:11:53 -0700 Subject: [PATCH] Fixed playptmod length detection when testing for vblank timing --- Frameworks/playptmod/playptmod/playptmod.c | 1 + Plugins/playptmod/playptmod/ptmodDecoder.m | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Frameworks/playptmod/playptmod/playptmod.c b/Frameworks/playptmod/playptmod/playptmod.c index 18fe5a178..8ef0d00dd 100644 --- a/Frameworks/playptmod/playptmod/playptmod.c +++ b/Frameworks/playptmod/playptmod/playptmod.c @@ -2844,6 +2844,7 @@ void playptmod_Play(void *_p, unsigned int startOrder) memcpy(p->source->sampleData, p->source->originalSampleData, p->source->head.totalSampleSize); memset(p->orderPlayed, 0, sizeof(p->orderPlayed)); + p->loopCounter = 0; p->orderPlayed[startOrder] = 1; p->modulePlaying = true; } diff --git a/Plugins/playptmod/playptmod/ptmodDecoder.m b/Plugins/playptmod/playptmod/ptmodDecoder.m index 576d292c8..4c0215738 100755 --- a/Plugins/playptmod/playptmod/ptmodDecoder.m +++ b/Plugins/playptmod/playptmod/ptmodDecoder.m @@ -85,9 +85,16 @@ BOOL probe_length( void * ptmod, unsigned long * intro_length, unsigned long * l if ( !probe_length(mod, &normal_intro_length, &normal_loop_length, 0, data, size, track_num) ) return NO; - if ( can_be_vblank && !probe_length(mod, &vblank_intro_length, &vblank_loop_length, 1, data, size, track_num) ) - return NO; - else vblank_intro_length = 0, vblank_loop_length = 0; + if ( can_be_vblank ) + { + if ( !probe_length(mod, &vblank_intro_length, &vblank_loop_length, 1, data, size, track_num) ) + return NO; + } + else + { + vblank_intro_length = 0; + vblank_loop_length = 0; + } playptmod_Free(mod);