Commit 11d1f560 authored by BurroCargado's avatar BurroCargado

Fix seeking HLS on-demand streaming not working

This issue occurs when playing HLS streaming delivered from a server that does not support partial requests. The issue is reproduced as follows(using Ubuntu 20.04 PC): 1. Prepare HLS example content. $ mkdir test $ ffmpeg -i example.flac -vn -c:a aac -b:a 128000 -f hls -hls_list_size 0 test/output.m3u8 (ffmpeg 4.2.4 is used) 2. Prepare web server without partial requests support. (Docker version 20.10.12 and NGINX official Docker image is used) $ docker run --name tmp-nginx-container -d nginx $ docker cp tmp-nginx-container:/etc/nginx/conf.d/default.conf . $ docker rm -f tmp-nginx-container Edit default.conf and add "max_ranges 0;" to "location / {...}". This disables partial requests support, removes 'Accept-Ranges: bytes' header from the server response. Then, run the server: $ docker run --name test-nginx -v $PWD/test:/usr/share/nginx/html:ro -v $PWD/default.conf:/etc/nginx/conf.d/default.conf -d -p 8080:80 nginx 3. Setup MPD to Play the next URL. http://address-of-the-server:8080/output.m3u8 Seeking this stream results in "exception: Not seekable".
parent bd840d46
...@@ -533,9 +533,8 @@ FfmpegDecode(DecoderClient &client, InputStream *input, ...@@ -533,9 +533,8 @@ FfmpegDecode(DecoderClient &client, InputStream *input,
: FromFfmpegTimeChecked(format_context.duration, AV_TIME_BASE_Q); : FromFfmpegTimeChecked(format_context.duration, AV_TIME_BASE_Q);
client.Ready(audio_format, client.Ready(audio_format,
input (input ? input->IsSeekable() : false)
? input->IsSeekable() || IsSeekable(format_context),
: IsSeekable(format_context),
total_time); total_time);
FfmpegParseMetaData(client, format_context, audio_stream); FfmpegParseMetaData(client, format_context, audio_stream);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment