1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-21 10:51:51 +00:00
mpv/DOCS/man
wm4 f439064e7f demux: demux multiple audio frames in backward playback
Until now, this usually passed a single audio frame to the decoder, and
then did a backstep operation (cache seek + frame search) again. This is
probably not very efficient, especially considering it has to search the
packet queue from the "start" every time again.

Also, with most audio codecs, an additional "preroll" frame was passed
first. In these cases, the preroll frame would make up 50% of audio
decoding time. Also not very efficient.

Attempt to fix this by returning multiple frames at once. This reduces
the number of backstep operations and the ratio the preoll frames. In
theory, this should help efficiency. I didn't test it though, why would
I do this? It's just a pain. Set it to unscientific 10 frames.
(Actually, these are 10 keyframes, so it's much more for codecs like
TrueHD. But I don't care about TrueHD.)

This commit changes some other implementation details. Since we can
return more than 1 non-preroll keyframe to the decoder, some new state
is needed to remember how much. The resume packet search is adjusted to
find N ("total") keyframe packets in general, not just preroll frames.
I'm removing the special case for 1 preroll packet; audio used this, but
doesn't anymore, and it's premature optimization anyway.

Expose the new mechanism with 2 new options. They're almost completely
pointless, since nobody will try them, and if they do, they won't
understand what these options truly do. And if they actually do, they
most likely would be capable of editing the source code, and we could
just hardcode the parameters. Just so you know that I know that the
added options are pointless.

The following two things are truly unrelated to this commit, and more
like general refactoring, but fortunately nobody can stop me.

Don't set back_seek_pos in dequeue_packet() anymore. This was sort of
pointless, since it was set in find_backward_restart_pos() anyway (using
some of the same packets). The latter function tries to restrict this to
the first keyframe range though, which is an optimization that in theory
might break with broken files (duh), but in these cases a lot of other
things would be broken anyway.

Don't set back_restart_* in dequeue_packet(). I think this is an
artifact of the old restart code (cf. ad9e473c55). It can be done
directly in find_backward_restart_pos() now. Although this adds another
shitty packet search loop, I prefer this, because clearer what's
actually happening.
2019-09-19 20:37:05 +02:00
..
af.rst f_lavfi: add an option to use old audio PTS handling for af_lavfi 2018-04-15 23:11:33 +03:00
ao.rst ao_pulse: reduce requested device buffer size 2018-04-15 23:11:33 +03:00
changes.rst manpage: mention the client API/interface change logs 2016-09-02 09:48:35 +02:00
encode.rst encode: remove old timestamp handling 2018-05-03 01:08:44 +03:00
input.rst manpage: remove double fw-bytes documentation 2019-09-19 20:37:04 +02:00
ipc.rst ipc: alias set_property_string to set_property 2018-05-25 10:45:59 +02:00
javascript.rst js: expose mpv_abort_async_command() (match dbe831bd) 2019-09-11 21:08:04 +03:00
libmpv.rst manpage: define stricter rules for C plugin return values 2017-01-14 17:41:04 +01:00
lua.rst lua: expose mpv_abort_async_command() 2018-05-24 19:56:34 +02:00
mpv.rst Remove libdvdread support in favor of libdvdnav 2019-09-13 15:29:27 +02:00
options.rst demux: demux multiple audio frames in backward playback 2019-09-19 20:37:05 +02:00
osc.rst osc: improve look of seekranges 2019-09-02 01:11:04 +03:00
stats.rst config: replace config dir lua-settings/ with dir script-opts/ 2018-04-07 16:02:16 -07:00
vf.rst DOCS: remove references to --video-stereo-mode 2019-09-14 21:16:38 +02:00
vo.rst image_writer: add webp-compression option 2019-09-14 23:02:39 +02:00