/[rdesktop]/sourceforge.net/trunk/rdesktop/rdpsnd_sun.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 /sourceforge.net/trunk/rdesktop/rdpsnd_sun.c

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

revision 538 by stargo, Fri Oct 31 09:38:25 2003 UTC revision 772 by stargo, Sat Sep 11 19:17:48 2004 UTC
# Line 26  Line 26 
26  #include <errno.h>  #include <errno.h>
27  #include <sys/ioctl.h>  #include <sys/ioctl.h>
28  #include <sys/audioio.h>  #include <sys/audioio.h>
29    
30    #if (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
31  #include <stropts.h>  #include <stropts.h>
32    #endif
33    
34  #define MAX_QUEUE       10  #define MAX_QUEUE       10
35    
# Line 84  wave_out_close(void) Line 87  wave_out_close(void)
87          /* Flush the audiobuffer */          /* Flush the audiobuffer */
88          ioctl(g_dsp_fd, I_FLUSH, FLUSHW);          ioctl(g_dsp_fd, I_FLUSH, FLUSHW);
89  #endif  #endif
90    #if defined AUDIO_FLUSH
91            ioctl(g_dsp_fd, AUDIO_FLUSH, NULL);
92    #endif
93          close(g_dsp_fd);          close(g_dsp_fd);
94  }  }
95    
# Line 104  BOOL Line 110  BOOL
110  wave_out_set_format(WAVEFORMATEX * pwfx)  wave_out_set_format(WAVEFORMATEX * pwfx)
111  {  {
112          audio_info_t info;          audio_info_t info;
         int test = 1;  
113    
114          ioctl(g_dsp_fd, AUDIO_DRAIN, 0);          ioctl(g_dsp_fd, AUDIO_DRAIN, 0);
115          g_swapaudio = False;          g_swapaudio = False;
# Line 119  wave_out_set_format(WAVEFORMATEX * pwfx) Line 124  wave_out_set_format(WAVEFORMATEX * pwfx)
124          {          {
125                  info.play.encoding = AUDIO_ENCODING_LINEAR;                  info.play.encoding = AUDIO_ENCODING_LINEAR;
126                  /* Do we need to swap the 16bit values? (Are we BigEndian) */                  /* Do we need to swap the 16bit values? (Are we BigEndian) */
127                  g_swapaudio = !(*(uint8 *) (&test));  #ifdef B_ENDIAN
128                    g_swapaudio = 1;
129    #else
130                    g_swapaudio = 0;
131    #endif
132          }          }
133    
134          g_samplewidth = pwfx->wBitsPerSample / 8;          g_samplewidth = pwfx->wBitsPerSample / 8;
# Line 158  wave_out_volume(uint16 left, uint16 righ Line 167  wave_out_volume(uint16 left, uint16 righ
167          uint balance;          uint balance;
168          uint volume;          uint volume;
169    
170          if (ioctl(g_dsp_fd, AUDIO_GETINFO, &info) == -1)          AUDIO_INITINFO(&info);
         {  
                 perror("AUDIO_GETINFO");  
                 return;  
         }  
171    
172          volume = (left > right) ? left : right;          volume = (left > right) ? left : right;
173    

Legend:
Removed from v.538  
changed lines
  Added in v.772

  ViewVC Help
Powered by ViewVC 1.1.26