Added a more verbose identifying mode for the GUI.

This commit is contained in:
Moritz Bunkus 2003-09-23 17:53:22 +00:00
parent f26c12a55c
commit 51abb72b3e
4 changed files with 34 additions and 8 deletions

View File

@ -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();
}

View File

@ -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;

View File

@ -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, ",

View File

@ -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() {