• BurroCargado's avatar
    Fix seeking HLS on-demand streaming not working · 11d1f560
    BurroCargado authored
    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".
    11d1f560
Name
Last commit
Last update
..
android Loading commit data...
apple Loading commit data...
archive Loading commit data...
client Loading commit data...
command Loading commit data...
config Loading commit data...
db Loading commit data...
decoder Loading commit data...
encoder Loading commit data...
event Loading commit data...
filter Loading commit data...
fs Loading commit data...
haiku Loading commit data...
input Loading commit data...
io Loading commit data...
java Loading commit data...
lib Loading commit data...
mixer Loading commit data...
neighbor Loading commit data...
net Loading commit data...
output Loading commit data...
pcm Loading commit data...
player Loading commit data...
playlist Loading commit data...
protocol Loading commit data...
queue Loading commit data...
song Loading commit data...
sticker Loading commit data...
storage Loading commit data...
system Loading commit data...
tag Loading commit data...
thread Loading commit data...
time Loading commit data...
unix Loading commit data...
util Loading commit data...
win32 Loading commit data...
zeroconf Loading commit data...
BulkEdit.hxx Loading commit data...
Chrono.hxx Loading commit data...
CommandLine.cxx Loading commit data...
CommandLine.hxx Loading commit data...
GitVersion.cxx Loading commit data...
GitVersion.hxx Loading commit data...
Idle.cxx Loading commit data...
Idle.hxx Loading commit data...
IdleFlags.cxx Loading commit data...
IdleFlags.hxx Loading commit data...
Instance.cxx Loading commit data...
Instance.hxx Loading commit data...
Listen.cxx Loading commit data...
Listen.hxx Loading commit data...
LocateUri.cxx Loading commit data...
LocateUri.hxx Loading commit data...
Log.cxx Loading commit data...
Log.hxx Loading commit data...
LogBackend.cxx Loading commit data...
LogBackend.hxx Loading commit data...
LogInit.cxx Loading commit data...
LogInit.hxx Loading commit data...
LogLevel.hxx Loading commit data...
Main.cxx Loading commit data...
Main.hxx Loading commit data...
Mapper.cxx Loading commit data...
Mapper.hxx Loading commit data...
MusicBuffer.cxx Loading commit data...
MusicBuffer.hxx Loading commit data...
MusicChunk.cxx Loading commit data...
MusicChunk.hxx Loading commit data...
MusicChunkPtr.cxx Loading commit data...
MusicChunkPtr.hxx Loading commit data...
MusicPipe.cxx Loading commit data...
MusicPipe.hxx Loading commit data...
Partition.cxx Loading commit data...
Partition.hxx Loading commit data...
Permission.cxx Loading commit data...
Permission.hxx Loading commit data...
PlaylistDatabase.cxx Loading commit data...
PlaylistDatabase.hxx Loading commit data...
PlaylistError.cxx Loading commit data...
PlaylistError.hxx Loading commit data...
PlaylistFile.cxx Loading commit data...
PlaylistFile.hxx Loading commit data...
PlaylistPrint.cxx Loading commit data...
PlaylistPrint.hxx Loading commit data...
PlaylistSave.cxx Loading commit data...
PlaylistSave.hxx Loading commit data...
PluginUnavailable.hxx Loading commit data...
RemoteTagCache.cxx Loading commit data...
RemoteTagCache.hxx Loading commit data...
RemoteTagCacheHandler.hxx Loading commit data...
ReplayGainConfig.hxx Loading commit data...
ReplayGainGlobal.cxx Loading commit data...
ReplayGainGlobal.hxx Loading commit data...
ReplayGainInfo.cxx Loading commit data...
ReplayGainInfo.hxx Loading commit data...
ReplayGainMode.cxx Loading commit data...
ReplayGainMode.hxx Loading commit data...
SingleMode.cxx Loading commit data...
SingleMode.hxx Loading commit data...
SongLoader.cxx Loading commit data...
SongLoader.hxx Loading commit data...
SongPrint.cxx Loading commit data...
SongPrint.hxx Loading commit data...
SongSave.cxx Loading commit data...
SongSave.hxx Loading commit data...
SongUpdate.cxx Loading commit data...
StateFile.cxx Loading commit data...
StateFile.hxx Loading commit data...
StateFileConfig.cxx Loading commit data...
StateFileConfig.hxx Loading commit data...
Stats.cxx Loading commit data...
Stats.hxx Loading commit data...
TagAny.cxx Loading commit data...
TagAny.hxx Loading commit data...
TagArchive.cxx Loading commit data...
TagArchive.hxx Loading commit data...
TagFile.cxx Loading commit data...
TagFile.hxx Loading commit data...
TagPrint.cxx Loading commit data...
TagPrint.hxx Loading commit data...
TagSave.cxx Loading commit data...
TagSave.hxx Loading commit data...
TagStream.cxx Loading commit data...
TagStream.hxx Loading commit data...
TimePrint.cxx Loading commit data...
TimePrint.hxx Loading commit data...
ls.cxx Loading commit data...
ls.hxx Loading commit data...
open.h Loading commit data...