[xiph-commits] r3002 - liboggplay/trunk/src/tools

shans at svn.annodex.net shans at svn.annodex.net
Tue Jun 19 04:14:18 PDT 2007


Author: shans
Date: 2007-06-19 04:14:17 -0700 (Tue, 19 Jun 2007)
New Revision: 3002

Modified:
   liboggplay/trunk/src/tools/glut-player.c
Log:
Simple testing framework for seeking: seek forward or backwards by 1 second



Modified: liboggplay/trunk/src/tools/glut-player.c
===================================================================
--- liboggplay/trunk/src/tools/glut-player.c	2007-06-19 10:47:46 UTC (rev 3001)
+++ liboggplay/trunk/src/tools/glut-player.c	2007-06-19 11:14:17 UTC (rev 3002)
@@ -195,6 +195,7 @@
 #endif
 
 static int        window;
+static long       ld_time;
 
 void display_frame(void) {
   int                     i;
@@ -260,6 +261,7 @@
            */
           required = oggplay_callback_info_get_required(track_info[i]);
           video_data = oggplay_callback_info_get_video_data(headers[0]);
+          ld_time = oggplay_callback_info_get_presentation_time(headers[0]);
           handle_video_data(player, i, video_data, n_frames);
           /*
           printf("video fst %ld lst %ld\n",
@@ -327,6 +329,14 @@
     }
     oggplay_close(player);
     exit(0);
+  } else if (k == 'l') {
+    if (oggplay_seek(player, ld_time + 1000) == E_OGGPLAY_CANT_SEEK) {
+      printf("can't seek forwards!\n");
+    }
+  } else if (k == 'k') {
+    if (oggplay_seek(player, ld_time - 1000) == E_OGGPLAY_CANT_SEEK) {
+      printf("cant seek backwards!\n");
+    }
   }
   
 }



More information about the commits mailing list