summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-03-08 20:14:04 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-03-08 20:14:04 +0000
commit24e2bb34385b645415721e04371c45d8cb541d25 (patch)
tree92b2fabbf87e9e25f533e9ecb8d3b731606724cc /apps
parent315761497ccd3a1131ecda8acee8c032339e7a50 (diff)
downloadrockbox-24e2bb34385b645415721e04371c45d8cb541d25.tar.gz
rockbox-24e2bb34385b645415721e04371c45d8cb541d25.tar.bz2
rockbox-24e2bb34385b645415721e04371c45d8cb541d25.zip
loops have not been OK, were showing one frame more than available
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4351 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/video.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/plugins/video.c b/apps/plugins/video.c
index fa1e453744..c2117adab3 100644
--- a/apps/plugins/video.c
+++ b/apps/plugins/video.c
@@ -374,6 +374,7 @@ void timer4_isr(void) // IMIA4
if (gBuf.bEOF && (gFileHdr.flags & FLAG_LOOP))
{ // loop now, assuming the looped clip fits in memory
gBuf.pReadVideo = gBuf.pBufStart + gFileHdr.video_1st_frame;
+ // FixMe: pReadVideo is incremented below
}
else
{
@@ -382,11 +383,13 @@ void timer4_isr(void) // IMIA4
return; // no data available
}
}
-
- gBuf.pReadVideo += gFileHdr.blocksize;
- if (gBuf.pReadVideo >= gBuf.pBufEnd)
- gBuf.pReadVideo -= gBuf.bufsize; // wraparound
- available -= gFileHdr.blocksize;
+ else // normal advance for next time
+ {
+ gBuf.pReadVideo += gFileHdr.blocksize;
+ if (gBuf.pReadVideo >= gBuf.pBufEnd)
+ gBuf.pReadVideo -= gBuf.bufsize; // wraparound
+ available -= gFileHdr.blocksize;
+ }
if (!gPlay.bHasAudio)
break; // no need to skip any audio
@@ -425,7 +428,7 @@ void GetMoreMp3(unsigned char** start, int* size)
if (!gBuf.bEOF && available < gStats.minAudioAvail)
gStats.minAudioAvail = available;
- if (available < advance + gFileHdr.blocksize || advance == 0)
+ if (available < advance + (int)gFileHdr.blocksize || advance == 0)
{
gPlay.bAudioUnderrun = true;
return; // no data available