From 0e9c74bcb19da2f0dd0bca0c51bdfee2a1080b52 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 21 Mar 2014 10:22:52 +0100 Subject: [PATCH] pipeline: Do not set EncodingProfile.presence when we have no track for the type That leads to freeze as encodebin will be waiting for a pad and EOS forever --- ges/ges-pipeline.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ges/ges-pipeline.c b/ges/ges-pipeline.c index ae65a8449c..92dbafafbc 100644 --- a/ges/ges-pipeline.c +++ b/ges/ges-pipeline.c @@ -34,6 +34,8 @@ #include "ges-internal.h" #include "ges-pipeline.h" #include "ges-screenshot.h" +#include "ges-audio-track.h" +#include "ges-video-track.h" #define DEFAULT_TIMELINE_MODE GES_PIPELINE_MODE_PREVIEW @@ -860,11 +862,22 @@ ges_pipeline_set_render_settings (GESPipeline * pipeline, const GList *tmpprofiles = gst_encoding_container_profile_get_profiles (GST_ENCODING_CONTAINER_PROFILE (profile)); + GList *tmptrack, *tracks = + ges_timeline_get_tracks (pipeline->priv->timeline); for (; tmpprofiles; tmpprofiles = tmpprofiles->next) { - GST_DEBUG_OBJECT (pipeline, "Setting presence to 1!"); - gst_encoding_profile_set_presence (tmpprofiles->data, 1); + for (tmptrack = tracks; tmptrack; tmptrack = tmptrack->next) { + if ((GST_IS_ENCODING_AUDIO_PROFILE (tmpprofiles->data) && + GES_IS_AUDIO_TRACK (tmptrack->data)) || + (GST_IS_ENCODING_VIDEO_PROFILE (tmpprofiles->data) && + GES_IS_VIDEO_TRACK (tmptrack->data))) { + GST_DEBUG_OBJECT (pipeline, "Setting presence to 1!"); + gst_encoding_profile_set_presence (tmpprofiles->data, 1); + } + } } + + g_list_free_full (tracks, gst_object_unref); } /* Clear previous URI sink if it existed */