diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/video.c | 15 |
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 | |||
374 | if (gBuf.bEOF && (gFileHdr.flags & FLAG_LOOP)) | 374 | if (gBuf.bEOF && (gFileHdr.flags & FLAG_LOOP)) |
375 | { // loop now, assuming the looped clip fits in memory | 375 | { // loop now, assuming the looped clip fits in memory |
376 | gBuf.pReadVideo = gBuf.pBufStart + gFileHdr.video_1st_frame; | 376 | gBuf.pReadVideo = gBuf.pBufStart + gFileHdr.video_1st_frame; |
377 | // FixMe: pReadVideo is incremented below | ||
377 | } | 378 | } |
378 | else | 379 | else |
379 | { | 380 | { |
@@ -382,11 +383,13 @@ void timer4_isr(void) // IMIA4 | |||
382 | return; // no data available | 383 | return; // no data available |
383 | } | 384 | } |
384 | } | 385 | } |
385 | 386 | else // normal advance for next time | |
386 | gBuf.pReadVideo += gFileHdr.blocksize; | 387 | { |
387 | if (gBuf.pReadVideo >= gBuf.pBufEnd) | 388 | gBuf.pReadVideo += gFileHdr.blocksize; |
388 | gBuf.pReadVideo -= gBuf.bufsize; // wraparound | 389 | if (gBuf.pReadVideo >= gBuf.pBufEnd) |
389 | available -= gFileHdr.blocksize; | 390 | gBuf.pReadVideo -= gBuf.bufsize; // wraparound |
391 | available -= gFileHdr.blocksize; | ||
392 | } | ||
390 | 393 | ||
391 | if (!gPlay.bHasAudio) | 394 | if (!gPlay.bHasAudio) |
392 | break; // no need to skip any audio | 395 | break; // no need to skip any audio |
@@ -425,7 +428,7 @@ void GetMoreMp3(unsigned char** start, int* size) | |||
425 | if (!gBuf.bEOF && available < gStats.minAudioAvail) | 428 | if (!gBuf.bEOF && available < gStats.minAudioAvail) |
426 | gStats.minAudioAvail = available; | 429 | gStats.minAudioAvail = available; |
427 | 430 | ||
428 | if (available < advance + gFileHdr.blocksize || advance == 0) | 431 | if (available < advance + (int)gFileHdr.blocksize || advance == 0) |
429 | { | 432 | { |
430 | gPlay.bAudioUnderrun = true; | 433 | gPlay.bAudioUnderrun = true; |
431 | return; // no data available | 434 | return; // no data available |