mpv/filters
wm4 5d5fdb77e9 ad_lavc, vd_lavc: return full error codes to shared decoder loop
ad_lavc and vd_lavc use the lavc_process() helper to translate the
FFmpeg push/pull API to the internal filter API (which completely
mismatch, even though I'm responsible for both, just fucking kill me).

This interface was "slightly" too tight. It returned only a bool
indicating "progress", which was not enough to handle some cases (see
following commit).

While we're at it, move all state into a struct. This is only a single
bool, but we get the chance to add more if needed.

This fixes mpv falling asleep if decoding returns an error during
draining. If decoding fails when we already sent EOF, the state machine
stopped making progress. This left mpv just sitting around and doing
nothing.

A test case can be created with: echo $RANDOM >> image.png

This makes libavformat read a proper packet plus a packet of garbage.
libavcodec will decode a frame, and then return an error code. The
lavc_process() wrapper could not deal with this, because there was no
way to differentiate between "retry" and "send new packet". Normally, it
would send a new packet, so decoding would make progress anyway. If
there was "progress", we couldn't just retry, because it'd retry
forever.

This is made worse by the fact that it tries to decode at least two
frames before starting display, meaning it will "sit around and do
nothing" before the picture is displayed.

Change it so that on error return, "receiving" a frame is retried. This
will make it return the EOF, so everything works properly.

This is a high-risk change, because all these funny bullshit exceptions
for hardware decoding are in the way, and I didn't retest them. For
example, if hardware decoding is enabled, it keeps a list of packets,
that are fed into the decoder again if hardware decoding fails, and a
software fallback is performed. Another case of horrifying accidental
complexity.

Fixes: #6618
2019-10-24 18:50:28 +02:00
..
f_auto_filters.c f_auto_filters: use f_autoconvert for hw download 2019-10-02 23:13:26 +02:00
f_auto_filters.h
f_autoconvert.c filters: extend vf_format so that it can convert color parameters 2019-10-21 01:38:25 +02:00
f_autoconvert.h filters: extend vf_format so that it can convert color parameters 2019-10-21 01:38:25 +02:00
f_decoder_wrapper.c ad_lavc, vd_lavc: return full error codes to shared decoder loop 2019-10-24 18:50:28 +02:00
f_decoder_wrapper.h ad_lavc, vd_lavc: return full error codes to shared decoder loop 2019-10-24 18:50:28 +02:00
f_demux_in.c f_demux_in: give it a slightly better filter name 2018-02-05 02:47:14 -08:00
f_demux_in.h
f_hwtransfer.c f_hwtransfer: add a mp_hwdownload filter 2019-10-02 21:14:58 +02:00
f_hwtransfer.h f_hwtransfer: add a mp_hwdownload filter 2019-10-02 21:14:58 +02:00
f_lavfi.c f_lavfi: support setting common filter options like "threads" 2018-04-29 02:21:32 +03:00
f_lavfi.h f_lavfi: fix typo in comment 2018-02-13 17:45:29 -08:00
f_output_chain.c f_output_chain: remove a redundant variable 2018-04-29 02:21:32 +03:00
f_output_chain.h f_output_chain: fix typo 2018-04-15 23:11:33 +03:00
f_swresample.c audio: fix segfault caused by incorrect number of planes 2019-02-23 00:21:54 +02:00
f_swresample.h swresample: limit output size of audio frames 2018-02-03 05:01:29 -08:00
f_swscale.c filters: extend vf_format so that it can convert color parameters 2019-10-21 01:38:25 +02:00
f_swscale.h filters: extend vf_format so that it can convert color parameters 2019-10-21 01:38:25 +02:00
f_utils.c filters: add another dumb helper 2019-10-02 21:09:30 +02:00
f_utils.h filters: add another dumb helper 2019-10-02 21:09:30 +02:00
filter.c filter: hide warning when disconnecting pins drops frames 2018-04-29 02:21:32 +03:00
filter.h f_output_chain: log status of auto filters 2018-04-29 02:21:32 +03:00
filter_internal.h
frame.c Implement backwards playback 2019-09-19 20:37:04 +02:00
frame.h Implement backwards playback 2019-09-19 20:37:04 +02:00
user_filters.c video: add vf_fingerprint and a skip-logo script 2019-09-19 20:37:05 +02:00
user_filters.h video: add vf_fingerprint and a skip-logo script 2019-09-19 20:37:05 +02:00