From 2a0d541a38a27f829f673c17b0cae12af492a710 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 13 Oct 2004 23:59:15 +0000 Subject: BUG FIX: Corrected the speed kludge for Ondio video playback. The previous solution changed the frame time directly in the file header structure, causing the changed value to be saved together with resume position, therefore destroying sync for any further playback. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5271 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/video.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'apps') diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 63d03312b9..e63ef1c373 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c @@ -157,6 +157,9 @@ static struct int nSeekAcc; // accelleration value for seek int nSeekPos; // current file position for seek bool bDiskSleep; // disk is suspended +#if FREQ == 12000000 /* Ondio speed kludge */ + int nFrameTimeAdjusted; +#endif } gPlay; // buffer information @@ -528,7 +531,11 @@ int SeekTo(int fd, int nPos) { gPlay.bVideoUnderrun = false; // start display interrupt +#if FREQ == 12000000 /* Ondio speed kludge */ + rb->plugin_register_timer(gPlay.nFrameTimeAdjusted, 1, timer4_isr); +#else rb->plugin_register_timer(gFileHdr.video_frametime, 1, timer4_isr); +#endif } return 0; @@ -704,8 +711,13 @@ int PlayTick(int fd) } if (gPlay.bHasVideo) { // start the video +#if FREQ == 12000000 /* Ondio speed kludge */ + rb->plugin_register_timer( + gPlay.nFrameTimeAdjusted, 1, timer4_isr); +#else rb->plugin_register_timer( gFileHdr.video_frametime, 1, timer4_isr); +#endif } } break; @@ -862,14 +874,12 @@ int main(char* filename) gFileHdr.video_format = VIDEOFORMAT_RAW; gFileHdr.video_width = LCD_WIDTH; gFileHdr.video_height = LCD_HEIGHT; - gFileHdr.video_frametime = FREQ / FPS; + gFileHdr.video_frametime = 11059200 / FPS; gFileHdr.bps_peak = gFileHdr.bps_average = LCD_WIDTH * LCD_HEIGHT * FPS; } -#if FREQ == 12000000 -/* temporary sync fix for Ondio, as .rvf is tailored to the recorder CPU freq - * 625 / 576 == 12000000 / 11059200 */ - else - gFileHdr.video_frametime = (gFileHdr.video_frametime * 625) / 576; + +#if FREQ == 12000000 /* Ondio speed kludge, 625 / 576 == 12000000 / 11059200 */ + gPlay.nFrameTimeAdjusted = (gFileHdr.video_frametime * 625) / 576; #endif // continue buffer init: align the end, calc low water, read sizes -- cgit v1.2.3