/[rdesktop]/jpeg/rdesktop/trunk/rdpsnd.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /jpeg/rdesktop/trunk/rdpsnd.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1265 by stargo, Sun Sep 17 20:06:37 2006 UTC revision 1273 by stargo, Sun Oct 1 10:56:39 2006 UTC
# Line 276  rdpsnd_process(STREAM s) Line 276  rdpsnd_process(STREAM s)
276          }          }
277  }  }
278    
279  BOOL  inline BOOL
 rdpsnd_init(void)  
 {  
         rdpsnd_channel =  
                 channel_register("rdpsnd", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,  
                                  rdpsnd_process);  
   
         return (rdpsnd_channel != NULL);  
 }  
   
 BOOL  
280  rdpsnd_auto_open(void)  rdpsnd_auto_open(void)
281  {  {
282          current_driver = drivers;          static BOOL failed = False;
283          while (current_driver != NULL)  
284            if (!failed)
285          {          {
286                  DEBUG(("trying %s...\n", current_driver->name));                  struct audio_driver *auto_driver = current_driver;
287                  if (current_driver->wave_out_open())  
288                    current_driver = drivers;
289                    while (current_driver != NULL)
290                  {                  {
291                          DEBUG(("selected %s\n", current_driver->name));                          DEBUG(("trying %s...\n", current_driver->name));
292                          return True;                          if (current_driver->wave_out_open())
293                            {
294                                    DEBUG(("selected %s\n", current_driver->name));
295                                    return True;
296                            }
297                            g_dsp_fd = 0;
298                            current_driver = current_driver->next;
299                  }                  }
                 g_dsp_fd = 0;  
                 current_driver = current_driver->next;  
         }  
300    
301          warning("no working audio-driver found\n");                  warning("no working audio-driver found\n");
302                    failed = True;
303                    current_driver = auto_driver;
304            }
305    
306          return False;          return False;
307  }  }
308    
309  void  inline void
310  rdpsnd_register_drivers(char *options)  rdpsnd_register_drivers(char *options)
311  {  {
312          struct audio_driver **reg;          struct audio_driver **reg;
# Line 338  rdpsnd_register_drivers(char *options) Line 337  rdpsnd_register_drivers(char *options)
337  }  }
338    
339  BOOL  BOOL
340  rdpsnd_select_driver(char *driver, char *options)  rdpsnd_init(char *optarg)
341  {  {
342          static struct audio_driver auto_driver;          static struct audio_driver auto_driver;
343          struct audio_driver *pos;          struct audio_driver *pos;
344            char *driver = NULL, *options = NULL;
345    
346          drivers = NULL;          drivers = NULL;
347    
348            rdpsnd_channel =
349                    channel_register("rdpsnd", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP,
350                                     rdpsnd_process);
351    
352            if (rdpsnd_channel == NULL)
353            {
354                    error("channel_register\n");
355                    return False;
356            }
357    
358            if (optarg != NULL && strlen(optarg) > 0)
359            {
360                    driver = options = optarg;
361    
362                    while (*options != '\0' && *options != ':')
363                            options++;
364    
365                    if (*options == ':')
366                    {
367                            *options = '\0';
368                            options++;
369                    }
370    
371                    if (*options == '\0')
372                            options = NULL;
373            }
374    
375          rdpsnd_register_drivers(options);          rdpsnd_register_drivers(options);
376    
377          if (!driver)          if (!driver)
# Line 382  rdpsnd_show_help(void) Line 410  rdpsnd_show_help(void)
410          }          }
411  }  }
412    
413  inline void  void
414  rdpsnd_play(void)  rdpsnd_play(void)
415  {  {
416          current_driver->wave_out_play();          current_driver->wave_out_play();
417  }  }
418    
419  void  inline void
420  rdpsnd_queue_write(STREAM s, uint16 tick, uint8 index)  rdpsnd_queue_write(STREAM s, uint16 tick, uint8 index)
421  {  {
422          struct audio_packet *packet = &packet_queue[queue_hi];          struct audio_packet *packet = &packet_queue[queue_hi];

Legend:
Removed from v.1265  
changed lines
  Added in v.1273

  ViewVC Help
Powered by ViewVC 1.1.26