summaryrefslogtreecommitdiffstats
path: root/media/test/ffmpeg_tests
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/test/ffmpeg_tests
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/test/ffmpeg_tests')
-rw-r--r--media/test/ffmpeg_tests/ffmpeg_tests.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/media/test/ffmpeg_tests/ffmpeg_tests.cc b/media/test/ffmpeg_tests/ffmpeg_tests.cc
index b47c5d5..11fd9cc 100644
--- a/media/test/ffmpeg_tests/ffmpeg_tests.cc
+++ b/media/test/ffmpeg_tests/ffmpeg_tests.cc
@@ -122,9 +122,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;
}