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

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

revision 476 by matthewc, Sat Oct 4 00:03:24 2003 UTC revision 491 by stargo, Mon Oct 13 16:09:45 2003 UTC
# Line 43  wave_out_open(void) Line 43  wave_out_open(void)
43  {  {
44          char *dsp_dev = "/dev/dsp";          char *dsp_dev = "/dev/dsp";
45    
46          if ((g_dsp_fd = open(dsp_dev, O_WRONLY)) == -1)          if ((g_dsp_fd = open(dsp_dev, O_WRONLY|O_NONBLOCK)) == -1)
47          {          {
48                  perror(dsp_dev);                  perror(dsp_dev);
49                  return False;                  return False;
# Line 113  wave_out_set_format(WAVEFORMATEX *pwfx) Line 113  wave_out_set_format(WAVEFORMATEX *pwfx)
113  }  }
114    
115  void  void
116    wave_out_volume(uint16 left, uint16 right)
117    {
118            uint32 volume;
119    
120            volume = left/(65536/100);
121            volume |= right/(65536/100) << 8;
122            if (ioctl(g_dsp_fd, MIXER_WRITE(SOUND_MIXER_PCM), &volume) == -1)
123            {
124                    perror("MIXER_WRITE(SOUND_MIXER_PCM)");
125                    return;
126            }
127    }
128    
129    void
130  wave_out_write(STREAM s, uint16 tick, uint8 index)  wave_out_write(STREAM s, uint16 tick, uint8 index)
131  {  {
132          struct audio_packet *packet = &packet_queue[queue_hi];          struct audio_packet *packet = &packet_queue[queue_hi];
# Line 129  wave_out_write(STREAM s, uint16 tick, ui Line 143  wave_out_write(STREAM s, uint16 tick, ui
143          packet->s = *s;          packet->s = *s;
144          packet->tick = tick;          packet->tick = tick;
145          packet->index = index;          packet->index = index;
146            packet->s.p += 4;
147    
148          /* we steal the data buffer from s, give it a new one */          /* we steal the data buffer from s, give it a new one */
149          s->data = malloc(s->size);          s->data = malloc(s->size);

Legend:
Removed from v.476  
changed lines
  Added in v.491

  ViewVC Help
Powered by ViewVC 1.1.26