After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752863 - hlssink: max-files deletes old files without removing them from m3u8 index
hlssink: max-files deletes old files without removing them from m3u8 index
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.2.4
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 767852 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-07-25 14:58 UTC by minfrin
Modified: 2018-11-03 13:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description minfrin 2015-07-25 14:58:30 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.
Comment 1 Thiago Sousa Santos 2015-07-27 12:39:22 UTC
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?
Comment 2 minfrin 2015-07-27 13:18:05 UTC
I would argue plan A.
Comment 3 Tim-Philipp Müller 2016-06-20 07:51:11 UTC
*** Bug 767852 has been marked as a duplicate of this bug. ***
Comment 4 Abu Abdulla 2016-06-21 04:01:23 UTC
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.
Comment 5 GStreamer system administrator 2018-11-03 13:38:53 UTC
-- 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.