1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-25 04:38:01 +00:00
mpv/demux
wm4 02756c3735 demux_lavf: to get effective HLS bitrate
In theory, this could be easily done with custom I/O. In practice, all
the halfassed garbage in FFmpeg shits itself and fucks up like there's
no tomorrow. There are several problems:

1. FFmpeg pretends you can do custom I/O, but in reality there's a lot
that custom I/O can do. hls.c even contains explicit checks to disable
important things if custom I/O is used! In particular, you can't use the
HTTP keepalive functionality (needed for somewhat decent HLS
performance), because some cranky asshole in the cursed FFmpeg dev.
community blocked it.

2. The implementation of nested I/O callbacks (io_open/io_close) is
bogus and halfassed (like everything in FFmpeg, really). It will call
io_open on some URLs without ever calling io_close. Instead, it'll call
avio_close() on the context directly. From what I can tell, avio_close()
is incompable to custom I/O anyway (overwhelmed by their own garbage,
the fFmpeg devs created the io_close callback for this reason, because
they couldn't fix their own fucking garbage). This commit adds some
shitty workaround for this (technically triggers UB, but with that
garbage heap of a library we depend on it's not like it matters).

3. Even then, you can't proxy I/O contexts (see 1.), but we can just
keep track of the opened nested I/O contexts. The bytes_read is
documented as not public, but reading it is literally the only way to
get what we want.

A more reasonable approach would probably be using curl. It could
transparently handle the keep-alive thing, as well as propagating
cookies etc. (which doesn't work with the FFmpeg approach if you use
custom I/O). Of course even better if there were an independent HLS
implementation anywhere. FFmpeg's HLS support is so embarrassing
pathetic and just goes to show that they belong into the past
(multimedia from 2000-2010) and should either modernize or fuck off.
With FFmpeg's shit-crusted structures, todic communities, and retarded
assholes denying progress, probably the latter. Did I already mention
that FFmpeg is a shit fucked steaming pile of garbage shit?

And all just to get some basic I/O stats, that any proper HLS consumer
requires in order to implement adaptive streaming correctly (i.e.
browser based players, and nothing FFmshit based).
2018-12-06 10:30:57 +01:00
..
codec_tags.c demux_mkv: remove incorrect comment 2017-06-03 23:23:35 +02:00
codec_tags.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
cue.c cue: strip quotes and leading whitespace from tags 2018-01-30 14:01:15 +01:00
cue.h Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
demux_cue.c demux: get rid of DEMUXER_CTRL_GET_TIME_LENGTH 2017-06-20 14:22:10 +02:00
demux_disc.c demux, stream: rip out the classic stream cache 2018-08-31 12:55:22 +02:00
demux_edl.c demux_edl: add title option to override title of chapters 2018-08-13 19:09:57 +02:00
demux_lavf.c demux_lavf: to get effective HLS bitrate 2018-12-06 10:30:57 +01:00
demux_libarchive.c demux, stream: add option to prevent opening referenced files 2016-12-04 23:15:31 +01:00
demux_mf.c build: switch preliminary LGPL mode from v3 to v2.1 2017-10-05 15:57:30 +02:00
demux_mkv_timeline.c demux, stream: rip out the classic stream cache 2018-08-31 12:55:22 +02:00
demux_mkv.c demux_mkv: add A_MLP to mkv_audio_tags 2018-06-22 21:17:26 +03:00
demux_null.c demux_null: mark as seekable 2018-01-06 14:42:22 -08:00
demux_playlist.c misc: move mp_cancel from stream.c to thread_tools.c 2018-05-24 19:56:35 +02:00
demux_rar.c demux, stream: add option to prevent opening referenced files 2016-12-04 23:15:31 +01:00
demux_raw.c demux_raw: change license to LGPL 2017-06-24 13:56:53 +02:00
demux_timeline.c demux: get rid of free_demuxer[_and_stream]() 2018-05-24 19:56:35 +02:00
demux_tv.c command: whitelist some blocking accesses for certain demuxers/streams 2018-05-24 19:56:35 +02:00
demux.c demux, stream: readd cache-speed in some other form 2018-12-06 10:30:41 +01:00
demux.h demux, stream: readd cache-speed in some other form 2018-12-06 10:30:41 +01:00
ebml.c demux_mkv: adjust log verbosity levels 2018-04-29 02:21:32 +03:00
ebml.h demux_mkv: rewrite packet reading to avoid 1 memcpy() 2017-11-05 18:13:34 +01:00
matroska.h ebml, matroska.h: change license to LGPL 2017-04-21 13:34:10 +02:00
packet.c demux/packet: fix demux_packet_shorten 2018-09-30 12:32:03 +03:00
packet.h demux: support for some kinds of timed metadata 2018-04-18 01:17:42 +03:00
stheader.h player: expose hearing/visual impaired flags on audio tracks 2018-08-13 19:09:44 +02:00
timeline.c demux: get rid of free_demuxer[_and_stream]() 2018-05-24 19:56:35 +02:00
timeline.h ytdl_hook, edl: implement pseudo-DASH support 2017-02-04 22:34:38 +01:00