[xiph-commits] r3081 - liboggplay/trunk/plugin

shans at svn.annodex.net shans at svn.annodex.net
Tue Jun 26 21:22:36 PDT 2007


Author: shans
Date: 2007-06-26 21:22:35 -0700 (Tue, 26 Jun 2007)
New Revision: 3081

Modified:
   liboggplay/trunk/plugin/plugin_gui_linux.c
Log:
Removed USE_AUDIO flag, neatened up audio handling in display loop



Modified: liboggplay/trunk/plugin/plugin_gui_linux.c
===================================================================
--- liboggplay/trunk/plugin/plugin_gui_linux.c	2007-06-27 04:18:17 UTC (rev 3080)
+++ liboggplay/trunk/plugin/plugin_gui_linux.c	2007-06-27 04:22:35 UTC (rev 3081)
@@ -50,9 +50,7 @@
 #include <oggplay/oggplay_tools.h>
 #include "plugin_tools.h"
 
-#ifdef USE_AUDIO
 #include "sydney_audio.h"
-#endif
 
 typedef struct {
   int                   width;
@@ -66,9 +64,7 @@
   semaphore             start_stop_sem;
   PluginPlaybackState   playback_state;
   void                * new_oggplay_handle;
-#ifdef USE_AUDIO
   SAAudioHandle       * audio_handle;
-#endif
   gboolean	            audio_opened;
   gboolean	            tried_audio;
   int64_t               playback_target;
@@ -95,6 +91,7 @@
   err = sa_device_open(info->audio_handle);
   if (err) {
   	info->audio_opened = FALSE;
+    info->playback_target = oggplay_sys_time_in_ms() << 16; 
     return;
   } 
   return;
@@ -112,12 +109,10 @@
     info->new_oggplay_handle = NULL;
     SEM_SIGNAL(info->oggplay_replace_sem); 
     shut_oggplay(old_ogg_handle);
-#ifdef USE_AUDIO  
     if (info->audio_opened == TRUE)
       sa_device_close(info->audio_handle);
     info->audio_opened = FALSE;
     info->tried_audio = FALSE;
-#endif
     return TRUE;
   }
   
@@ -148,9 +143,7 @@
   PluginWindowInfo  * info      = (PluginWindowInfo *)_info;
   int64_t             offset;
   PluginOggFrame      frame_data;
-#ifdef USE_AUDIO
   int64_t 	          bytes;
-#endif
   int64_t             cur_time;
 
   frame_data.frame = NULL;
@@ -168,24 +161,18 @@
   }
 
   get_oggplay_frame(info->ogg_handle, &frame_data);
+
   if (frame_data.video_data != NULL) {    
     render_frame_to_screen(info, &frame_data);
   } else if (frame_data.samples == NULL) {
     return TRUE;
   }
 
-#ifdef USE_AUDIO
   if (info->tried_audio == FALSE && frame_data.samples != NULL) {
     info->tried_audio = TRUE;
     open_audio(info);
   }
 
-  if (info->audio_opened == FALSE) 
-#endif
-  {
-    info->playback_target = oggplay_sys_time_in_ms() << 16; 
-  }
- 
   if (frame_data.cmml_strings != NULL) {      
       onCMMLData(info->pluginInstance, frame_data.cmml_strings, 
                       frame_data.cmml_size);
@@ -193,7 +180,6 @@
 
 calc_offset:
   
-#ifdef USE_AUDIO  
   if (info->audio_opened == TRUE) {
   	/* buffer audio */
   	if 
@@ -215,7 +201,6 @@
   	}
   } 
   else 
-#endif
   {
     cur_time = oggplay_sys_time_in_ms();
   }
@@ -289,12 +274,10 @@
 
   gtk_main();
 
-#ifdef USE_AUDIO  
   if (info->audio_opened == TRUE)
     sa_device_close(info->audio_handle);
   info->audio_handle = NULL;
   info->audio_opened = FALSE;
-#endif
   info->shutdown_gui = 0;
 
   pthread_exit(NULL);



More information about the commits mailing list