encodebin: Tear down old profiles when setting new ones

In NULL/READY, we should be able to switch profiles on encodebin,
this patch makes it tear down old profiles when new ones are set
if in NULL/READY states

https://bugzilla.gnome.org/show_bug.cgi?id=644416
This commit is contained in:
Thiago Santos 2011-03-10 14:38:47 -03:00
parent 8c13488022
commit 4ee738be59

View file

@ -1698,9 +1698,9 @@ gst_encode_bin_set_profile (GstEncodeBin * ebin, GstEncodingProfile * profile)
}
/* If we're not active, we can deactivate the previous profile */
if (ebin->profile)
gst_encoding_profile_unref (ebin->profile);
ebin->profile = NULL;
if (ebin->profile) {
gst_encode_bin_tear_down_profile (ebin);
}
return gst_encode_bin_setup_profile (ebin, profile);
}