~ubuntu-branches/ubuntu/wily/basilisk2/wily-proposed

« back to all changes in this revision

Viewing changes to src/Unix/audio_oss_esd.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-03-06 19:33:01 UTC
  • mfrom: (2.1.4 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080306193301-cc2ofn705nfsq3y0
Tags: 0.9.20070407-4
* Update copyright-check cdbs snippet to parse licensecheck using perl:
  + No longer randomly drops newlines
  + More compact hint file (and ordered more like wiki-proposed new copyright
    syntax).
  + No longer ignore files without copyright.
* Update copyright_hints.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  audio_oss_esd.cpp - Audio support, implementation for OSS and ESD (Linux and FreeBSD)
3
3
 *
4
 
 *  Basilisk II (C) 1997-2002 Christian Bauer
 
4
 *  Basilisk II (C) 1997-2005 Christian Bauer
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
31
31
#endif
32
32
 
33
33
#ifdef __FreeBSD__
34
 
#include <machine/soundcard.h>
 
34
#include <sys/soundcard.h>
35
35
#endif
36
36
 
37
37
#include "cpu_emulation.h"
55
55
static int audio_channel_count_index = 0;
56
56
 
57
57
// Global variables
 
58
static bool is_dsp_audio = false;                                       // Flag: is DSP audio
58
59
static int audio_fd = -1;                                                       // fd of dsp or ESD
59
60
static int mixer_fd = -1;                                                       // fd of mixer
60
61
static sem_t audio_irq_done_sem;                                        // Signal from interrupt to streaming thread: data block read
95
96
        }
96
97
 
97
98
        printf("Using %s audio output\n", dsp);
 
99
        is_dsp_audio = true;
98
100
 
99
101
        // Get supported sample formats
100
102
        if (audio_sample_sizes.empty()) {
330
332
 
331
333
void AudioExit(void)
332
334
{
 
335
        // Stop the device immediately. Otherwise, close() sends
 
336
        // SNDCTL_DSP_SYNC, which may hang
 
337
        if (is_dsp_audio)
 
338
                ioctl(audio_fd, SNDCTL_DSP_RESET, 0);
 
339
 
333
340
        // Close audio device
334
341
        close_audio();
335
342