From 0c0c8cd44e42791b80e7de33b653aa9143865bbb Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 28 Apr 2015 22:04:37 +0200 Subject: 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. --- player/loadfile.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index c0888466e8..40ed71d5fd 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -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) { -- cgit v1.2.3