[ekiga/gnome-2-26] Fixed the device detections in the gstreamer code : it could crash
- From: Eugen Dedu <ededu src gnome org>
- To: svn-commits-list gnome org
- Subject: [ekiga/gnome-2-26] Fixed the device detections in the gstreamer code : it could crash
- Date: Mon, 27 Apr 2009 11:57:49 -0400 (EDT)
commit a4874c2cfea51cfc48d3b4f95fe12257650b5a15
Author: Julien Puydt <jpuydt src gnome org>
Date: Tue Mar 17 20:31:21 2009 +0000
Fixed the device detections in the gstreamer code : it could crash
svn path=/trunk/; revision=7785
---
lib/engine/components/gstreamer/gst-audioinput.cpp | 14 ++++++++++----
.../components/gstreamer/gst-audiooutput.cpp | 15 +++++++++++----
lib/engine/components/gstreamer/gst-videoinput.cpp | 12 ++++++++++--
3 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/lib/engine/components/gstreamer/gst-audioinput.cpp b/lib/engine/components/gstreamer/gst-audioinput.cpp
index 57991c3..f154ba4 100644
--- a/lib/engine/components/gstreamer/gst-audioinput.cpp
+++ b/lib/engine/components/gstreamer/gst-audioinput.cpp
@@ -304,8 +304,11 @@ GST::AudioInputManager::detect_alsasrc_devices ()
descr = g_strdup_printf ("alsasrc device=%s ! volume name=ekiga_volume",
g_value_get_string (device));
- devices_by_name[std::pair<std::string,std::string>("ALSA", name)] = descr;
- g_free (name);
+ if (name != 0) {
+
+ devices_by_name[std::pair<std::string,std::string>("ALSA", name)] = descr;
+ g_free (name);
+ }
g_free (descr);
}
g_value_array_free (array);
@@ -350,8 +353,11 @@ GST::AudioInputManager::detect_pulsesrc_devices ()
descr = g_strdup_printf ("pulsesrc device=%s ! volume name=ekiga_volume",
g_value_get_string (device));
- devices_by_name[std::pair<std::string,std::string>("PULSEAUDIO", name)] = descr;
- g_free (name);
+ if (name != 0) {
+
+ devices_by_name[std::pair<std::string,std::string>("PULSEAUDIO", name)] = descr;
+ g_free (name);
+ }
g_free (descr);
}
g_value_array_free (array);
diff --git a/lib/engine/components/gstreamer/gst-audiooutput.cpp b/lib/engine/components/gstreamer/gst-audiooutput.cpp
index 5d796a9..5915030 100644
--- a/lib/engine/components/gstreamer/gst-audiooutput.cpp
+++ b/lib/engine/components/gstreamer/gst-audiooutput.cpp
@@ -354,8 +354,11 @@ GST::AudioOutputManager::detect_alsasink_devices ()
descr = g_strdup_printf ("volume name=ekiga_volume ! alsasink device=%s",
g_value_get_string (device));
- devices_by_name[std::pair<std::string,std::string>("ALSA", name)] = descr;
- g_free (name);
+ if (name != 0) {
+
+ devices_by_name[std::pair<std::string,std::string>("ALSA", name)] = descr;
+ g_free (name);
+ }
g_free (descr);
}
g_value_array_free (array);
@@ -400,8 +403,12 @@ GST::AudioOutputManager::detect_pulsesink_devices ()
descr = g_strdup_printf ("volume name=ekiga_volume ! pulsesink device=%s",
g_value_get_string (device));
- devices_by_name[std::pair<std::string,std::string>("PULSEAUDIO", name)] = descr;
- g_free (name);
+ if (name != 0) {
+
+ devices_by_name[std::pair<std::string,std::string>("PULSEAUDIO", name)] = descr;
+
+ g_free (name);
+ }
g_free (descr);
}
g_value_array_free (array);
diff --git a/lib/engine/components/gstreamer/gst-videoinput.cpp b/lib/engine/components/gstreamer/gst-videoinput.cpp
index d22347c..a5c9903 100644
--- a/lib/engine/components/gstreamer/gst-videoinput.cpp
+++ b/lib/engine/components/gstreamer/gst-videoinput.cpp
@@ -274,7 +274,11 @@ GST::VideoInputManager::detect_v4l2src_devices ()
descr = g_strdup_printf ("v4l2src device=%s"
" ! videoscale ! ffmpegcolorspace",
g_value_get_string (device));
- devices_by_name[std::pair<std::string,std::string>("V4L2",name)] = descr;
+ if (name != 0) {
+
+ devices_by_name[std::pair<std::string,std::string>("V4L2",name)] = descr;
+ g_free (name);
+ }
g_free (descr);
}
@@ -339,7 +343,11 @@ GST::VideoInputManager::detect_dv1394src_devices ()
" ! videoscale"
" ! ffmpegcolorspace",
g_value_get_uint64 (guid));
- devices_by_name[std::pair<std::string,std::string>("DV",name)] = descr;
+ if (name != 0) {
+
+ devices_by_name[std::pair<std::string,std::string>("DV",name)] = descr;
+ g_free (name);
+ }
g_free (descr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]