aboutsummaryrefslogtreecommitdiffhomepage
path: root/common
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2017-08-11 21:28:01 +0200
committerGravatar wm4 <wm4@nowhere>2017-08-11 21:29:35 +0200
commitc3916406451cddfb9daa42699dcd2163bff1a0eb (patch)
treebf2726829d142fdee6a62e3fb76549873a119e2e /common
parent8b1d4b978de855d62efd9c3f54216196e095b5bc (diff)
player: fix --lavfi-complex freeze
Commit 0e0b87b6f3297 fixed that dropped packets did not trigger further work correctly. But it also made trivial --lavfi-complex freeze. The reason is that the meaning if DATA_AGAIN was overloaded: the decoders meant that they should be called again, while lavfi.c meant that other outputs needed to be checked again. Rename the latter meaning to DATA_STARVE, which means that the current input will deliver no more data, until "other" work has been done (like reading other outputs, or feeding input). The decoders never return DATA_STARVE, because they don't get input from the player core (instead, they get it from the demuxer directly, which is why they still can return DATA_WAIT). Also document the DATA_* semantics in the enum. Fixes #4746.
Diffstat (limited to 'common')
-rw-r--r--common/common.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/common/common.h b/common/common.h
index cdd1d56ed5..bed9060f71 100644
--- a/common/common.h
+++ b/common/common.h
@@ -59,10 +59,11 @@ enum stream_type {
};
enum {
- DATA_OK = 1,
- DATA_WAIT = 0,
- DATA_AGAIN = -1,
- DATA_EOF = -2,
+ DATA_OK = 1, // data is actually being returned
+ DATA_WAIT = 0, // async wait: check state again after next wakeup
+ DATA_AGAIN = -2, // repeat request (internal progress was made)
+ DATA_STARVE = -1, // need input (might require to drain other outputs)
+ DATA_EOF = -3, // no more data available
};
extern const char mpv_version[];