summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVineeth T M <vineeth.tm@samsung.com>2015-07-17 23:42:22 +0900
committerLuis de Bethencourt <luis@debethencourt.com>2015-07-22 16:46:43 +0100
commit7e91f73c76d39dacdce26e0a509523e0014123b7 (patch)
tree4dee1ebe2e3f86b2e7e833089370e493bd215d8d
parentaa6aebe41e85f2e6b65af5af70d2ddffe0731f9a (diff)
validate-scenario: get duration from media_info if not able to query
In case of files, which don't have duration in header, baseparse estimates the duration only after 1.5 seconds. But Async_done event is sent before the duration is estimated, which results in error. If duration query fails, getting the duration from the media-info being passed through --set-media-info. If media-info is also not set, printing an error message and throwing error. https://bugzilla.gnome.org/show_bug.cgi?id=752521
-rw-r--r--validate/gst/validate/gst-validate-scenario.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c
index 0820f5b..35ac71c 100644
--- a/validate/gst/validate/gst-validate-scenario.c
+++ b/validate/gst/validate/gst-validate-scenario.c
@@ -349,8 +349,18 @@ _set_variable_func (const gchar * name, double *value, gpointer user_data)
if (!gst_element_query_duration (scenario->pipeline,
GST_FORMAT_TIME, &duration)) {
- GST_WARNING_OBJECT (scenario, "Could not query duration");
- return FALSE;
+ GstValidateMonitor *monitor =
+ (GstValidateMonitor *) (g_object_get_data ((GObject *)
+ scenario->pipeline, "validate-monitor"));
+ GST_WARNING_OBJECT (scenario,
+ "Could not query duration. Trying to get duration from media-info");
+ if (monitor && monitor->media_descriptor)
+ duration =
+ gst_media_descriptor_get_duration (monitor->media_descriptor);
+ else {
+ GST_ERROR_OBJECT (scenario, "Media-info not set");
+ return FALSE;
+ }
}
if (!GST_CLOCK_TIME_IS_VALID (duration))