validate:media-descriptor-writer: Handle medias with 1 single stream

This commit is contained in:
Thibault Saunier 2014-07-15 11:59:23 +02:00
parent fa35a10779
commit f8a37a1c80

View file

@ -464,8 +464,8 @@ _run_frame_analisis (GstMediaDescriptorWriter * writer,
writer->priv->pipeline = gst_pipeline_new ("frame-analisis"); writer->priv->pipeline = gst_pipeline_new ("frame-analisis");
monitor = monitor =
gst_validate_monitor_factory_create (GST_OBJECT_CAST (writer-> gst_validate_monitor_factory_create (GST_OBJECT_CAST (writer->priv->
priv->pipeline), runner, NULL); pipeline), runner, NULL);
gst_validate_reporter_set_handle_g_logs (GST_VALIDATE_REPORTER (monitor)); gst_validate_reporter_set_handle_g_logs (GST_VALIDATE_REPORTER (monitor));
g_object_set (uridecodebin, "uri", uri, "caps", writer->priv->raw_caps, NULL); g_object_set (uridecodebin, "uri", uri, "caps", writer->priv->raw_caps, NULL);
@ -501,7 +501,7 @@ GstMediaDescriptorWriter *
gst_media_descriptor_writer_new_discover (GstValidateRunner * runner, gst_media_descriptor_writer_new_discover (GstValidateRunner * runner,
const gchar * uri, gboolean full, GError ** err) const gchar * uri, gboolean full, GError ** err)
{ {
GList *tmp, *streams; GList *tmp, *streams = NULL;
GstDiscovererInfo *info; GstDiscovererInfo *info;
GstDiscoverer *discoverer; GstDiscoverer *discoverer;
GstDiscovererStreamInfo *streaminfo; GstDiscovererStreamInfo *streaminfo;
@ -535,13 +535,18 @@ gst_media_descriptor_writer_new_discover (GstValidateRunner * runner,
gst_discoverer_info_get_tags (info)); gst_discoverer_info_get_tags (info));
streaminfo = gst_discoverer_info_get_stream_info (info); streaminfo = gst_discoverer_info_get_stream_info (info);
((GstMediaDescriptor *) writer)->filenode->caps =
gst_discoverer_stream_info_get_caps (GST_DISCOVERER_STREAM_INFO
(streaminfo));
streams = gst_discoverer_info_get_stream_list (info); if (GST_IS_DISCOVERER_CONTAINER_INFO (streaminfo)) {
for (tmp = streams; tmp; tmp = tmp->next) { ((GstMediaDescriptor *) writer)->filenode->caps =
gst_media_descriptor_writer_add_stream (writer, tmp->data); gst_discoverer_stream_info_get_caps (GST_DISCOVERER_STREAM_INFO
(streaminfo));
streams = gst_discoverer_info_get_stream_list (info);
for (tmp = streams; tmp; tmp = tmp->next) {
gst_media_descriptor_writer_add_stream (writer, tmp->data);
}
} else {
gst_media_descriptor_writer_add_stream (writer, streaminfo);
} }
if (streams == NULL) if (streams == NULL)