mpv/demux
wm4 cbee577d0a cue: tolerate NBSP as whitespace
Apparently such .cue files exist. They fail both probing and parsing. To
make it worse, the sample at hand was encoded as Latin1.

One part of this is replacing bstr_lstrip() with a version that supports
NBSP. One could argue that bstr_lstrip() should always do this, but I
don't want to overdo it. There are many more unicode abomination which
it could be said it's supposed to handle, so it will stay ASCII instead
of going down this rabbit hole. I'm just assuming this cue sheet was
generated by some stupid software that inexplicably liked NBSPs (which
is how we justify a one-off fix). The new lstrip_whitespace() doesn't
look particularly efficient, but it doesn't have to be.

The second part is dealing with the fact that the charset is not
necessarily UTF-8. We don't want to do conversion before probing thinks
it knows it's a cue sheet (would probably make it more fragile all
around), so just make it work with Latin1 by assuming invalid code
points are Latin1. This fallback is part of why lstrip_whitespace() is
sort of roundabout.

(You could still rewrite it as much more efficient state machine,
instead of using a slow and validating UTF-8 parser that is called per
codepoint. Starting to overthink this.)

Multimedia is terrible. Legacy charsets are terrible. Everything is
terrible.

Fixes: #7429
2020-02-03 19:13:44 +01:00
..
cache.c
cache.h
codec_tags.c
codec_tags.h
cue.c cue: tolerate NBSP as whitespace 2020-02-03 19:13:44 +01:00
cue.h
demux.c demux: add per-demuxer sub-options 2020-01-04 19:47:36 +01:00
demux.h demux: add per-demuxer sub-options 2020-01-04 19:47:36 +01:00
demux_cue.c stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00
demux_disc.c stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00
demux_edl.c demux_edl: restore relative path resolution 2020-01-02 23:31:02 +01:00
demux_lavf.c demux: stop setting dummy stream on demux_close_stream() 2019-12-23 11:09:42 +01:00
demux_libarchive.c libarchive: some shitty hack to make opening slightly faster 2020-01-04 19:56:09 +01:00
demux_mf.c demux_mf: use stream API to open list files 2019-12-23 11:01:29 +01:00
demux_mkv.c demux: do not make up demuxer_id 2019-12-03 21:04:53 +01:00
demux_mkv_timeline.c playlist: change from linked list to an array 2019-12-28 21:32:15 +01:00
demux_null.c
demux_playlist.c playlist: change from linked list to an array 2019-12-28 21:32:15 +01:00
demux_raw.c
demux_timeline.c stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00
ebml.c
ebml.h
matroska.h
packet.c
packet.h
stheader.h
timeline.c stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00
timeline.h stream, demux: redo origin policy thing 2019-12-20 13:00:39 +01:00