From 9adc4e5ab0a07eda196fffc8921da2d2d4f273e7 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Sat, 22 Jun 2002 01:38:20 +0000 Subject: new action if /dev/dsp can't open, instead of sending to bytes to /dev/null.. lets immediately exit --- (limited to 'core/multimedia/opieplayer/audiodevice.cpp') diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index faadd72..8f04d0d 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp @@ -24,8 +24,13 @@ #include #include #include +#include + #include "audiodevice.h" + +#include + #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) #include "qpe/qcopenvelope_qws.h" #endif @@ -209,8 +214,14 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { if ( AudioDevicePrivate::dspFd == 0 ) { #endif if ( ( d->handle = ::open( "/dev/dsp", O_WRONLY ) ) < 0 ) { - perror("open(\"/dev/dsp\") sending to /dev/null instead"); - d->handle = ::open( "/dev/null", O_WRONLY ); + +// perror("open(\"/dev/dsp\") sending to /dev/null instead"); + perror("open(\"/dev/dsp\")"); + QString errorMsg=tr("Somethin's wrong with\nyour sound device.\nopen(\"/dev/dsp\")\n")+(QString)strerror(errno)+tr("\n\nClosing player now."); + QMessageBox::critical(0, "Vmemo", errorMsg, tr("Abort")); + exit(-1); //harsh? +// d->handle = ::open( "/dev/null", O_WRONLY ); + // WTF?!?! } #ifdef KEEP_DEVICE_OPEN AudioDevicePrivate::dspFd = d->handle; -- cgit v0.9.0.2