forked from len0rd/rockbox
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
This commit is contained in:
parent
315761497c
commit
24e2bb3438
1 changed files with 9 additions and 6 deletions
|
@ -374,6 +374,7 @@ void timer4_isr(void) // IMIA4
|
||||||
if (gBuf.bEOF && (gFileHdr.flags & FLAG_LOOP))
|
if (gBuf.bEOF && (gFileHdr.flags & FLAG_LOOP))
|
||||||
{ // loop now, assuming the looped clip fits in memory
|
{ // loop now, assuming the looped clip fits in memory
|
||||||
gBuf.pReadVideo = gBuf.pBufStart + gFileHdr.video_1st_frame;
|
gBuf.pReadVideo = gBuf.pBufStart + gFileHdr.video_1st_frame;
|
||||||
|
// FixMe: pReadVideo is incremented below
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -382,11 +383,13 @@ void timer4_isr(void) // IMIA4
|
||||||
return; // no data available
|
return; // no data available
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else // normal advance for next time
|
||||||
|
{
|
||||||
gBuf.pReadVideo += gFileHdr.blocksize;
|
gBuf.pReadVideo += gFileHdr.blocksize;
|
||||||
if (gBuf.pReadVideo >= gBuf.pBufEnd)
|
if (gBuf.pReadVideo >= gBuf.pBufEnd)
|
||||||
gBuf.pReadVideo -= gBuf.bufsize; // wraparound
|
gBuf.pReadVideo -= gBuf.bufsize; // wraparound
|
||||||
available -= gFileHdr.blocksize;
|
available -= gFileHdr.blocksize;
|
||||||
|
}
|
||||||
|
|
||||||
if (!gPlay.bHasAudio)
|
if (!gPlay.bHasAudio)
|
||||||
break; // no need to skip any audio
|
break; // no need to skip any audio
|
||||||
|
@ -425,7 +428,7 @@ void GetMoreMp3(unsigned char** start, int* size)
|
||||||
if (!gBuf.bEOF && available < gStats.minAudioAvail)
|
if (!gBuf.bEOF && available < gStats.minAudioAvail)
|
||||||
gStats.minAudioAvail = available;
|
gStats.minAudioAvail = available;
|
||||||
|
|
||||||
if (available < advance + gFileHdr.blocksize || advance == 0)
|
if (available < advance + (int)gFileHdr.blocksize || advance == 0)
|
||||||
{
|
{
|
||||||
gPlay.bAudioUnderrun = true;
|
gPlay.bAudioUnderrun = true;
|
||||||
return; // no data available
|
return; // no data available
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue