/[qemu]/qemu/audio/ossaudio.c
ViewVC logotype

Diff of /qemu/audio/ossaudio.c

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

revision 1.3 by bellard, Thu Nov 11 16:55:09 2004 UTC revision 1.4 by bellard, Sun Nov 14 16:02:51 2004 UTC
# Line 370  static int oss_hw_init (HWVoice *hw, int Line 370  static int oss_hw_init (HWVoice *hw, int
370          if (oss->pcm_buf == MAP_FAILED) {          if (oss->pcm_buf == MAP_FAILED) {
371              dolog ("Failed to mmap OSS device\nReason: %s\n",              dolog ("Failed to mmap OSS device\nReason: %s\n",
372                     errstr ());                     errstr ());
373          } else for (;;) {          } else {
374              int err;              int err;
375              int trig = 0;              int trig = 0;
376              if (ioctl (oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) {              if (ioctl (oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) {
377                  dolog ("SNDCTL_DSP_SETTRIGGER 0 failed\nReason: %s\n",                  dolog ("SNDCTL_DSP_SETTRIGGER 0 failed\nReason: %s\n",
378                         errstr ());                         errstr ());
                 goto fail;  
379              }              }
380                else {
381              trig = PCM_ENABLE_OUTPUT;                  trig = PCM_ENABLE_OUTPUT;
382              if (ioctl (oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) {                  if (ioctl (oss->fd, SNDCTL_DSP_SETTRIGGER, &trig) < 0) {
383                  dolog ("SNDCTL_DSP_SETTRIGGER PCM_ENABLE_OUTPUT failed\n"                      dolog ("SNDCTL_DSP_SETTRIGGER PCM_ENABLE_OUTPUT failed\n"
384                         "Reason: %s\n", errstr ());                             "Reason: %s\n", errstr ());
385                  goto fail;                  }
386                    else {
387                        oss->mmapped = 1;
388                    }
389              }              }
             oss->mmapped = 1;  
             break;  
390    
391          fail:              if (!oss->mmapped) {
392              err = munmap (oss->pcm_buf, hw->bufsize);                  err = munmap (oss->pcm_buf, hw->bufsize);
393              if (err) {                  if (err) {
394                  dolog ("Failed to unmap OSS device\nReason: %s\n",                      dolog ("Failed to unmap OSS device\nReason: %s\n",
395                         errstr ());                             errstr ());
396                    }
397              }              }
398          }          }
399      }      }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26