summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-08-22 20:43:15 +0200
committerwm4 <wm4@nowhere>2020-08-22 20:43:15 +0200
commitc06577e291aaf598981be2b0c3999ea04da31d82 (patch)
treebd3641a03803135cec897e7369b6a570d135b0f9 /demux
parentb3758db128fd732358a45a4719e01558a0f4bf1b (diff)
downloadmpv-c06577e291aaf598981be2b0c3999ea04da31d82.tar.bz2
mpv-c06577e291aaf598981be2b0c3999ea04da31d82.tar.xz
player: do not loop if there's nothing to loop
This can happen if a file contains headers only, or if decoding of all data failed, and such. Interestingly, it also happened when doing "mpv --loop emptyfile.png", because demux_mf still detects file formats by file extension. In this situation, the player burned a lot of CPU by restarting playback after doing nothing. Although such "degenerate" behavior can't be avoided in all situations (what if you loop a file with 1 audio sample?), detecting this seems to make sense. For now, this actually decrements the loop count by 1, and then errors out with a warning. Works for --loop and --ab-loop, while --loop-playlist already avoids this situation with an existing mechanism.
Diffstat (limited to 'demux')
0 files changed, 0 insertions, 0 deletions