[xiph-commits] r11037 - trunk/maemo/OggPlay/src

mgrimme at svn.xiph.org mgrimme at svn.xiph.org
Mon Mar 20 07:32:31 PST 2006


Author: mgrimme
Date: 2006-03-20 07:32:26 -0800 (Mon, 20 Mar 2006)
New Revision: 11037

Modified:
   trunk/maemo/OggPlay/src/Makefile.am
   trunk/maemo/OggPlay/src/audio.c
   trunk/maemo/OggPlay/src/audio.h
Log:
improved scratchbox compatibility

Modified: trunk/maemo/OggPlay/src/Makefile.am
===================================================================
--- trunk/maemo/OggPlay/src/Makefile.am	2006-03-20 08:55:14 UTC (rev 11036)
+++ trunk/maemo/OggPlay/src/Makefile.am	2006-03-20 15:32:26 UTC (rev 11037)
@@ -10,5 +10,5 @@
 oggplay_CFLAGS = $(GTK_CFLAGS) $(OSSO_CFLAGS)
 
 oggplay_LDADD = $(GTK_LIBS) $(OSSO_LIBS) \
-                /usr/lib/libvorbisidec.la \
+                /usr/local/lib/libvorbisidec.la \
                 -lSDL

Modified: trunk/maemo/OggPlay/src/audio.c
===================================================================
--- trunk/maemo/OggPlay/src/audio.c	2006-03-20 08:55:14 UTC (rev 11036)
+++ trunk/maemo/OggPlay/src/audio.c	2006-03-20 15:32:26 UTC (rev 11037)
@@ -32,7 +32,7 @@
 
   buffer = g_new0(Uint8, size);
   tmp = g_new0(char, 8);
-
+  printf ("ga\n");
   while (filled < size) {
     /* don't hang here if audio buffer became empty */
     if (! ringbuffer_is_empty(audio->buffer)) {  
@@ -65,6 +65,7 @@
   Audio *audio = g_new0(Audio, 1);
   audio->buffer = ringbuffer_new(1000, 128);
   audio->opened = FALSE;
+  audio->nodevice = FALSE;
   audio->volume = 64;
 
   if (SDL_Init(SDL_INIT_AUDIO) < 0) {
@@ -110,10 +111,12 @@
   /* open audio device */
   if (SDL_OpenAudio(&format, NULL) < 0) {
     fprintf(stderr, "Could not open audio device: %s\n", SDL_GetError());
+    audio->nodevice = TRUE;
   } else {
-    audio->opened = TRUE;
+    audio->nodevice = FALSE;
     SDL_PauseAudio(0);
   }
+  audio->opened = TRUE;
 
 }
 
@@ -143,8 +146,12 @@
   ((long *) tmp)[0] = timetag;
 
   /* transmit the time tag and the audio data */
-  ringbuffer_put(audio->buffer, tmp, 8);
-  ringbuffer_put(audio->buffer, data, size);
+  if (audio->nodevice) {
+    audio->timetag = timetag;
+  } else {
+    ringbuffer_put(audio->buffer, tmp, 8);
+    ringbuffer_put(audio->buffer, data, size);
+  }
 
   g_free(tmp);
 

Modified: trunk/maemo/OggPlay/src/audio.h
===================================================================
--- trunk/maemo/OggPlay/src/audio.h	2006-03-20 08:55:14 UTC (rev 11036)
+++ trunk/maemo/OggPlay/src/audio.h	2006-03-20 15:32:26 UTC (rev 11037)
@@ -30,6 +30,7 @@
   RingBuffer *buffer;
 
   gboolean opened;
+  gboolean nodevice;  /* useful for running in scratchbox */
   int volume;
   int channels;
   int rate;



More information about the commits mailing list