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
This commit is contained in:
Thibault Saunier 2014-03-21 10:22:52 +01:00
parent 1108a2c6ac
commit 0e9c74bcb1

View file

@ -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 */