From 8fa36ae09dddb1b639b4df5d505c0dbcf4e916e4 Mon Sep 17 00:00:00 2001 From: François Revol Date: Tue, 13 Feb 2007 18:26:14 +0000 Subject: This fixes error handling for BeOS, removing the need for some ifdefs. AVERROR_ defines are moved to avcodec.h as they are needed in there as well. Feel free to move that to avutil/common.h. Bumped up avcodec/format version numbers as though it's binary compatible we will want to rebuild apps as error values changed. Please from now on use return AVERROR(EFOO) instead of the ugly return -EFOO in your code. This also removes the need for berrno.h. Originally committed as revision 7965 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ffmpeg.c') diff --git a/ffmpeg.c b/ffmpeg.c index 238109d94c..a98c7e9b7d 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1797,12 +1797,12 @@ static int av_encode(AVFormatContext **output_files, int in_file_index = meta_data_maps[i].in_file; if ( out_file_index < 0 || out_file_index >= nb_output_files ) { fprintf(stderr, "Invalid output file index %d map_meta_data(%d,%d)\n", out_file_index, out_file_index, in_file_index); - ret = -EINVAL; + ret = AVERROR(EINVAL); goto fail; } if ( in_file_index < 0 || in_file_index >= nb_input_files ) { fprintf(stderr, "Invalid input file index %d map_meta_data(%d,%d)\n", in_file_index, out_file_index, in_file_index); - ret = -EINVAL; + ret = AVERROR(EINVAL); goto fail; } @@ -1824,7 +1824,7 @@ static int av_encode(AVFormatContext **output_files, os = output_files[i]; if (av_write_header(os) < 0) { fprintf(stderr, "Could not write header for output file #%d (incorrect codec parameters ?)\n", i); - ret = -EINVAL; + ret = AVERROR(EINVAL); goto fail; } } @@ -2027,7 +2027,7 @@ static int av_encode(AVFormatContext **output_files, } return ret; fail: - ret = -ENOMEM; + ret = AVERROR(ENOMEM); goto fail1; } -- cgit v1.2.3