mirror of
https://github.com/mpv-player/mpv
synced 2025-01-18 04:51:52 +00:00
codecs: mp_msg conversion
This commit is contained in:
parent
71b6a52295
commit
5f0fbacf16
@ -141,7 +141,7 @@ int audio_init_best_codec(struct dec_audio *d_audio, char *audio_decoders)
|
|||||||
struct mp_decoder_list *list =
|
struct mp_decoder_list *list =
|
||||||
audio_select_decoders(d_audio->header->codec, audio_decoders);
|
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++) {
|
for (int n = 0; n < list->num_entries; n++) {
|
||||||
struct mp_decoder_entry *sel = &list->entries[n];
|
struct mp_decoder_entry *sel = &list->entries[n];
|
||||||
|
@ -131,17 +131,17 @@ struct mp_decoder_list *mp_select_decoders(struct mp_decoder_list *all,
|
|||||||
return list;
|
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)
|
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++) {
|
for (int n = 0; n < list->num_entries; n++) {
|
||||||
struct mp_decoder_entry *entry = &list->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)
|
if (strcmp(entry->decoder, entry->codec) != 0)
|
||||||
mp_msg(msgt, msgl, " (%s)", entry->codec);
|
mp_msg_log(log, msgl, " (%s)", entry->codec);
|
||||||
mp_msg(msgt, msgl, " - %s\n", entry->desc);
|
mp_msg_log(log, msgl, " - %s\n", entry->desc);
|
||||||
}
|
}
|
||||||
if (list->num_entries == 0)
|
if (list->num_entries == 0)
|
||||||
mp_msg(msgt, msgl, " (no decoders)\n");
|
mp_msg_log(log, msgl, " (no decoders)\n");
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,8 @@ struct mp_decoder_list *mp_select_decoders(struct mp_decoder_list *all,
|
|||||||
const char *codec,
|
const char *codec,
|
||||||
const char *selection);
|
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);
|
struct mp_decoder_list *list);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -194,16 +194,17 @@ static MP_NORETURN void exit_player(struct MPContext *mpctx,
|
|||||||
static bool handle_help_options(struct MPContext *mpctx)
|
static bool handle_help_options(struct MPContext *mpctx)
|
||||||
{
|
{
|
||||||
struct MPOpts *opts = mpctx->opts;
|
struct MPOpts *opts = mpctx->opts;
|
||||||
|
struct mp_log *log = mpctx->log;
|
||||||
int opt_exit = 0;
|
int opt_exit = 0;
|
||||||
if (opts->audio_decoders && strcmp(opts->audio_decoders, "help") == 0) {
|
if (opts->audio_decoders && strcmp(opts->audio_decoders, "help") == 0) {
|
||||||
struct mp_decoder_list *list = audio_decoder_list();
|
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);
|
talloc_free(list);
|
||||||
opt_exit = 1;
|
opt_exit = 1;
|
||||||
}
|
}
|
||||||
if (opts->video_decoders && strcmp(opts->video_decoders, "help") == 0) {
|
if (opts->video_decoders && strcmp(opts->video_decoders, "help") == 0) {
|
||||||
struct mp_decoder_list *list = video_decoder_list();
|
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);
|
talloc_free(list);
|
||||||
opt_exit = 1;
|
opt_exit = 1;
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ bool video_init_best_codec(struct dec_video *d_video, char* video_decoders)
|
|||||||
struct mp_decoder_list *list =
|
struct mp_decoder_list *list =
|
||||||
mp_select_video_decoders(d_video->header->codec, video_decoders);
|
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++) {
|
for (int n = 0; n < list->num_entries; n++) {
|
||||||
struct mp_decoder_entry *sel = &list->entries[n];
|
struct mp_decoder_entry *sel = &list->entries[n];
|
||||||
|
Loading…
Reference in New Issue
Block a user