hlsdemux: handle too short segments
authorThiago Santos <thiagoss@osg.samsung.com>
Wed, 22 Apr 2015 22:28:39 +0000 (19:28 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Wed, 22 Apr 2015 23:21:02 +0000 (20:21 -0300)
commit86a503a29bef450ceabacc9b64b62b409ec5a337
tree210ad7e9198139db00f004e2582d38dc35084d93
parent6c513a9d1e524af9992040d3ade1050b14ad5927
hlsdemux: handle too short segments

When the segment is very short it might be the case that the
typefinding fails and when finishing the segment hlsdemux would
consider the remaining data (pending_buffer) as an encryption
leftover.

This patch fixes it and makes sure an error is properly posted
if typefind failed by refactoring buffer handling to a function
and using it from the data_received and finish_fragment functions.
ext/hls/gsthlsdemux.c