[ekiga] Fix crash when no audio device exists
- From: Eugen Dedu <ededu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Fix crash when no audio device exists
- Date: Fri, 4 Mar 2011 16:47:58 +0000 (UTC)
commit 76cbf1685e05db6092f6abfd33dc30c33eb614be
Author: Eugen Dedu <Eugen Dedu pu-pm univ-fcomte fr>
Date: Fri Mar 4 17:47:22 2011 +0100
Fix crash when no audio device exists
The crash appears in AudioOutputCoreConfBridge::on_property_changed
method. It was introduced by commit 5e1efe8.
Fixes bug #640982.
.../audiooutput/audiooutput-gmconf-bridge.cpp | 35 ++++++++++++--------
1 files changed, 21 insertions(+), 14 deletions(-)
---
diff --git a/lib/engine/audiooutput/audiooutput-gmconf-bridge.cpp b/lib/engine/audiooutput/audiooutput-gmconf-bridge.cpp
index 4f1fca1..104fab0 100644
--- a/lib/engine/audiooutput/audiooutput-gmconf-bridge.cpp
+++ b/lib/engine/audiooutput/audiooutput-gmconf-bridge.cpp
@@ -51,18 +51,18 @@ AudioOutputCoreConfBridge::AudioOutputCoreConfBridge (Ekiga::Service & _service)
Ekiga::ConfKeys keys;
property_changed.connect (boost::bind (&AudioOutputCoreConfBridge::on_property_changed, this, _1, _2));
- keys.push_back (AUDIO_DEVICES_KEY "output_device");
- keys.push_back (SOUND_EVENTS_KEY "output_device");
- keys.push_back (SOUND_EVENTS_KEY "busy_tone_sound");
- keys.push_back (SOUND_EVENTS_KEY "incoming_call_sound");
- keys.push_back (SOUND_EVENTS_KEY "new_message_sound");
- keys.push_back (SOUND_EVENTS_KEY "new_voicemail_sound");
- keys.push_back (SOUND_EVENTS_KEY "ring_tone_sound");
- keys.push_back (SOUND_EVENTS_KEY "enable_busy_tone_sound");
- keys.push_back (SOUND_EVENTS_KEY "enable_incoming_call_sound");
- keys.push_back (SOUND_EVENTS_KEY "enable_new_message_sound");
- keys.push_back (SOUND_EVENTS_KEY "enable_new_voicemail_sound");
- keys.push_back (SOUND_EVENTS_KEY "enable_ring_tone_sound");
+ keys.push_back (AUDIO_DEVICES_KEY "output_device");
+ keys.push_back (SOUND_EVENTS_KEY "output_device");
+ keys.push_back (SOUND_EVENTS_KEY "busy_tone_sound");
+ keys.push_back (SOUND_EVENTS_KEY "incoming_call_sound");
+ keys.push_back (SOUND_EVENTS_KEY "new_message_sound");
+ keys.push_back (SOUND_EVENTS_KEY "new_voicemail_sound");
+ keys.push_back (SOUND_EVENTS_KEY "ring_tone_sound");
+ keys.push_back (SOUND_EVENTS_KEY "enable_busy_tone_sound");
+ keys.push_back (SOUND_EVENTS_KEY "enable_incoming_call_sound");
+ keys.push_back (SOUND_EVENTS_KEY "enable_new_message_sound");
+ keys.push_back (SOUND_EVENTS_KEY "enable_new_voicemail_sound");
+ keys.push_back (SOUND_EVENTS_KEY "enable_ring_tone_sound");
load (keys);
}
@@ -93,8 +93,15 @@ void AudioOutputCoreConfBridge::on_property_changed (std::string key, GmConfEntr
AudioOutputDevice device;
if (found)
device.SetFromString (value);
- else
- device.SetFromString (devices.begin ()->GetString ());
+ else {
+ if (!devices.empty())
+ device.SetFromString (devices.begin ()->GetString ());
+ else {
+ // if there is no audio device / ptlib plugin, use fallback device below
+ g_warning ("Error: no audio device found!");
+ device.type == "";
+ }
+ }
g_free (value);
if ( (device.type == "" ) ||
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]