From c58eb5b4a033b3d372e255b399b9b7b4bc1f8426 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 28 Jan 2010 09:29:33 +0100 Subject: [PATCH] Output error message if file cannot be parsed by the analyzer. --- ChangeLog | 7 +++++++ src/extract/attachments.cpp | 3 ++- src/extract/chapters.cpp | 3 ++- src/extract/cuesheets.cpp | 3 ++- src/extract/tags.cpp | 3 ++- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47e242062..24fe88839 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-01-28 Moritz Bunkus + + * mkvextract: bug fix: Modes 'attachments', 'chapters', 'tags' and + 'cuesheet': mkvextract will output an error message if the file + cannot be opened (e.g. because it does not exist or due to lack of + access). + 2010-01-24 Moritz Bunkus * mmg: enhancement: Changing the interface language does not diff --git a/src/extract/attachments.cpp b/src/extract/attachments.cpp index 0e21cf2e9..bc6663c58 100644 --- a/src/extract/attachments.cpp +++ b/src/extract/attachments.cpp @@ -113,7 +113,8 @@ extract_attachments(const std::string &file_name, // open input file try { analyzer = kax_analyzer_cptr(new kax_analyzer_c(file_name)); - analyzer->process(parse_mode); + if (!analyzer->process(parse_mode)) + throw false; } catch (...) { show_error(boost::format(Y("The file '%1%' could not be opened for reading (%2%).")) % file_name % strerror(errno)); return; diff --git a/src/extract/chapters.cpp b/src/extract/chapters.cpp index e58e4031d..9bbc278fd 100644 --- a/src/extract/chapters.cpp +++ b/src/extract/chapters.cpp @@ -46,7 +46,8 @@ extract_chapters(const std::string &file_name, // open input file try { analyzer = kax_analyzer_cptr(new kax_analyzer_c(file_name)); - analyzer->process(parse_mode); + if (!analyzer->process(parse_mode)) + throw false; } catch (...) { show_error(boost::format(Y("The file '%1%' could not be opened for reading (%2%).")) % file_name % strerror(errno)); return; diff --git a/src/extract/cuesheets.cpp b/src/extract/cuesheets.cpp index 34a05ee69..95d159c24 100644 --- a/src/extract/cuesheets.cpp +++ b/src/extract/cuesheets.cpp @@ -203,7 +203,8 @@ extract_cuesheet(const std::string &file_name, // open input file try { analyzer = kax_analyzer_cptr(new kax_analyzer_c(file_name)); - analyzer->process(parse_mode); + if (!analyzer->process(parse_mode)) + throw false; } catch (...) { show_error(boost::format(Y("The file '%1%' could not be opened for reading (%2%).")) % file_name % strerror(errno)); return; diff --git a/src/extract/tags.cpp b/src/extract/tags.cpp index 101ef8abc..5b1a047da 100644 --- a/src/extract/tags.cpp +++ b/src/extract/tags.cpp @@ -46,7 +46,8 @@ extract_tags(const std::string &file_name, // open input file try { analyzer = kax_analyzer_cptr(new kax_analyzer_c(file_name)); - analyzer->process(parse_mode); + if (!analyzer->process(parse_mode)) + throw false; } catch (...) { show_error(boost::format(Y("The file '%1%' could not be opened for reading (%2%).")) % file_name % strerror(errno)); return;