summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@collabora.com>2013-07-21 21:41:13 -0400
committerThibault Saunier <thibault.saunier@collabora.com>2013-07-21 21:42:42 -0400
commit3e88edfebcc2cd7ab92a9a26494fd272f63fda40 (patch)
tree359eb408b1cd6761a82d27977f1f19a8311ec3f5
parent9f0b0c26e313bc3d5e6305554309e04184224ff6 (diff)
pipeline: Check that the profile could actually be set on the encodebin
Setting the profile on an encodebin can fail, and if that happens, there will be no profile set at all, we should return FALSE in GESPipeline when that happens
-rw-r--r--ges/ges-pipeline.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ges/ges-pipeline.c b/ges/ges-pipeline.c
index db67f31..08aa752 100644
--- a/ges/ges-pipeline.c
+++ b/ges/ges-pipeline.c
@@ -879,6 +879,7 @@ ges_pipeline_set_render_settings (GESPipeline * pipeline,
const gchar * output_uri, GstEncodingProfile * profile)
{
GError *err = NULL;
+ GstEncodingProfile *set_profile;
g_return_val_if_fail (GES_IS_TIMELINE_PIPELINE (pipeline), FALSE);
@@ -905,8 +906,17 @@ ges_pipeline_set_render_settings (GESPipeline * pipeline,
g_object_set (pipeline->priv->encodebin, "avoid-reencoding",
!(!(pipeline->priv->mode & TIMELINE_MODE_SMART_RENDER)), NULL);
g_object_set (pipeline->priv->encodebin, "profile", profile, NULL);
- pipeline->priv->profile =
- (GstEncodingProfile *) gst_encoding_profile_ref (profile);
+ g_object_get (pipeline->priv->encodebin, "profile", &set_profile, NULL);
+
+ if (set_profile == NULL) {
+ GST_ERROR_OBJECT (pipeline, "Profile %" GST_PTR_FORMAT " could no be set",
+ profile);
+
+ return FALSE;
+ }
+
+ /* We got a referencer when getting back the profile */
+ pipeline->priv->profile = profile;
return TRUE;
}