Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serious memory leak wich lavfi-complex + "audio-device=alsa/unexistant_audio_device" #4118

Closed
kokoko3k opened this issue Feb 7, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@kokoko3k
Copy link

commented Feb 7, 2017

mpv version and platform

mpv 0.23.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
built on Sun Jan 8 00:53:48 CET 2017
ffmpeg library versions:
libavutil 55.34.100
libavcodec 57.64.101
libavformat 57.56.100
libswscale 4.2.100
libavfilter 6.65.100
libswresample 2.3.100
ffmpeg version: 3.2.2

Reproduction steps

 mpv  /mnt/nas.crypt/Musica/Kim\ Carnes\ -\ Bette\ Davis\ Eyes.mp3 --audio-device=typo --lavfi-complex='[aid1]asplit=3 [azero][auno][ao];[azero]showspectrum=mode=separate:color=intensity:slide=scroll:s=4x512:color=intensity:win_func=blackman:mode=combined:saturation=1,crop=h=(in_h/1.5):y=in_h,scale=h=512:w=512:force_original_aspect_ratio=disable[spectrum];[auno]showwaves=s=512x512:mode=line:r=20,crop=h=(ih/2):y=(0),crop=h=(ih/2):y=ih,colorlevels=romax=0.5:bomin=1:gomin=1[waves];[spectrum][waves]overlay[vo]' --ao=alsa --audio-device=alsa/typo

Expected behavior

mpv to play the music without sound.

Actual behavior

mpv does play, but memory increases really fast.
In a matter of 20 seconds my system starts to swap, 8GB filled.

Log file

http://pastebin.com/47bSys6r

Sample files

https://0x0.st/WL2.mp3

@wm4 wm4 closed this in 0983f9a Feb 8, 2017

wm4 pushed a commit that referenced this issue Feb 8, 2017

wm4
lavfi: slightly better disconnected output handling
If we have a disconnected output, read data only passively (and don't
cause input to be written). Otherwise, we're in danger of making
libavfilter queue too many frames on other outputs which are connected
to the same input, but don't read as quickly.

Also don't set pad->output_needed in this specific case, because it
would nonsensically make lavfi_process() return true, even if nothing is
going on.

This commit breaks if there is a simple filter chain with a connected
input, but a disconnected output, like

   --lavfi-complex='[aid1] copy [ao]'

and the audio output didn't initialize correctly. This will eventually
starve video as the audio packet queue get full (it will print a
warning, and then assume video EOF and exit).

But whatever.

Probably fixes #4118.
@kokoko3k

This comment has been minimized.

Copy link
Author

commented Feb 9, 2017

Confirmed fixed, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.