Skip to content

libvlc_media_player_program_scrambled hangs if no program selected

In this API method in vlc/lib/media_player.c:

bool libvlc_media_player_program_scrambled(libvlc_media_player_t *p_mi)
{
    bool b_program_scrambled = false;

    vlc_player_t *player = p_mi->player;
    vlc_player_Lock(player);

    const struct vlc_player_program *program =
        vlc_player_GetSelectedProgram(player);
    if (!program)
        goto end;

    b_program_scrambled = program->scrambled;

    vlc_player_Unlock(player);
end:
    return b_program_scrambled;
}
  • The player is locked.
  • If there is no program selected, the goto jumps to the end of method, skipping the unlock call.
  • The subsequent code then hangs.

Moving the "end:" label prior to the unlock resolves the issue.

(For some reason I was unable to fork the repo, HTTP 409 error, otherwise I would have submitted a PR).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information