playsink: audio convert bin need not be unconditionally present

... so avoid NULL manipulation when setting up chain again
(e.g. after having partially gone down to READY in native audio flag
configuration).
This commit is contained in:
Mark Nauwelaerts 2012-03-08 17:55:37 +01:00
parent 5462536a36
commit b2a162ca77

View file

@ -2297,8 +2297,10 @@ setup_audio_chain (GstPlaySink * playsink, gboolean raw)
GstElement *elem; GstElement *elem;
GstPlayAudioChain *chain; GstPlayAudioChain *chain;
GstStateChangeReturn ret; GstStateChangeReturn ret;
GstPlaySinkAudioConvert *conv;
chain = playsink->audiochain; chain = playsink->audiochain;
conv = GST_PLAY_SINK_AUDIO_CONVERT_CAST (chain->conv);
chain->chain.raw = raw; chain->chain.raw = raw;
@ -2347,10 +2349,7 @@ setup_audio_chain (GstPlaySink * playsink, gboolean raw)
} }
g_object_set (chain->conv, "use-volume", FALSE, NULL); g_object_set (chain->conv, "use-volume", FALSE, NULL);
} else { } else if (conv) {
GstPlaySinkAudioConvert *conv =
GST_PLAY_SINK_AUDIO_CONVERT_CAST (chain->conv);
/* no volume, we need to add a volume element when we can */ /* no volume, we need to add a volume element when we can */
g_object_set (chain->conv, "use-volume", g_object_set (chain->conv, "use-volume",
! !(playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME), NULL); ! !(playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME), NULL);