summaryrefslogtreecommitdiffstats
path: root/video/out/win32/droptarget.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit60e8a3d404f0640fa5a3f834eae54b4f1fb9127d (patch)
tree1da89a218d0ecf010c67a87cb2f625c4cb18e7d7 /video/out/win32/droptarget.c
parentAdding upstream version 0.37.0. (diff)
downloadmpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.tar.xz
mpv-60e8a3d404f0640fa5a3f834eae54b4f1fb9127d.zip
Adding upstream version 0.38.0.upstream/0.38.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'video/out/win32/droptarget.c')
-rw-r--r--video/out/win32/droptarget.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/win32/droptarget.c b/video/out/win32/droptarget.c
index 8a33522..fdf9c7a 100644
--- a/video/out/win32/droptarget.c
+++ b/video/out/win32/droptarget.c
@@ -18,6 +18,7 @@
#include <windows.h>
#include <ole2.h>
+#include <shellapi.h>
#include <shobjidl.h>
#include "common/msg.h"
@@ -156,8 +157,10 @@ static STDMETHODIMP DropTarget_Drop(IDropTarget *self, IDataObject *pDataObj,
wchar_t *buf = talloc_array(NULL, wchar_t, len + 1);
if (DragQueryFileW(drop, i, buf, len + 1) == len) {
- char *fname = mp_to_utf8(files, buf);
+ wchar_t *target = mp_w32_get_shell_link_target(buf);
+ char *fname = mp_to_utf8(files, target ? target : buf);
files[recvd_files++] = fname;
+ talloc_free(target);
MP_VERBOSE(t, "received dropped file: %s\n", fname);
} else {