mirror of
https://github.com/mpv-player/mpv
synced 2025-01-13 10:26:09 +00:00
player: log track list when adding or removing external files
Should help with debugging, and might be slightly more userfriendly. Note that this is called manually in multiple entry-points, instead of the functions doing the actual work (like mp_remove_track()). This is done so that exiting the player or calling the sub_reload command won't print redundant in-between states.
This commit is contained in:
parent
0ff93a8357
commit
0c0c8cd44e
@ -4530,6 +4530,7 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
|
||||
char *lang = cmd->args[3].v.s;
|
||||
if (lang && lang[0])
|
||||
t->lang = talloc_strdup(t, lang);
|
||||
print_track_list(mpctx);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -4540,6 +4541,7 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
|
||||
if (!t)
|
||||
return -1;
|
||||
mp_remove_track(mpctx, t);
|
||||
print_track_list(mpctx);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -4553,6 +4555,7 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
|
||||
if (nt) {
|
||||
mp_remove_track(mpctx, t);
|
||||
mp_switch_track(mpctx, nt->type, nt);
|
||||
print_track_list(mpctx);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -4573,6 +4576,8 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re
|
||||
opts->sub_id_ff, opts->sub_lang);
|
||||
if (s && s->is_external)
|
||||
mp_switch_track(mpctx, STREAM_SUB, s);
|
||||
|
||||
print_track_list(mpctx);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -396,6 +396,7 @@ struct playlist_entry *mp_next_file(struct MPContext *mpctx, int direction,
|
||||
void mp_set_playlist_entry(struct MPContext *mpctx, struct playlist_entry *e);
|
||||
void mp_play_files(struct MPContext *mpctx);
|
||||
void update_demuxer_properties(struct MPContext *mpctx);
|
||||
void print_track_list(struct MPContext *mpctx);
|
||||
void reselect_demux_streams(struct MPContext *mpctx);
|
||||
void prepare_playlist(struct MPContext *mpctx, struct playlist *pl);
|
||||
void autoload_external_files(struct MPContext *mpctx);
|
||||
|
@ -143,6 +143,15 @@ static void print_stream(struct MPContext *mpctx, struct track *t)
|
||||
MP_INFO(mpctx, "%s\n", b);
|
||||
}
|
||||
|
||||
void print_track_list(struct MPContext *mpctx)
|
||||
{
|
||||
for (int t = 0; t < STREAM_TYPE_COUNT; t++) {
|
||||
for (int n = 0; n < mpctx->num_tracks; n++)
|
||||
if (mpctx->tracks[n]->type == t)
|
||||
print_stream(mpctx, mpctx->tracks[n]);
|
||||
}
|
||||
}
|
||||
|
||||
void update_demuxer_properties(struct MPContext *mpctx)
|
||||
{
|
||||
struct demuxer *demuxer = mpctx->master_demuxer;
|
||||
@ -167,11 +176,7 @@ void update_demuxer_properties(struct MPContext *mpctx)
|
||||
struct demuxer *tracks = mpctx->track_layout;
|
||||
if (tracks->events & DEMUX_EVENT_STREAMS) {
|
||||
add_demuxer_tracks(mpctx, tracks);
|
||||
for (int t = 0; t < STREAM_TYPE_COUNT; t++) {
|
||||
for (int n = 0; n < mpctx->num_tracks; n++)
|
||||
if (mpctx->tracks[n]->type == t)
|
||||
print_stream(mpctx, mpctx->tracks[n]);
|
||||
}
|
||||
print_track_list(mpctx);
|
||||
tracks->events &= ~DEMUX_EVENT_STREAMS;
|
||||
}
|
||||
if (events & DEMUX_EVENT_METADATA) {
|
||||
|
Loading…
Reference in New Issue
Block a user