summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_osx.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-12-02 03:58:04 +0100
committerwm4 <wm4@nowhere>2017-12-02 04:53:51 +0100
commit0780d3832997056b581cdecb29e605132fae9417 (patch)
tree340313db84f48ed4d7f43a7601cfc27e4f7347a8 /video/out/opengl/hwdec_osx.c
parent8b3dbab19eafee2da3685bb0a8550db448fad757 (diff)
downloadmpv-0780d3832997056b581cdecb29e605132fae9417.tar.bz2
mpv-0780d3832997056b581cdecb29e605132fae9417.tar.xz
hwdec: don't require setting legacy hwdec fields
With the recent changes, mpv's internal mechanisms got synced to libavcodec's once more. Some things are still needed for filters (until the mechanism gets replaced), but there's no need to require other hwdec methods to use these fields. So remove them where they are unnecessary. Also fix some minor leaks in the dxva2 backends, and set the driver_name field in the Apple ones. Untested on Apple crap.
Diffstat (limited to 'video/out/opengl/hwdec_osx.c')
-rw-r--r--video/out/opengl/hwdec_osx.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/video/out/opengl/hwdec_osx.c b/video/out/opengl/hwdec_osx.c
index 9980e8483b..ca7a0049c2 100644
--- a/video/out/opengl/hwdec_osx.c
+++ b/video/out/opengl/hwdec_osx.c
@@ -70,8 +70,7 @@ static int init(struct ra_hwdec *hw)
return -1;
p->hwctx = (struct mp_hwdec_ctx){
- .type = HWDEC_VIDEOTOOLBOX,
- .ctx = &p->hwctx,
+ .driver_name = hw->driver->name,
};
av_hwdevice_ctx_create(&p->hwctx.av_device_ref, AV_HWDEVICE_TYPE_VIDEOTOOLBOX,
@@ -86,8 +85,7 @@ static void uninit(struct ra_hwdec *hw)
{
struct priv_owner *p = hw->priv;
- if (p->hwctx.ctx)
- hwdec_devices_remove(hw->devs, &p->hwctx);
+ hwdec_devices_remove(hw->devs, &p->hwctx);
av_buffer_unref(&p->hwctx.av_device_ref);
}