nik012003 / ripdrag

Drag and Drop utilty written in Rust and GTK4
GNU General Public License v3.0
496 stars 17 forks source link

Can't use with `mpv` #38

Closed kohane27 closed 9 months ago

kohane27 commented 9 months ago

Hello there. Hope you're doing well. Thank you for creating this modern version of dragon!

Description

I tried to use ripdrag to drag subtitle to mpv, but it'd kill mpv and the ripdrag's window would stay remain. The same workflow works with dragon.

Reproducible steps

  1. list current directory structure:
➜ ls
sample.mkv  sample.srt
  1. run mpv sample.mkv:
➜ mpv sample.mkv
   cplayer:  (+) Video --vid=1 (*) (hevc 1280x718 23.976fps)
   cplayer:  (+) Audio --aid=1 --alang=eng (*) (ac3 6ch 48000Hz)
   cplayer:      Subs  --sid=1 '21.srt' (subrip) (external)
Cannot load libcuda.so.1
    ffmpeg: AVHWDeviceContext: Cannot load libcuda.so.1
    ffmpeg: AVHWDeviceContext: Could not dynamically load CUDA
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
Cannot load libcuda.so.1
    ffmpeg: AVHWDeviceContext: Cannot load libcuda.so.1
    ffmpeg: AVHWDeviceContext: Could not dynamically load CUDA
ffmpeg/video: hevc_v4l2m2m: Could not find a valid device
ffmpeg/video: hevc_v4l2m2m: can't configure decoder
        vd: Could not open codec.
ao/pipewire: The --audio-stream-silence option is set. This will break certain player behavior.
   cplayer: AO: [pipewire] 48000Hz 5.1(side) 6ch floatp
   cplayer: VO: [gpu] 1280x718 yuv420p10
statusline: (Paused) AV: 00:00:18 / 00:23:22 (1%) x1.80 A-V:  0.000
  1. ripdrag --verbose sample.srt

  2. drag ripdrag's window to mpv

  3. mpv is killed and ripdrag's window persists

Error from mpv:

statusline: (Paused) AV: 00:00:18 / 00:23:22 (1%) x1.80 A-V:  0.000
      file: Cannot open file '': No such file or directory
    stream: Failed to open .
   cplayer:
statusline: (Paused) AV: 00:00:18 / 00:23:22 (1%) x1.80 A-V:  0.000
   cplayer:      Subs  --sid=1 (subrip)
   cplayer: No video or audio streams selected.
   cplayer:
   cplayer: Exiting... (Some errors happened)

Version

Linux 6.1.62-1-lts mpv 0.36.0 ripdrag 0.4.4

Thank you in advance!

nik012003 commented 9 months ago

Hi, thank you for the report! I was able to reproduce it and I started looking into it. The problem is probably due to how mpv checks if the dropped file is a subtitle ( https://github.com/mpv-player/mpv/blob/master/player/external_files.c#L57 ) I don't have much time to spend on it right now, but I'll try to fix it in the weekend

EDIT: I got nerdsniped, I'll push the fix in a few minutes ahah

kohane27 commented 9 months ago

Confirmed it's working. Thank you so much for such a quick reply and fix!