diff -r d25772351a75 -r 3c2d389fcad1 pidgin/gtkprefs.c --- a/pidgin/gtkprefs.c Fri Aug 15 04:07:00 2008 +0000 +++ b/pidgin/gtkprefs.c Sat Aug 16 20:22:41 2008 +0000 @@ -2112,10 +2112,14 @@ const char *plugin = value; const char *device = purple_prefs_get_string("/purple/media/video/device"); GstElement *video = purple_media_get_element(plugin); - GList *video_devices = purple_media_get_devices(video); - GList *video_items = get_device_items(video, video_devices); + GList *video_items = NULL; GList *list; - g_list_free(video_devices); + + if (video != NULL) { + GList *video_devices = purple_media_get_devices(video); + video_items = get_device_items(video, video_devices); + g_list_free(video_devices); + } if (video_items == NULL) { video_items = g_list_prepend(video_items, g_strdup("")); @@ -2165,14 +2169,20 @@ GstElement *video = purple_media_get_element(plugin); GstElement *audio = purple_media_get_element("alsasrc"); - GList *video_devices = purple_media_get_devices(video); - GList *audio_devices = purple_media_get_devices(audio); - - GList *video_items = get_device_items(video, video_devices); - GList *audio_items = get_device_items(audio, audio_devices); - - g_list_free(video_devices); - g_list_free(audio_devices); + GList *video_items = NULL; + GList *audio_items = NULL; + + if (video != NULL) { + GList *video_devices = purple_media_get_devices(video); + video_items = get_device_items(video, video_devices); + g_list_free(video_devices); + } + + if (audio != NULL) { + GList *audio_devices = purple_media_get_devices(audio); + audio_items = get_device_items(audio, audio_devices); + g_list_free(audio_devices); + } if (video_items == NULL) { video_items = g_list_prepend(video_items, "");