summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-04-28 11:18:23 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-05-04 10:21:25 +0300
commitbfe460574efad6056f40b1ffd395c054e4852e89 (patch)
tree9ea686398d2510ea8e13a7cea6f32d70acc9e033
parent724238afd9c6ad381760da486548a7591112f8b2 (diff)
downloadgstreamer-plugins-base-bfe460574efad6056f40b1ffd395c054e4852e89.tar.gz
encoding-profile: Fail to create encoding profile from discoverer info if no streams could be added
https://bugzilla.gnome.org/show_bug.cgi?id=765708
-rw-r--r--gst-libs/gst/pbutils/encoding-profile.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gst-libs/gst/pbutils/encoding-profile.c b/gst-libs/gst/pbutils/encoding-profile.c
index b149458de..54439961d 100644
--- a/gst-libs/gst/pbutils/encoding-profile.c
+++ b/gst-libs/gst/pbutils/encoding-profile.c
@@ -1533,6 +1533,8 @@ add_stream_to_profile (GstEncodingContainerProfile * profile,
return n_streams != 0;
} else {
+ GST_WARNING ("Ignoring stream of type '%s'",
+ g_type_name (G_OBJECT_TYPE (sinfo)));
/* subtitles or other ? ignore for now */
}
if (sprofile)
@@ -1562,6 +1564,7 @@ gst_encoding_profile_from_discoverer (GstDiscovererInfo * info)
GstDiscovererStreamInfo *sinfo;
GList *streams, *stream;
GstCaps *caps = NULL;
+ guint n_streams = 0;
if (!info || gst_discoverer_info_get_result (info) != GST_DISCOVERER_OK)
return NULL;
@@ -1586,9 +1589,17 @@ gst_encoding_profile_from_discoverer (GstDiscovererInfo * info)
gst_discoverer_container_info_get_streams (GST_DISCOVERER_CONTAINER_INFO
(sinfo));
for (stream = streams; stream; stream = stream->next) {
- add_stream_to_profile (profile, (GstDiscovererStreamInfo *) stream->data);
+ if (add_stream_to_profile (profile,
+ (GstDiscovererStreamInfo *) stream->data))
+ n_streams++;
}
gst_discoverer_stream_info_list_free (streams);
+ if (n_streams == 0) {
+ GST_ERROR ("Failed to add any streams");
+ g_object_unref (profile);
+ return NULL;
+ }
+
return (GstEncodingProfile *) profile;
}