From 51abb72b3ee56cbb73e4b051b9fcc1a9bdc1ae84 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 23 Sep 2003 17:53:22 +0000 Subject: [PATCH] Added a more verbose identifying mode for the GUI. --- src/mkvmerge.cpp | 7 +++++-- src/mkvmerge.h | 2 +- src/r_matroska.cpp | 17 ++++++++++++++--- src/r_vobsub.cpp | 16 ++++++++++++++-- 4 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/mkvmerge.cpp b/src/mkvmerge.cpp index b950cec26..bfc28453a 100644 --- a/src/mkvmerge.cpp +++ b/src/mkvmerge.cpp @@ -146,7 +146,7 @@ int split_max_num_files = 65535; float video_fps = -1.0; int default_tracks[3]; -bool identifying = false; +bool identifying = false, identify_verbose = false; char *dump_packets = NULL; @@ -1078,7 +1078,10 @@ static void parse_args(int argc, char **argv) { // Check if only information about the file is wanted. In this mode only // two parameters are allowed: the --identify switch and the file. if ((argc == 2) && - (!strcmp(argv[0], "-i") || !strcmp(argv[0], "--identify"))) { + (!strcmp(argv[0], "-i") || !strcmp(argv[0], "--identify") || + !strcmp(argv[0], "--identify-verbose"))) { + if (!strcmp(argv[0], "--identify-verbose")) + identify_verbose = true; identify(argv[1]); mxexit(); } diff --git a/src/mkvmerge.h b/src/mkvmerge.h index 08a5154fa..7961a0dab 100644 --- a/src/mkvmerge.h +++ b/src/mkvmerge.h @@ -53,7 +53,7 @@ extern float video_fps; extern bool write_cues, cue_writing_requested, video_track_present; extern bool no_lacing, no_linking; -extern bool identifying; +extern bool identifying, identify_verbose; extern char *dump_packets; diff --git a/src/r_matroska.cpp b/src/r_matroska.cpp index 5c0aa07a4..f0ad79898 100644 --- a/src/r_matroska.cpp +++ b/src/r_matroska.cpp @@ -1483,17 +1483,28 @@ void kax_reader_c::set_headers() { void kax_reader_c::identify() { int i; + string info; mxinfo("File '%s': container: Matroska\n", ti->fname); for (i = 0; i < tracks.size(); i++) - if (tracks[i]->ok) - mxinfo("Track ID %d: %s (%s%s%s)\n", tracks[i]->tnum, + if (tracks[i]->ok) { + if (identify_verbose) { + info = " ["; + if (tracks[i]->language != NULL) + info += string("language:") + string(tracks[i]->language) + + string(" "); + info += "]"; + } else + info = ""; + mxinfo("Track ID %d: %s (%s%s%s)%s\n", tracks[i]->tnum, tracks[i]->type == 'v' ? "video" : tracks[i]->type == 'a' ? "audio" : tracks[i]->type == 's' ? "subtitles" : "unknown", tracks[i]->codec_id, tracks[i]->ms_compat ? ", " : "", - tracks[i]->ms_compat ? tracks[i]->v_fourcc : ""); + tracks[i]->ms_compat ? tracks[i]->v_fourcc : "", + info.c_str()); + } for (i = 0; i < attachments.size(); i++) { mxinfo("Attachment ID %lld: type '%s', size %lld bytes, ", diff --git a/src/r_vobsub.cpp b/src/r_vobsub.cpp index e6d494790..53f4eae26 100644 --- a/src/r_vobsub.cpp +++ b/src/r_vobsub.cpp @@ -26,6 +26,7 @@ #include "common.h" #include "iso639.h" +#include "mkvmerge.h" #include "mm_io.h" #include "p_vobsub.h" #include "r_vobsub.h" @@ -338,10 +339,21 @@ void vobsub_reader_c::display_progress(bool final) { void vobsub_reader_c::identify() { uint32_t i; + string info; + const char *language; mxinfo("File '%s': container: VobSub\n", ti->fname); - for (i = 0; i < tracks.size(); i++) - mxinfo("Track ID %u: subtitles (VobSub)\n", i); + for (i = 0; i < tracks.size(); i++) { + if (identify_verbose) { + language = map_iso639_1_to_iso639_2(tracks[i]->language); + if (language != NULL) + info = " [language:" + string(language) + "]"; + else + info = ""; + } else + info = ""; + mxinfo("Track ID %u: subtitles (VobSub)%s\n", i, info.c_str()); + } } void vobsub_reader_c::set_headers() {