GNOME Bugzilla – Bug 752863
hlssink: max-files deletes old files without removing them from m3u8 index
Last modified: 2018-11-03 13:38:53 UTC
When an attempt is made to use the max-files option to limit the number of files on disk, the first file in the index is deleted too early and is missing: hlssink max-files=5 location=/var/www/stream/segment%05d.ts playlist-location=/var/www/stream/output.m3u8 playlist-root=http://192.168.225.2/stream/ root@raspberrypi:/var/www/stream# ls -al; cat output.m3u8 total 1960 drwxrwxrwt 2 root root 160 Jul 25 14:47 . drwxr-xr-x 3 root root 4096 Jul 25 10:48 .. -rw-r--r-- 1 pi pi 381 Jul 25 14:47 output.m3u8 -rw-r--r-- 1 pi pi 423940 Jul 25 14:46 segment00066.ts -rw-r--r-- 1 pi pi 460788 Jul 25 14:46 segment00067.ts -rw-r--r-- 1 pi pi 408712 Jul 25 14:47 segment00068.ts -rw-r--r-- 1 pi pi 526024 Jul 25 14:47 segment00069.ts -rw-r--r-- 1 pi pi 172032 Jul 25 14:47 segment00070.ts #EXTM3U #EXT-X-ALLOW-CACHE:NO #EXT-X-MEDIA-SEQUENCE:66 #EXT-X-TARGETDURATION:17 #EXTINF:17,ciao http://192.168.225.2/stream/segment00065.ts #EXTINF:17,ciao http://192.168.225.2/stream/segment00066.ts #EXTINF:17,ciao http://192.168.225.2/stream/segment00067.ts #EXTINF:17,ciao http://192.168.225.2/stream/segment00068.ts #EXTINF:17,ciao http://192.168.225.2/stream/segment00069.ts In the above example the file segment00065.ts is listed in the index, but does not exist on disk any more. This leads to spurious 404 errors from the webserver.
What happens is that multifilesink does: 1) Remove old file 2) Create new file 3) Emit notification message hlssink only gets notified at step 3 so there is a window in which the old file was removed and is still at the playlist. 2 possible solutions: A) Rework multifilesink to do: 2, 3, 1. This will make it have max_files+1 for a short time, is that acceptable? B) have hlssink set max_files+1 to multifilesink to prevent this scenario Preferences?
I would argue plan A.
*** Bug 767852 has been marked as a duplicate of this bug. ***
why not Rework multifilesink to do: 2,1,3. it seems logical to me i.e. replacing the file and then re-ordering the list in the .m3u8 all solutions seems workable.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/285.