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.
This commit is contained in:
Matthew Waters 2016-11-17 14:21:23 +11:00
parent b69dadcc61
commit ba805938e3

View file

@ -246,6 +246,12 @@ gst_avf_asset_src_change_state (GstElement * element, GstStateChange transition)
switch (transition) { switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY: { case GST_STATE_CHANGE_NULL_TO_READY: {
self->state = GST_AVF_ASSET_SRC_STATE_STOPPED; 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]; self->reader = [[GstAVFAssetReader alloc] initWithURI:self->uri:&error];
if (error) { if (error) {
GST_ELEMENT_ERROR (element, RESOURCE, FAILED, ("AVFAssetReader error"), GST_ELEMENT_ERROR (element, RESOURCE, FAILED, ("AVFAssetReader error"),