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

Changing hwdec auto-copy->no->auto-copy during playback results in crash #3788

Closed
pavelxdd opened this issue Nov 10, 2016 · 2 comments
Closed

Comments

@pavelxdd
Copy link
Contributor

pavelxdd commented Nov 10, 2016

mpv version and platform

Arch x64, NVIDIA proprietary driver, vdpau hwdec

mpv git-fc1017c (C) 2000-2016 mpv/MPlayer/mplayer2 projects
 built on Thu Nov 10 05:18:28 MSK 2016
ffmpeg library versions:
   libavutil       55.34.100
   libavcodec      57.64.100
   libavformat     57.56.100
   libswscale      4.2.100
   libavfilter     6.65.100
   libswresample   2.3.100
ffmpeg version: 3.2

Reproduction steps

Start a video with hardware acceleration:
mpv a.mkv --no-config --hwdec=auto-copy
Change hwdec to "no" during playback (via hotkey or lua script)
F3 cycle-values hwdec no auto-copy
Change hwdec back to auto-copy.

Expected behavior

mpv shouldn't crash on changing hwdec.

Actual behavior

mpv crashes with the message in console:

mpv: ../video/decode/vdpau.c:148: probe_copy: Assertion `!ctx->hwdec_priv' failed.
Aborted (core dumped)

If start the video with hwdec=no and change in to auto-copy during playback it won't crash. It crashes only after hwdec->no-hwdec->hwdec.
Also auto (without -copy)->no->auto doesn't crash mpv. So it only happens with auto-copy.

I tried both opengl-backends x11 and x11egl, it doesn't matter which of them I use, mpv always crashes.

Log file

It's the full log: log.txt

@haasn
Copy link
Member

haasn commented Nov 10, 2016

Does this patch help?

diff --git a/video/decode/vdpau.c b/video/decode/vdpau.c
index a86f5d1..8a1ef96 100644
--- a/video/decode/vdpau.c
+++ b/video/decode/vdpau.c
@@ -87,6 +87,7 @@ static void uninit(struct lavc_ctx *ctx)
     }

     talloc_free(p);
+    ctx->hwdec_priv = NULL;

     if (ctx->avctx)
         av_freep(&ctx->avctx->hwaccel_context);

@pavelxdd
Copy link
Contributor Author

@haasn, yes - it doesn't crash anymore and changes hwdec correctly.

@ghost ghost closed this as completed in ca17587 Nov 10, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants