Commit graph

19 commits

Author SHA1 Message Date
Sebastian Dröge
bd54a212d3 hlsdemux: Fix comparison in bitrate selection 2014-03-09 20:50:44 +01:00
Sebastian Dröge
c9bb878fe5 m3u8: Fix off-by-one in the download range end 2014-03-07 16:24:19 +01:00
Sebastian Dröge
cd02546089 hlsdemux: Implement handling of byte ranges 2014-03-06 16:36:10 +01:00
Sebastian Dröge
0a32c5f7a4 hlsdemux: Implement proper handling of discontinuities
It's not really correct yet for seeks but better than what
we had before.

See https://bugzilla.gnome.org/show_bug.cgi?id=695846
2014-03-01 17:15:54 +01:00
Alex Ashley
b7ef52c515 hlsdemux: Segfaults if playlist has no media files
hlsdemux causes a null pointer dereference if the media playlist
does not contain any media files. The gst_m3u8_client_get_duration
function assumes that demux->client->current->files is valid when
computing duration.

gst_m3u8_client_update needed to be modified to check for the
case of downloading an M3U8 file that doesn't contain any media
files, and returning an error to gsthlsdemux.c

This bug can be reproduced by creating a master m3u8 file that
contains one media playlist that points back to the master m3u8
file.  For example create a file called bug725134.m3u8:
  #EXTM3U
  #EXT-X-VERSION:4
  #EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1251135, CODECS="avc1.42001f mp4a.40.2", RESOLUTION=640x352
  bug725134.m3u8

https://bugzilla.gnome.org/show_bug.cgi?id=725134
2014-03-01 16:34:59 +01:00
Alex Ashley
161254d7c0 hlsdemux: Fix parsing of CODECS and RESOLUTION
hlsdemux does not check for the '"' character in #EXT-X-STREAM-INF
attributes. The CODECS parameter is an example of an attribute
that might use the '"' symbol and might contain a ',' character
inside this quoted string.

For example: CODECS="avc1.77.30, mp4a.40.2"

hlsdemux does not correctly parse the RESOLUTION attribute, it
assumes that an '=' character is used to delineate the width
and height values, but the HLS RFC states that a 'x' character
must be used as the delimiter between width and height.

https://bugzilla.gnome.org/show_bug.cgi?id=725140
2014-02-26 09:23:22 +01:00
Alex Ashley
91775a1abd hlsdemux: Fix for URLs that contain a '/' in the query parameter
If the URL for the master manifest files contains a '/' character
in the query parameter (for example
http://example.net/1054559_h264_1500k.mp4/master.m3u8?acl=/*1054559_h264_1500k.mp4),
hlsdemux is incorrectly converting the relative URLs of the media
playlists in to absolute URLs. It is incorrectly using the last '/' it
finds in the URL. According to RFC3986 the '/' character is allowed in
the query part of the URL.

https://bugzilla.gnome.org/show_bug.cgi?id=725137
2014-02-26 09:20:58 +01:00
Sebastian Dröge
b3a7242910 hlsdemux: Keep track of timestamps by adding them up during playback
...instead of adding them from the start of playlist every time. This
among other things fixes timestamps for live streams, where the playlist
is some kind of ringbuffer of fragments and thus adding from the beginning
of the playlist will miss the past fragments.

https://bugzilla.gnome.org/show_bug.cgi?id=724983
2014-02-23 15:18:22 +01:00
Sebastian Dröge
a51116add3 hlsdemux: Refactor threading and downloading
We now download fragments as fast as possible and push them downstream
while another thread is just responsible for updating live playlists
every now and then.

This simplifies the code a lot and together with the new buffering
mode for adaptive streams in multiqueue makes streams start much faster.

Also simplify threading a bit and hopefully make the GstTask usage safer.
2014-02-23 00:10:45 +01:00
Sebastian Dröge
e40b72bc9b hlsdemux: Ignore empty lines in the playlist
Based on a patch by Andoni Morales.
2014-02-12 18:50:09 +01:00
Sebastian Dröge
65c1faf553 hlsdemux: Make sure to ignore \r in line endings in every case 2014-02-12 18:47:45 +01:00
Arnaud Vrac
6e54b8ee53 hlsdemux: schedule next update based on the fragment duration 2014-02-12 15:18:29 +01:00
Sebastian Dröge
dc45d236d2 hlsdemux: Use g_ascii_xdigit_value() instead of our own version of it 2014-02-12 14:10:02 +01:00
Sebastian Dröge
5e55bae14b hlsdemux: Don't try decryption if an unsupported method is found 2014-02-11 18:15:45 +01:00
Sebastian Dröge
56faad51bb hlsdemux: Properly parse IV from the playlist
Without this every fragment's first 16 bytes will be corrupted
if not the fallback IV is used by the playlist.
2014-02-11 18:15:07 +01:00
Sebastian Dröge
a4847fd4db hlsdemux: Actually store doubles as such and don't truncate them to ints
Fixes broken duration reporting.
2014-02-10 17:27:10 +01:00
Sebastian Dröge
a5387eb372 hlsdemux: Use locale-independent int/float parsing functions from GLib 2014-02-10 17:27:10 +01:00
Sebastian Dröge
6abed8da20 hlsdemux: Update to non-deprecated GLib thread API 2014-02-09 18:19:33 +01:00
Alessandro Decina
d2d6798087 Make the hls plugin depend on gnutls and move to ext/hls/
gnutls is used to implement AES decryption
2013-03-19 10:54:18 +01:00
Renamed from gst/hls/m3u8.c (Browse further)