summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/audiodevice.cpp
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/audiodevice.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiodevice.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp
index 5fef792..2087c7f 100644
--- a/core/multimedia/opieplayer/audiodevice.cpp
+++ b/core/multimedia/opieplayer/audiodevice.cpp
@@ -188,29 +188,27 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume,
188 188
189AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { 189AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
190 qDebug("creating new audio device"); 190 qDebug("creating new audio device");
191 d = new AudioDevicePrivate; 191 d = new AudioDevicePrivate;
192 d->frequency = f; 192 d->frequency = f;
193 d->channels = chs; 193 d->channels = chs;
194 d->bytesPerSample = bps; 194 d->bytesPerSample = bps;
195 qDebug("%d",bps); 195 qDebug("%d",bps);
196 int format=0; 196 int format=0;
197 if( bps == 8) format = AFMT_U8; 197 if( bps == 8) format = AFMT_U8;
198 else if( bps <= 0) format = AFMT_S16_LE; 198 else if( bps <= 0) format = AFMT_S16_LE;
199 else format = AFMT_S16_LE; 199 else format = AFMT_S16_LE;
200
201 qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); 200 qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format);
202 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); 201 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) );
203 202
204
205 int fragments = 0x10000 * 8 + sound_fragment_shift; 203 int fragments = 0x10000 * 8 + sound_fragment_shift;
206 int capabilities = 0; 204 int capabilities = 0;
207 205
208#ifdef KEEP_DEVICE_OPEN 206#ifdef KEEP_DEVICE_OPEN
209 if ( AudioDevicePrivate::dspFd == 0 ) { 207 if ( AudioDevicePrivate::dspFd == 0 ) {
210#endif 208#endif
211 if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { 209 if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) {
212 perror("open(\"/dev/dsp\") sending to /dev/null instead"); 210 perror("open(\"/dev/dsp\") sending to /dev/null instead");
213 d->handle = ::open( "/dev/null", O_WRONLY ); 211 d->handle = ::open( "/dev/null", O_WRONLY );
214 } 212 }
215#ifdef KEEP_DEVICE_OPEN 213#ifdef KEEP_DEVICE_OPEN
216 AudioDevicePrivate::dspFd = d->handle; 214 AudioDevicePrivate::dspFd = d->handle;