mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.71k stars 2.84k forks source link

plugin API: command_async("show-progress") doesn't work #14258

Closed guarapicci closed 1 month ago

guarapicci commented 1 month ago

mpv Information

mpv 0.34.1 Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
FFmpeg library versions:
   libavutil       56.70.100
   libavcodec      58.134.100
   libavformat     58.76.100
   libswscale      5.9.100
   libavfilter     7.110.100
   libswresample   3.9.100
FFmpeg version: 4.4.2-0ubuntu0.22.04.1

Other Information

running on Ubuntu 22.04 with KDE Plasma 5.24.

note: the same command works if you pipe it via socket.

Reproduction Steps

struct state { mpv_handle *mpv; };

int mpv_open_cplugin(mpv_handle handle){ mpv_event event = mpv_wait_event(handle, -1); sleep(2); printf("will run show-progress\n"); const char cmd_show_progress[2] = {"show-progress", NULL}; mpv_command_async(handle, 200, cmd_show_progress); while (1){ mpv_event event = mpv_wait_event(handle, -1); int exit = 0;

    // printf("stepping through touchpad state machine\n");

    switch(event->event_id){
        case MPV_EVENT_SHUTDOWN:
            return 0;
        case MPV_EVENT_COMMAND_REPLY:

    }
    // usleep(4);
}
return 0;

}

- 3: open a console at the folder and run this :

install showprogress.so to plugins folder

gcc -o ~/.config/mpv/scripts/progress.so showprogress.c -shared -fPIC


 - 4: on the same console, run `mpv $MEDIAFILE`,  replacing `$MEDIAFILE` with a path to a playable video.

### Expected Behavior

mpv plays file for 2 seconds, then prints ` will run show progress` on console output, then shows HUD with progress bar.

### Actual Behavior

mpv plays file for 2 seconds, then prints ` will run show progress` on console output, then continues playing without displaying the HUD.

### Log File

[output.txt](https://github.com/mpv-player/mpv/files/15491017/output.txt)

### Sample Files

_No response_

### I carefully read all instruction and confirm that I did the following:

- [X] I tested with the latest mpv version to validate that the issue is not already fixed.
- [X] I provided all required information including system and mpv version.
- [X] I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of `--log-file=output.txt`.
- [X] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
- [X] I attached the full, untruncated log file.
- [X] I attached the backtrace in the case of a crash.
Dudemanguy commented 1 month ago

0.34.1 is outdated and not supported. This was fixed by 5c2051b1adbfdf476df5e57080ea0ea79abee1a7. You can workaround this by using the osd-auto prefix for the command.