summaryrefslogtreecommitdiffstats
path: root/media/tools/media_bench/media_bench.cc
diff options
context:
space:
mode:
authorfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 01:19:05 +0000
committerfbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-03 01:19:05 +0000
commitb89f293f5159e1adb76355ce8f6078ff76aa062e (patch)
treeeff350626757af7fde85c561c223248efd656811 /media/tools/media_bench/media_bench.cc
parentd87395d59ef04bf0182f6d957c2622b25fb37152 (diff)
downloadchromium_src-b89f293f5159e1adb76355ce8f6078ff76aa062e.zip
chromium_src-b89f293f5159e1adb76355ce8f6078ff76aa062e.tar.gz
chromium_src-b89f293f5159e1adb76355ce8f6078ff76aa062e.tar.bz2
ffmpeg better message for error on opening file if the file opens but the codec is not supported.
BUG=37256 TEST=ffmpeg_tests.exe d:\mediatests\elephant2.m4v with chromium and you should get 'File format not supported' Review URL: http://codereview.chromium.org/661426 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40472 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/tools/media_bench/media_bench.cc')
-rw-r--r--media/tools/media_bench/media_bench.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/media/tools/media_bench/media_bench.cc b/media/tools/media_bench/media_bench.cc
index 5e1b844..57217dc 100644
--- a/media/tools/media_bench/media_bench.cc
+++ b/media/tools/media_bench/media_bench.cc
@@ -212,9 +212,19 @@ int main(int argc, const char** argv) {
av_register_all();
av_register_protocol(&kFFmpegFileProtocol);
AVFormatContext* format_context = NULL;
- if (av_open_input_file(&format_context, in_path.c_str(), NULL, 0, NULL) < 0) {
- std::cerr << "Error: Could not open input for "
- << in_path << std::endl;
+ int result = av_open_input_file(&format_context, in_path.c_str(),
+ NULL, 0, NULL);
+ if (result < 0) {
+ switch (result) {
+ case AVERROR_NOFMT:
+ std::cerr << "Error: File format not supported "
+ << in_path << std::endl;
+ break;
+ default:
+ std::cerr << "Error: Could not open input for "
+ << in_path << std::endl;
+ break;
+ }
return 1;
}