stream.hls: Apply segment ignore_name regardless of extension#6747
Conversation
There was a problem hiding this comment.
Thanks for the PR.
The --hls-segment-ignore-names stuff is rather old (added in 39d81e3) and predates the segment filtering implementation. I've talked about it a couple of times already on the issue tracker that I'd like to replace or remove it, because it's pretty bad. The reason why this ignore-names implementation is not ideal is that it receives user input from the CLI via a comma-separated string, and it's also very limiting for selecting specific segments because of this regex idea. All of that is irrelevant for your PR though.
What is relevant though is that both the current implementation and your PR are not correct and require a change. The HLS specification (RFC 8216) doesn't say anything about media segment URIs/URLs. It only requires HLS multivariant+media playlists to either have an .m3u or .m3u8 URL path suffix, or the HTTP server must send the application/vnd.apple.mpegurl/audio/mpegurl Content-Type response header. Media segments are unspecified, meaning the regex should not contain a suffix, not even a "wildcard" one.
There's also an issue with a changed test which I've annotated.
|
Thanks for the comment - I didn't notice that the ".*" was actually useful :) I applied the changes. Also, I didn't realize this feature was that old. This PR is mostly for my convenience since I use this to filter out segments when using the HLS plugin (for platforms that don't have their own specific plugin). Feel free to ignore it if you're going to rewrite / remove the feature in the near future. |
|
Apologies for the late response. I'm a little bit torn here, because changing the regex and removing the incorrect suffix results in some unintended side-effects that change the behavior of this feature, because the regex is applied to the whole As said, this feature is implemented poorly. A proper filtering mechanism shouldn't be based on the Since this is such a niche feature and one that should be replaced anyway, I think I'm going to merge your changes, but I will have another thought about it later today. |
Minor change to match ignore_name patterns regardless of segment extension (before this it only matched .ts segments).