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

shans at svn.annodex.net shans at svn.annodex.net
Wed Jun 13 18:20:18 PDT 2007


Author: shans
Date: 2007-06-13 18:20:18 -0700 (Wed, 13 Jun 2007)
New Revision: 2915

Modified:
   liboggplay/trunk/src/tools/glut-player.c
Log:
Some of the required framework to play audio-only files through glut-player



Modified: liboggplay/trunk/src/tools/glut-player.c
===================================================================
--- liboggplay/trunk/src/tools/glut-player.c	2007-06-14 01:19:41 UTC (rev 2914)
+++ liboggplay/trunk/src/tools/glut-player.c	2007-06-14 01:20:18 UTC (rev 2915)
@@ -30,6 +30,8 @@
 #define USE_AUDIO 0
 #endif
 
+#define USE_AUDIO 0
+
 #if USE_AUDIO
 #include <sys/soundcard.h>
 
@@ -413,7 +415,8 @@
   }
 
   printf ("there are %d tracks\n", oggplay_get_num_tracks (player));
-  
+ 
+  video_track = -1; 
   for (i = 0; i < oggplay_get_num_tracks (player); i++) {
     printf("Track %d is of type %s\n", i, 
                     oggplay_get_track_typename (player, i));
@@ -422,9 +425,6 @@
       oggplay_set_callback_num_frames (player, i, 1);
       video_track = i;
       ret = oggplay_get_video_fps(player, i , &fps_denom, &fps_num);
-      if (ret != E_OGGPLAY_UNINITIALISED) {
-      	printf("Frame rate information FPS_DENOM: %d, FPS_NUM: %d\n", fps_denom, fps_num);
-      } else printf("Video data not ready\n");
     }
     else if 
     (
@@ -438,9 +438,7 @@
       oggplay_set_offset(player, i, 250L);
       ret = oggplay_get_audio_samplerate(player, i , &rate);
       ret = oggplay_get_audio_channels(player, i, &channels);
-      if (ret != E_OGGPLAY_UNINITIALISED) {
-      	printf("Audio sample rate: %d and audio channels %d\n", rate, channels); 
-      } else printf("Audio data not ready\n");
+      printf("samplerate: %d channels: %d\n", rate, channels);
     }
 
     if (oggplay_set_track_active(player, i) < 0) {
@@ -448,6 +446,10 @@
     }
   }
 
+  if (video_track == -1) {
+    oggplay_set_callback_num_frames(player, audio_track, 2048);
+  }
+
 #if DISPLAY_FRAMES
   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);



More information about the commits mailing list