diff options
author | Matthew Waters <matthew@centricular.com> | 2016-11-17 14:21:23 +1100 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2016-11-17 17:30:54 +1100 |
commit | ba805938e3907230936f55c43a0acfe217b057ed (patch) | |
tree | 4da6c2f39970baab760416ec0870445b17d46a7a /sys/applemedia | |
parent | b69dadcc61683e151a2baeea22f7088ef024039e (diff) | |
download | gstreamer-plugins-bad-ba805938e3907230936f55c43a0acfe217b057ed.tar.gz |
applemedia: error out if the uri property is not set
Fixes:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString
in the state change test.
Diffstat (limited to 'sys/applemedia')
-rw-r--r-- | sys/applemedia/avfassetsrc.m | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/applemedia/avfassetsrc.m b/sys/applemedia/avfassetsrc.m index 856828160..7cb9855b7 100644 --- a/sys/applemedia/avfassetsrc.m +++ b/sys/applemedia/avfassetsrc.m @@ -246,6 +246,12 @@ gst_avf_asset_src_change_state (GstElement * element, GstStateChange transition) switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: { self->state = GST_AVF_ASSET_SRC_STATE_STOPPED; + if (!self->uri) { + GST_ELEMENT_ERROR (element, RESOURCE, NOT_FOUND, + ("\"uri\" property not set"), (NULL)); + gst_avf_asset_src_stop_all (self); + return GST_STATE_CHANGE_FAILURE; + } self->reader = [[GstAVFAssetReader alloc] initWithURI:self->uri:&error]; if (error) { GST_ELEMENT_ERROR (element, RESOURCE, FAILED, ("AVFAssetReader error"), |