summaryrefslogtreecommitdiff
path: root/apps/plugins/video.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2004-10-13 23:59:15 +0000
committerJens Arnold <amiconn@rockbox.org>2004-10-13 23:59:15 +0000
commit2a0d541a38a27f829f673c17b0cae12af492a710 (patch)
tree365f0390599bcfd126b5533600b90acf03e1f0dc /apps/plugins/video.c
parent0fc34c773fa17266e0932dca8b154203dab8d53a (diff)
downloadrockbox-2a0d541a38a27f829f673c17b0cae12af492a710.tar.gz
rockbox-2a0d541a38a27f829f673c17b0cae12af492a710.zip
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
Diffstat (limited to 'apps/plugins/video.c')
-rw-r--r--apps/plugins/video.c22
1 files changed, 16 insertions, 6 deletions
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
157 int nSeekAcc; // accelleration value for seek 157 int nSeekAcc; // accelleration value for seek
158 int nSeekPos; // current file position for seek 158 int nSeekPos; // current file position for seek
159 bool bDiskSleep; // disk is suspended 159 bool bDiskSleep; // disk is suspended
160#if FREQ == 12000000 /* Ondio speed kludge */
161 int nFrameTimeAdjusted;
162#endif
160} gPlay; 163} gPlay;
161 164
162// buffer information 165// buffer information
@@ -528,7 +531,11 @@ int SeekTo(int fd, int nPos)
528 { 531 {
529 gPlay.bVideoUnderrun = false; 532 gPlay.bVideoUnderrun = false;
530 // start display interrupt 533 // start display interrupt
534#if FREQ == 12000000 /* Ondio speed kludge */
535 rb->plugin_register_timer(gPlay.nFrameTimeAdjusted, 1, timer4_isr);
536#else
531 rb->plugin_register_timer(gFileHdr.video_frametime, 1, timer4_isr); 537 rb->plugin_register_timer(gFileHdr.video_frametime, 1, timer4_isr);
538#endif
532 } 539 }
533 540
534 return 0; 541 return 0;
@@ -704,8 +711,13 @@ int PlayTick(int fd)
704 } 711 }
705 if (gPlay.bHasVideo) 712 if (gPlay.bHasVideo)
706 { // start the video 713 { // start the video
714#if FREQ == 12000000 /* Ondio speed kludge */
715 rb->plugin_register_timer(
716 gPlay.nFrameTimeAdjusted, 1, timer4_isr);
717#else
707 rb->plugin_register_timer( 718 rb->plugin_register_timer(
708 gFileHdr.video_frametime, 1, timer4_isr); 719 gFileHdr.video_frametime, 1, timer4_isr);
720#endif
709 } 721 }
710 } 722 }
711 break; 723 break;
@@ -862,14 +874,12 @@ int main(char* filename)
862 gFileHdr.video_format = VIDEOFORMAT_RAW; 874 gFileHdr.video_format = VIDEOFORMAT_RAW;
863 gFileHdr.video_width = LCD_WIDTH; 875 gFileHdr.video_width = LCD_WIDTH;
864 gFileHdr.video_height = LCD_HEIGHT; 876 gFileHdr.video_height = LCD_HEIGHT;
865 gFileHdr.video_frametime = FREQ / FPS; 877 gFileHdr.video_frametime = 11059200 / FPS;
866 gFileHdr.bps_peak = gFileHdr.bps_average = LCD_WIDTH * LCD_HEIGHT * FPS; 878 gFileHdr.bps_peak = gFileHdr.bps_average = LCD_WIDTH * LCD_HEIGHT * FPS;
867 } 879 }
868#if FREQ == 12000000 880
869/* temporary sync fix for Ondio, as .rvf is tailored to the recorder CPU freq 881#if FREQ == 12000000 /* Ondio speed kludge, 625 / 576 == 12000000 / 11059200 */
870 * 625 / 576 == 12000000 / 11059200 */ 882 gPlay.nFrameTimeAdjusted = (gFileHdr.video_frametime * 625) / 576;
871 else
872 gFileHdr.video_frametime = (gFileHdr.video_frametime * 625) / 576;
873#endif 883#endif
874 884
875 // continue buffer init: align the end, calc low water, read sizes 885 // continue buffer init: align the end, calc low water, read sizes