playsink: If we switch sinks, make sure that the old sink is set to NULL

This commit is contained in:
Sebastian Dröge 2013-07-02 14:18:20 +02:00
parent 841d738f7c
commit b3a15872b7

View file

@ -3068,9 +3068,12 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
/* Remove the sink from the bin to keep its state /* Remove the sink from the bin to keep its state
* and unparent it to allow reuse */ * and unparent it to allow reuse */
if (playsink->videochain->sink) if (playsink->videochain->sink) {
if (playsink->videochain->sink != playsink->video_sink)
gst_element_set_state (playsink->videochain->sink, GST_STATE_NULL);
gst_bin_remove (GST_BIN_CAST (playsink->videochain->chain.bin), gst_bin_remove (GST_BIN_CAST (playsink->videochain->chain.bin),
playsink->videochain->sink); playsink->videochain->sink);
}
activate_chain (GST_PLAY_CHAIN (playsink->videochain), FALSE); activate_chain (GST_PLAY_CHAIN (playsink->videochain), FALSE);
free_chain ((GstPlayChain *) playsink->videochain); free_chain ((GstPlayChain *) playsink->videochain);
@ -3260,9 +3263,12 @@ gst_play_sink_do_reconfigure (GstPlaySink * playsink)
/* Remove the sink from the bin to keep its state /* Remove the sink from the bin to keep its state
* and unparent it to allow reuse */ * and unparent it to allow reuse */
if (playsink->audiochain->sink) if (playsink->audiochain->sink) {
if (playsink->audiochain->sink != playsink->audio_sink)
gst_element_set_state (playsink->audiochain->sink, GST_STATE_NULL);
gst_bin_remove (GST_BIN_CAST (playsink->audiochain->chain.bin), gst_bin_remove (GST_BIN_CAST (playsink->audiochain->chain.bin),
playsink->audiochain->sink); playsink->audiochain->sink);
}
activate_chain (GST_PLAY_CHAIN (playsink->audiochain), FALSE); activate_chain (GST_PLAY_CHAIN (playsink->audiochain), FALSE);
disconnect_audio_chain (playsink->audiochain, playsink); disconnect_audio_chain (playsink->audiochain, playsink);