summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVineeth TM <vineeth.tm@samsung.com>2015-07-23 15:51:09 +0900
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2015-08-05 17:25:04 -0400
commit82ffd9c53e57a41deee5b9c220e7c1b216b7b34a (patch)
tree2a848f61f476d56d966714d36a32a6673ed11225
parent97e630efbaa0587fbd3343375718e6d89100e2b3 (diff)
validate: descriptor-writer: Handle error when stream info is not available
There is no check to see if stream info is available. This leads to assertion error. Adding proper error messages for the same and reported the same as a validate warning message. https://bugzilla.gnome.org/show_bug.cgi?id=752758
-rw-r--r--validate/gst/validate/gst-validate-report.c2
-rw-r--r--validate/gst/validate/gst-validate-report.h1
-rw-r--r--validate/gst/validate/media-descriptor-writer.c23
3 files changed, 17 insertions, 9 deletions
diff --git a/validate/gst/validate/gst-validate-report.c b/validate/gst/validate/gst-validate-report.c
index 16b1bb8..ae648d7 100644
--- a/validate/gst/validate/gst-validate-report.c
+++ b/validate/gst/validate/gst-validate-report.c
@@ -299,6 +299,8 @@ gst_validate_report_load_issues (void)
_("resulting file stream profiles didn't match expected values"), NULL);
REGISTER_VALIDATE_ISSUE (ISSUE, FILE_TAG_DETECTION_INCORRECT,
_("detected tags are different than expected ones"), NULL);
+ REGISTER_VALIDATE_ISSUE (WARNING, FILE_NO_STREAM_INFO,
+ _("the discoverer could not determine the stream info"), NULL);
REGISTER_VALIDATE_ISSUE (WARNING, FILE_NO_STREAM_ID,
_("the discoverer found a stream that had no stream ID"), NULL);
diff --git a/validate/gst/validate/gst-validate-report.h b/validate/gst/validate/gst-validate-report.h
index 807a217..d93b526 100644
--- a/validate/gst/validate/gst-validate-report.h
+++ b/validate/gst/validate/gst-validate-report.h
@@ -91,6 +91,7 @@ typedef enum {
#define STATE_CHANGE_FAILURE _QUARK("state::change-failure")
+#define FILE_NO_STREAM_INFO _QUARK("file-checking::no-stream-info")
#define FILE_NO_STREAM_ID _QUARK("file-checking::no-stream-id")
#define FILE_TAG_DETECTION_INCORRECT _QUARK("file-checking::tag-detection-incorrect")
#define FILE_SIZE_INCORRECT _QUARK("file-checking::size-incorrect")
diff --git a/validate/gst/validate/media-descriptor-writer.c b/validate/gst/validate/media-descriptor-writer.c
index f282a9e..12a772a 100644
--- a/validate/gst/validate/media-descriptor-writer.c
+++ b/validate/gst/validate/media-descriptor-writer.c
@@ -576,17 +576,22 @@ gst_media_descriptor_writer_new_discover (GstValidateRunner * runner,
streaminfo = gst_discoverer_info_get_stream_info (info);
- if (GST_IS_DISCOVERER_CONTAINER_INFO (streaminfo)) {
- ((GstMediaDescriptor *) writer)->filenode->caps =
- 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);
+ if (streaminfo) {
+ if (GST_IS_DISCOVERER_CONTAINER_INFO (streaminfo)) {
+ ((GstMediaDescriptor *) writer)->filenode->caps =
+ 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);
}
} else {
- gst_media_descriptor_writer_add_stream (writer, streaminfo);
+ GST_VALIDATE_REPORT (writer, FILE_NO_STREAM_INFO,
+ "Discoverer info, does not contain the stream info");
}
media_descriptor = (GstMediaDescriptor *) writer;