hlsdemux: fix crash when decryption key can't be downloaded

Happened with
http://sslhls.m6tv.cdn.sfr.net/hls-live/livepkgr/_definst_/m6_hls_aes/m6_hls_aes_856.m3u8
if glib-networking was not installed (since key has https uri).
This commit is contained in:
Tim-Philipp Müller 2015-11-29 01:02:15 +00:00
parent 97ea56e91c
commit 64adb1998d
2 changed files with 12 additions and 4 deletions

View file

@ -477,9 +477,12 @@ gst_hls_demux_start_fragment (GstAdaptiveDemux * demux,
return TRUE;
key_failed:
/* TODO Raise this error to the user */
GST_WARNING_OBJECT (demux, "Failed to decrypt data");
return FALSE;
{
GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
("Couldn't retrieve key for decryption"), (NULL));
GST_WARNING_OBJECT (demux, "Failed to decrypt data");
return FALSE;
}
}
static GstFlowReturn

View file

@ -1815,7 +1815,10 @@ _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
stream->starting_fragment = FALSE;
if (klass->start_fragment) {
klass->start_fragment (demux, stream);
if (!klass->start_fragment (demux, stream)) {
ret = GST_FLOW_ERROR;
goto error;
}
}
GST_BUFFER_PTS (buffer) = stream->fragment.timestamp;
@ -1881,6 +1884,8 @@ _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
ret = GST_FLOW_EOS; /* return EOS to make the source stop */
}
error:
GST_MANIFEST_UNLOCK (demux);
return ret;