ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/audio_oss_esd.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/audio_oss_esd.cpp (file contents):
Revision 1.15 by cebix, 2002-10-15T16:25:04Z vs.
Revision 1.16 by gbeauche, 2004-01-04T05:47:08Z

# Line 55 | Line 55 | static int audio_sample_size_index = 0;
55   static int audio_channel_count_index = 0;
56  
57   // Global variables
58 + static bool is_dsp_audio = false;                                       // Flag: is DSP audio
59   static int audio_fd = -1;                                                       // fd of dsp or ESD
60   static int mixer_fd = -1;                                                       // fd of mixer
61   static sem_t audio_irq_done_sem;                                        // Signal from interrupt to streaming thread: data block read
# Line 95 | Line 96 | static bool open_dsp(void)
96          }
97  
98          printf("Using %s audio output\n", dsp);
99 +        is_dsp_audio = true;
100  
101          // Get supported sample formats
102          if (audio_sample_sizes.empty()) {
# Line 321 | Line 323 | static void close_audio(void)
323  
324          // Close dsp or ESD socket
325          if (audio_fd >= 0) {
326 +                if (is_dsp_audio) {
327 +                        // Stop the device immediately. Otherwise, close() sends
328 +                        // SNDCTL_DSP_SYNC, which may hang
329 +                        ioctl(audio_fd, SNDCTL_DSP_RESET, 0);
330 +                }
331                  close(audio_fd);
332                  audio_fd = -1;
333          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines