Skip to content

Commit

Permalink
command: print track metadata when changing track
Browse files Browse the repository at this point in the history
  • Loading branch information
guidocella authored and kasper93 committed Oct 24, 2024
1 parent f0a852c commit ef6eda3
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions player/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -1936,20 +1936,10 @@ static int property_switch_track(void *ctx, struct m_property *prop,
return M_PROPERTY_OK;
case M_PROPERTY_PRINT:
if (track) {
char *lang = track->lang;
if (!lang && type != STREAM_VIDEO) {
lang = "unknown";
} else if (!lang) {
lang = "";
}

if (track->title) {
*(char **)arg = talloc_asprintf(NULL, "(%d) %s (\"%s\")",
track->user_tid, lang, track->title);
} else {
*(char **)arg = talloc_asprintf(NULL, "(%d) %s",
track->user_tid, lang);
}
void *talloc_ctx = talloc_new(NULL);
*(char **)arg = talloc_asprintf(NULL, "(%d) %s", track->user_tid,
mp_format_track_metadata(talloc_ctx, track, true));
talloc_free(talloc_ctx);
} else {
const char *msg = "no";
if (!mpctx->playback_initialized &&
Expand Down

0 comments on commit ef6eda3

Please sign in to comment.