mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 21:18:52 +00:00
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
This commit is contained in:
parent
97e630efba
commit
82ffd9c53e
3 changed files with 16 additions and 8 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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));
|
||||
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);
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue