/[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 1279 by stargo, Sun Oct 1 14:03:43 2006 UTC revision 1286 by stargo, Sun Oct 1 18:47:04 2006 UTC
# Line 116  oss_set_format(WAVEFORMATEX * pwfx) Line 116  oss_set_format(WAVEFORMATEX * pwfx)
116                  return False;                  return False;
117          }          }
118    
119            oss_driver.need_resampling = 0;
120          snd_rate = pwfx->nSamplesPerSec;          snd_rate = pwfx->nSamplesPerSec;
121          if (ioctl(g_dsp_fd, SNDCTL_DSP_SPEED, &snd_rate) == -1)          if (ioctl(g_dsp_fd, SNDCTL_DSP_SPEED, &snd_rate) == -1)
122          {          {
123                  perror("SNDCTL_DSP_SPEED");                  int rates[] = { 44100, 48000, 0 };
124                  close(g_dsp_fd);                  int *prates = rates;
125                  return False;  
126                    while (*prates != 0)
127                    {
128                            if ((pwfx->nSamplesPerSec != *prates)
129                                && (ioctl(g_dsp_fd, SNDCTL_DSP_SPEED, prates) != -1))
130                            {
131                                    oss_driver.need_resampling = 1;
132                                    snd_rate = *prates;
133                                    if (rdpsnd_dsp_resample_set
134                                        (snd_rate, pwfx->wBitsPerSample, pwfx->nChannels) == False)
135                                    {
136                                            error("rdpsnd_dsp_resample_set failed");
137                                            close(g_dsp_fd);
138                                            return False;
139                                    }
140    
141                                    break;
142                            }
143                            prates++;
144                    }
145    
146                    if (*prates == 0)
147                    {
148                            perror("SNDCTL_DSP_SPEED");
149                            close(g_dsp_fd);
150                            return False;
151                    }
152          }          }
153    
154          /* try to get 12 fragments of 2^12 bytes size */          /* try to get 12 fragments of 2^12 bytes size */

Legend:
Removed from v.1279  
changed lines
  Added in v.1286

  ViewVC Help
Powered by ViewVC 1.1.26