diff --git a/audio/decode/dec_audio.c b/audio/decode/dec_audio.c index ae3c72d7aa..ad9ccb504e 100644 --- a/audio/decode/dec_audio.c +++ b/audio/decode/dec_audio.c @@ -141,7 +141,7 @@ int audio_init_best_codec(struct dec_audio *d_audio, char *audio_decoders) struct mp_decoder_list *list = audio_select_decoders(d_audio->header->codec, audio_decoders); - mp_print_decoders(MSGT_DECAUDIO, MSGL_V, "Codec list:", list); + mp_print_decoders(d_audio->log, MSGL_V, "Codec list:", list); for (int n = 0; n < list->num_entries; n++) { struct mp_decoder_entry *sel = &list->entries[n]; diff --git a/common/codecs.c b/common/codecs.c index b7639a4576..55e2bdf344 100644 --- a/common/codecs.c +++ b/common/codecs.c @@ -131,17 +131,17 @@ struct mp_decoder_list *mp_select_decoders(struct mp_decoder_list *all, return list; } -void mp_print_decoders(int msgt, int msgl, const char *header, +void mp_print_decoders(struct mp_log *log, int msgl, const char *header, struct mp_decoder_list *list) { - mp_msg(msgt, msgl, "%s\n", header); + mp_msg_log(log, msgl, "%s\n", header); for (int n = 0; n < list->num_entries; n++) { struct mp_decoder_entry *entry = &list->entries[n]; - mp_msg(msgt, msgl, " %s:%s", entry->family, entry->decoder); + mp_msg_log(log, msgl, " %s:%s", entry->family, entry->decoder); if (strcmp(entry->decoder, entry->codec) != 0) - mp_msg(msgt, msgl, " (%s)", entry->codec); - mp_msg(msgt, msgl, " - %s\n", entry->desc); + mp_msg_log(log, msgl, " (%s)", entry->codec); + mp_msg_log(log, msgl, " - %s\n", entry->desc); } if (list->num_entries == 0) - mp_msg(msgt, msgl, " (no decoders)\n"); + mp_msg_log(log, msgl, " (no decoders)\n"); } diff --git a/common/codecs.h b/common/codecs.h index 21ff284617..105aab5a82 100644 --- a/common/codecs.h +++ b/common/codecs.h @@ -37,7 +37,8 @@ struct mp_decoder_list *mp_select_decoders(struct mp_decoder_list *all, const char *codec, const char *selection); -void mp_print_decoders(int msgt, int msgl, const char *header, +struct mp_log; +void mp_print_decoders(struct mp_log *log, int msgl, const char *header, struct mp_decoder_list *list); #endif diff --git a/player/main.c b/player/main.c index ab3e7b93f9..0cf0a1a447 100644 --- a/player/main.c +++ b/player/main.c @@ -194,16 +194,17 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx, static bool handle_help_options(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; + struct mp_log *log = mpctx->log; int opt_exit = 0; if (opts->audio_decoders && strcmp(opts->audio_decoders, "help") == 0) { struct mp_decoder_list *list = audio_decoder_list(); - mp_print_decoders(MSGT_CPLAYER, MSGL_INFO, "Audio decoders:", list); + mp_print_decoders(log, MSGL_INFO, "Audio decoders:", list); talloc_free(list); opt_exit = 1; } if (opts->video_decoders && strcmp(opts->video_decoders, "help") == 0) { struct mp_decoder_list *list = video_decoder_list(); - mp_print_decoders(MSGT_CPLAYER, MSGL_INFO, "Video decoders:", list); + mp_print_decoders(log, MSGL_INFO, "Video decoders:", list); talloc_free(list); opt_exit = 1; } diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index bfd2d84ab4..09bbd243c9 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -172,7 +172,7 @@ bool video_init_best_codec(struct dec_video *d_video, char* video_decoders) struct mp_decoder_list *list = mp_select_video_decoders(d_video->header->codec, video_decoders); - mp_print_decoders(MSGT_DECVIDEO, MSGL_V, "Codec list:", list); + mp_print_decoders(d_video->log, MSGL_V, "Codec list:", list); for (int n = 0; n < list->num_entries; n++) { struct mp_decoder_entry *sel = &list->entries[n];