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

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

Closed
6 tasks done
guarapicci opened this issue May 29, 2024 · 1 comment
Closed
6 tasks done

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

guarapicci opened this issue May 29, 2024 · 1 comment
Labels

Comments

@guarapicci
Copy link

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

  • 1: First, make sure you have libmpv headers.
  • 2: Save this snippet to "showprogress.c":
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdlib.h>
#include <mpv/client.h>

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

Sample Files

No response

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

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • 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.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@Dudemanguy
Copy link
Member

Dudemanguy commented May 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants