diff options
author | Bastien Nocera <hadess@hadess.net> | 2006-12-05 16:50:37 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2006-12-05 16:50:37 +0000 |
commit | 9fc6b4a0ec0291777196914c7d9c77ef01725853 (patch) | |
tree | 509a2fceddbb61072e3e9ba760ac5c7da21a50cc | |
parent | 56c12b2c72f41b76b233bce8058a8d6d1586b4fe (diff) | |
download | totem-9fc6b4a0ec0291777196914c7d9c77ef01725853.tar.gz |
Have _can_set_volume behave properly, don't fail creating the video widget
2006-12-05 Bastien Nocera <hadess@hadess.net>
* src/backend/bacon-video-widget-gst-0.10.c:
(bacon_video_widget_can_set_volume), (bacon_video_widget_new):
Have _can_set_volume behave properly, don't fail creating the
video widget if we can't create an audio sink and we're not in audio
mode (Closes: #170719)
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/backend/bacon-video-widget-gst-0.10.c | 34 |
2 files changed, 31 insertions, 11 deletions
@@ -1,3 +1,11 @@ +2006-12-05 Bastien Nocera <hadess@hadess.net> + + * src/backend/bacon-video-widget-gst-0.10.c: + (bacon_video_widget_can_set_volume), (bacon_video_widget_new): + Have _can_set_volume behave properly, don't fail creating the + video widget if we can't create an audio sink and we're not in audio + mode (Closes: #170719) + ============ Version 2.16.4 2006-11-28 Bastien Nocera <hadess@hadess.net> diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c index d49f54a18..b5ad5dfff 100644 --- a/src/backend/bacon-video-widget-gst-0.10.c +++ b/src/backend/bacon-video-widget-gst-0.10.c @@ -145,6 +145,7 @@ struct BaconVideoWidgetPrivate gboolean cursor_shown; gboolean fullscreen_mode; gboolean auto_resize; + gboolean uses_fakesink; gint video_width; /* Movie width */ gint video_height; /* Movie height */ @@ -2756,8 +2757,10 @@ bacon_video_widget_can_set_volume (BaconVideoWidget * bvw) g_return_val_if_fail (bvw != NULL, FALSE); g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), FALSE); g_return_val_if_fail (GST_IS_ELEMENT (bvw->priv->play), FALSE); - - return TRUE; + + if (bvw->priv->speakersetup == BVW_AUDIO_SOUND_AC3PASSTHRU) + return FALSE; + return !bvw->priv->uses_fakesink; } void @@ -4378,16 +4381,25 @@ bacon_video_widget_new (int width, int height, gst_element_set_state (audio_sink, GST_STATE_READY); success = poll_for_state_change (bvw, audio_sink, GST_STATE_READY, err); if (!success) { - if (err && !*err) { - g_warning ("Should have gotten an error message, please file a bug."); - g_set_error (err, BVW_ERROR, BVW_ERROR_VIDEO_PLUGIN, - _("Failed to open audio output. You may not have " - "permission to open the sound device, or the sound " - "server may not be running. " - "Please select another audio output in the Multimedia " - "Systems Selector.")); + /* Hopefully, fakesink should always work */ + gst_element_set_state (audio_sink, GST_STATE_NULL); + gst_object_unref (audio_sink); + audio_sink = NULL; + if (type != BVW_USE_TYPE_AUDIO) + audio_sink = gst_element_factory_make ("fakesink", "audio-sink"); + if (audio_sink == NULL) { + if (err && !*err) { + g_warning ("Should have gotten an error message, please file a bug."); + g_set_error (err, BVW_ERROR, BVW_ERROR_VIDEO_PLUGIN, + _("Failed to open audio output. You may not have " + "permission to open the sound device, or the sound " + "server may not be running. " + "Please select another audio output in the Multimedia " + "Systems Selector.")); + } + goto sink_error; } - goto sink_error; + bvw->priv->uses_fakesink = TRUE; } } else { g_set_error (err, BVW_ERROR, BVW_ERROR_VIDEO_PLUGIN, |