History

Do not leave positive values undefined when negative are defined as error

Define positive return values as non errors and leave further meaning undefined This allows future extensions to use these values

Michael Niedermayer committed 13 years ago

Commit d5ec8ba1 parent a63886118 files · +30 −30Browse files

Unified · Split

18 files
  1. cmdutils.h +1 −1
  2. libavcodec/iff.c +1 −1
  3. libavcodec/version.h +1 −1
  4. libavcodec/wmaprodec.c +1 −1
  5. libavfilter/avcodec.h +3 −3
  6. libavfilter/avfilter.h +1 −1
  7. libavfilter/avfiltergraph.c +2 −2
  8. libavfilter/graphparser.c +2 −2
  9. libavfilter/internal.h +5 −5
  10. libavfilter/lavfutils.h +1 −1
  11. libavfilter/version.h +1 −1
  12. libavformat/avio.h +2 −2
  13. libavformat/avio_internal.h +2 −2
  14. libavformat/url.h +2 −2
  15. libavformat/version.h +1 −1
  16. libavutil/eval.h +2 −2
  17. libavutil/parseutils.h +1 −1
  18. libavutil/version.h +1 −1
cmdutils.h+1−1
@@ -498,7 +498,7 @@ int read_yesno(void); · 497 unmodified lines
498 * @param filename file to read from498 * @param filename file to read from
499 * @param bufptr location where pointer to buffer is returned499 * @param bufptr location where pointer to buffer is returned
500 * @param size location where size of buffer is returned500 * @param size location where size of buffer is returned
501 * @return 0 in case of success, a negative value corresponding to an501 * @return >= 0 in case of success, a negative value corresponding to an
502 * AVERROR error code in case of failure.502 * AVERROR error code in case of failure.
503 */503 */
504int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);504int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
libavcodec/iff.c+1−1
@@ -184,7 +184,7 @@ static int cmap_read_palette(AVCodecContext *avctx, uint32_t *pal) · 183 unmodified lines
184 *184 *
185 * @param avctx the AVCodecContext where to extract extra context to185 * @param avctx the AVCodecContext where to extract extra context to
186 * @param avpkt the AVPacket to extract extra context from or NULL to use avctx186 * @param avpkt the AVPacket to extract extra context from or NULL to use avctx
187 * @return 0 in case of success, a negative error code otherwise187 * @return >= 0 in case of success, a negative error code otherwise
188 */188 */
189static int extract_header(AVCodecContext *const avctx,189static int extract_header(AVCodecContext *const avctx,
190 const AVPacket *const avpkt) {190 const AVPacket *const avpkt) {
libavcodec/version.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
30 30
31#define LIBAVCODEC_VERSION_MAJOR 5531#define LIBAVCODEC_VERSION_MAJOR 55
32#define LIBAVCODEC_VERSION_MINOR 3732#define LIBAVCODEC_VERSION_MINOR 37
33#define LIBAVCODEC_VERSION_MICRO 10133#define LIBAVCODEC_VERSION_MICRO 102
34 34
35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
36 LIBAVCODEC_VERSION_MINOR, \36 LIBAVCODEC_VERSION_MINOR, \
libavcodec/wmaprodec.c+1−1
@@ -681,7 +681,7 @@ static void decode_decorrelation_matrix(WMAProDecodeCtx *s, · 680 unmodified lines
681/**681/**
682 *@brief Decode channel transformation parameters682 *@brief Decode channel transformation parameters
683 *@param s codec context683 *@param s codec context
684 *@return 0 in case of success, < 0 in case of bitstream errors684 *@return >= 0 in case of success, < 0 in case of bitstream errors
685 */685 */
686static int decode_channel_transform(WMAProDecodeCtx* s)686static int decode_channel_transform(WMAProDecodeCtx* s)
687{687{
libavfilter/avcodec.h+3−3
@@ -72,7 +72,7 @@ AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type, · 71 unmodified lines
72 *72 *
73 * @param frame an already allocated AVFrame73 * @param frame an already allocated AVFrame
74 * @param samplesref an audio buffer reference74 * @param samplesref an audio buffer reference
75 * @return 0 in case of success, a negative AVERROR code in case of75 * @return >= 0 in case of success, a negative AVERROR code in case of
76 * failure76 * failure
77 * @deprecated Use avfilter_copy_buf_props() instead.77 * @deprecated Use avfilter_copy_buf_props() instead.
78 */78 */
@@ -85,7 +85,7 @@ int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame, · 6 unmodified lines
85 *85 *
86 * @param frame an already allocated AVFrame86 * @param frame an already allocated AVFrame
87 * @param picref a video buffer reference87 * @param picref a video buffer reference
88 * @return 0 in case of success, a negative AVERROR code in case of88 * @return >= 0 in case of success, a negative AVERROR code in case of
89 * failure89 * failure
90 * @deprecated Use avfilter_copy_buf_props() instead.90 * @deprecated Use avfilter_copy_buf_props() instead.
91 */91 */
@@ -98,7 +98,7 @@ int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame, · 6 unmodified lines
98 *98 *
99 * @param frame an already allocated AVFrame99 * @param frame an already allocated AVFrame
100 * @param ref a video or audio buffer reference100 * @param ref a video or audio buffer reference
101 * @return 0 in case of success, a negative AVERROR code in case of101 * @return >= 0 in case of success, a negative AVERROR code in case of
102 * failure102 * failure
103 * @deprecated Use avfilter_copy_buf_props() instead.103 * @deprecated Use avfilter_copy_buf_props() instead.
104 */104 */
libavfilter/avfilter.h+1−1
@@ -1316,7 +1316,7 @@ enum { · 1315 unmodified lines
1316 *1316 *
1317 * @param graphctx the filter graph1317 * @param graphctx the filter graph
1318 * @param log_ctx context used for logging1318 * @param log_ctx context used for logging
1319 * @return 0 in case of success, a negative AVERROR code otherwise1319 * @return >= 0 in case of success, a negative AVERROR code otherwise
1320 */1320 */
1321int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx);1321int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx);
1322 1322
libavfilter/avfiltergraph.c+2−2
@@ -224,7 +224,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 223 unmodified lines
224 * A graph is considered valid if all its input and output pads are224 * A graph is considered valid if all its input and output pads are
225 * connected.225 * connected.
226 *226 *
227 * @return 0 in case of success, a negative value otherwise227 * @return >= 0 in case of success, a negative value otherwise
228 */228 */
229static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx)229static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx)
230{230{
@@ -262,7 +262,7 @@ static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx) · 31 unmodified lines
262/**262/**
263 * Configure all the links of graphctx.263 * Configure all the links of graphctx.
264 *264 *
265 * @return 0 in case of success, a negative value otherwise265 * @return >= 0 in case of success, a negative value otherwise
266 */266 */
267static int graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)267static int graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)
268{268{
libavfilter/graphparser.c+2−2
@@ -89,7 +89,7 @@ static char *parse_link_name(const char **buf, void *log_ctx) · 88 unmodified lines
89 * @param filt_name the name of the filter to create89 * @param filt_name the name of the filter to create
90 * @param args the arguments provided to the filter during its initialization90 * @param args the arguments provided to the filter during its initialization
91 * @param log_ctx the log context to use91 * @param log_ctx the log context to use
92 * @return 0 in case of success, a negative AVERROR code otherwise92 * @return >= 0 in case of success, a negative AVERROR code otherwise
93 */93 */
94static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index,94static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index,
95 const char *filt_name, const char *args, void *log_ctx)95 const char *filt_name, const char *args, void *log_ctx)
@@ -152,7 +152,7 @@ static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int ind · 56 unmodified lines
152 * @param index an index which is assigned to the created filter152 * @param index an index which is assigned to the created filter
153 * instance, and which is supposed to be unique for each filter153 * instance, and which is supposed to be unique for each filter
154 * instance added to the filtergraph154 * instance added to the filtergraph
155 * @return 0 in case of success, a negative AVERROR code otherwise155 * @return >= 0 in case of success, a negative AVERROR code otherwise
156 */156 */
157static int parse_filter(AVFilterContext **filt_ctx, const char **buf, AVFilterGraph *graph,157static int parse_filter(AVFilterContext **filt_ctx, const char **buf, AVFilterGraph *graph,
158 int index, void *log_ctx)158 int index, void *log_ctx)
libavfilter/internal.h+5−5
@@ -169,7 +169,7 @@ int ff_fmt_is_in(int fmt, const int *fmts); · 168 unmodified lines
169 * @param ret pixel format pointer to where the value should be written169 * @param ret pixel format pointer to where the value should be written
170 * @param arg string to parse170 * @param arg string to parse
171 * @param log_ctx log context171 * @param log_ctx log context
172 * @return 0 in case of success, a negative AVERROR code on error172 * @return >= 0 in case of success, a negative AVERROR code on error
173 */173 */
174int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ctx);174int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ctx);
175 175
@@ -179,7 +179,7 @@ int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ct · 3 unmodified lines
179 * @param ret unsigned integer pointer to where the value should be written179 * @param ret unsigned integer pointer to where the value should be written
180 * @param arg string to parse180 * @param arg string to parse
181 * @param log_ctx log context181 * @param log_ctx log context
182 * @return 0 in case of success, a negative AVERROR code on error182 * @return >= 0 in case of success, a negative AVERROR code on error
183 */183 */
184int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx);184int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx);
185 185
@@ -189,7 +189,7 @@ int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx); · 3 unmodified lines
189 * @param ret unsigned AVRational pointer to where the value should be written189 * @param ret unsigned AVRational pointer to where the value should be written
190 * @param arg string to parse190 * @param arg string to parse
191 * @param log_ctx log context191 * @param log_ctx log context
192 * @return 0 in case of success, a negative AVERROR code on error192 * @return >= 0 in case of success, a negative AVERROR code on error
193 */193 */
194int ff_parse_time_base(AVRational *ret, const char *arg, void *log_ctx);194int ff_parse_time_base(AVRational *ret, const char *arg, void *log_ctx);
195 195
@@ -199,7 +199,7 @@ int ff_parse_time_base(AVRational *ret, const char *arg, void *log_ctx); · 3 unmodified lines
199 * @param ret integer pointer to where the value should be written199 * @param ret integer pointer to where the value should be written
200 * @param arg string to parse200 * @param arg string to parse
201 * @param log_ctx log context201 * @param log_ctx log context
202 * @return 0 in case of success, a negative AVERROR code on error202 * @return >= 0 in case of success, a negative AVERROR code on error
203 */203 */
204int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx);204int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx);
205 205
@@ -209,7 +209,7 @@ int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx); · 3 unmodified lines
209 * @param ret 64bit integer pointer to where the value should be written.209 * @param ret 64bit integer pointer to where the value should be written.
210 * @param arg string to parse210 * @param arg string to parse
211 * @param log_ctx log context211 * @param log_ctx log context
212 * @return 0 in case of success, a negative AVERROR code on error212 * @return >= 0 in case of success, a negative AVERROR code on error
213 */213 */
214int ff_parse_channel_layout(int64_t *ret, const char *arg, void *log_ctx);214int ff_parse_channel_layout(int64_t *ret, const char *arg, void *log_ctx);
215 215
libavfilter/lavfutils.h+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
34 * @param pix_fmt pointer to the pixel format of the loaded image34 * @param pix_fmt pointer to the pixel format of the loaded image
35 * @param filename the name of the image file to load35 * @param filename the name of the image file to load
36 * @param log_ctx log context36 * @param log_ctx log context
37 * @return 0 in case of success, a negative error code otherwise.37 * @return >= 0 in case of success, a negative error code otherwise.
38 */38 */
39int ff_load_image(uint8_t *data[4], int linesize[4],39int ff_load_image(uint8_t *data[4], int linesize[4],
40 int *w, int *h, enum AVPixelFormat *pix_fmt,40 int *w, int *h, enum AVPixelFormat *pix_fmt,
libavfilter/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31 31
32#define LIBAVFILTER_VERSION_MAJOR 332#define LIBAVFILTER_VERSION_MAJOR 3
33#define LIBAVFILTER_VERSION_MINOR 8833#define LIBAVFILTER_VERSION_MINOR 88
34#define LIBAVFILTER_VERSION_MICRO 10134#define LIBAVFILTER_VERSION_MICRO 102
35 35
36#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \36#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
37 LIBAVFILTER_VERSION_MINOR, \37 LIBAVFILTER_VERSION_MINOR, \
libavformat/avio.h+2−2
@@ -368,7 +368,7 @@ int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen); · 367 unmodified lines
368 * In case of failure the pointed to value is set to NULL.368 * In case of failure the pointed to value is set to NULL.
369 * @param flags flags which control how the resource indicated by url369 * @param flags flags which control how the resource indicated by url
370 * is to be opened370 * is to be opened
371 * @return 0 in case of success, a negative value corresponding to an371 * @return >= 0 in case of success, a negative value corresponding to an
372 * AVERROR code in case of failure372 * AVERROR code in case of failure
373 */373 */
374int avio_open(AVIOContext **s, const char *url, int flags);374int avio_open(AVIOContext **s, const char *url, int flags);
@@ -387,7 +387,7 @@ int avio_open(AVIOContext **s, const char *url, int flags); · 12 unmodified lines
387 * @param options A dictionary filled with protocol-private options. On return387 * @param options A dictionary filled with protocol-private options. On return
388 * this parameter will be destroyed and replaced with a dict containing options388 * this parameter will be destroyed and replaced with a dict containing options
389 * that were not found. May be NULL.389 * that were not found. May be NULL.
390 * @return 0 in case of success, a negative value corresponding to an390 * @return >= 0 in case of success, a negative value corresponding to an
391 * AVERROR code in case of failure391 * AVERROR code in case of failure
392 */392 */
393int avio_open2(AVIOContext **s, const char *url, int flags,393int avio_open2(AVIOContext **s, const char *url, int flags,
libavformat/avio_internal.h+2−2
@@ -78,7 +78,7 @@ static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s) · 77 unmodified lines
78 * @param s The read-only AVIOContext to rewind78 * @param s The read-only AVIOContext to rewind
79 * @param buf The probe buffer containing the first buf_size bytes of the file79 * @param buf The probe buffer containing the first buf_size bytes of the file
80 * @param buf_size The size of buf80 * @param buf_size The size of buf
81 * @return 0 in case of success, a negative value corresponding to an81 * @return >= 0 in case of success, a negative value corresponding to an
82 * AVERROR code in case of failure82 * AVERROR code in case of failure
83 */83 */
84int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char **buf, int buf_size);84int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char **buf, int buf_size);
@@ -125,7 +125,7 @@ int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); · 40 unmodified lines
125 *125 *
126 * @param s Used to return the pointer to the created AVIOContext.126 * @param s Used to return the pointer to the created AVIOContext.
127 * In case of failure the pointed to value is set to NULL.127 * In case of failure the pointed to value is set to NULL.
128 * @return 0 in case of success, a negative value corresponding to an128 * @return >= 0 in case of success, a negative value corresponding to an
129 * AVERROR code in case of failure129 * AVERROR code in case of failure
130 */130 */
131int ffio_fdopen(AVIOContext **s, URLContext *h);131int ffio_fdopen(AVIOContext **s, URLContext *h);
libavformat/url.h+2−2
@@ -101,7 +101,7 @@ typedef struct URLProtocol { · 100 unmodified lines
101 * is to be opened101 * is to be opened
102 * @param int_cb interrupt callback to use for the URLContext, may be102 * @param int_cb interrupt callback to use for the URLContext, may be
103 * NULL103 * NULL
104 * @return 0 in case of success, a negative value corresponding to an104 * @return >= 0 in case of success, a negative value corresponding to an
105 * AVERROR code in case of failure105 * AVERROR code in case of failure
106 */106 */
107int ffurl_alloc(URLContext **puc, const char *filename, int flags,107int ffurl_alloc(URLContext **puc, const char *filename, int flags,
@@ -130,7 +130,7 @@ int ffurl_connect(URLContext *uc, AVDictionary **options); · 22 unmodified lines
130 * @param options A dictionary filled with protocol-private options. On return130 * @param options A dictionary filled with protocol-private options. On return
131 * this parameter will be destroyed and replaced with a dict containing options131 * this parameter will be destroyed and replaced with a dict containing options
132 * that were not found. May be NULL.132 * that were not found. May be NULL.
133 * @return 0 in case of success, a negative value corresponding to an133 * @return >= 0 in case of success, a negative value corresponding to an
134 * AVERROR code in case of failure134 * AVERROR code in case of failure
135 */135 */
136int ffurl_open(URLContext **puc, const char *filename, int flags,136int ffurl_open(URLContext **puc, const char *filename, int flags,
libavformat/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
31 31
32#define LIBAVFORMAT_VERSION_MAJOR 5532#define LIBAVFORMAT_VERSION_MAJOR 55
33#define LIBAVFORMAT_VERSION_MINOR 1933#define LIBAVFORMAT_VERSION_MINOR 19
34#define LIBAVFORMAT_VERSION_MICRO 10234#define LIBAVFORMAT_VERSION_MICRO 103
35 35
36#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \36#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
37 LIBAVFORMAT_VERSION_MINOR, \37 LIBAVFORMAT_VERSION_MINOR, \
libavutil/eval.h+2−2
@@ -45,7 +45,7 @@ typedef struct AVExpr AVExpr; · 44 unmodified lines
45 * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments45 * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
46 * @param opaque a pointer which will be passed to all functions from funcs1 and funcs246 * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
47 * @param log_ctx parent logging context47 * @param log_ctx parent logging context
48 * @return 0 in case of success, a negative value corresponding to an48 * @return >= 0 in case of success, a negative value corresponding to an
49 * AVERROR code otherwise49 * AVERROR code otherwise
50 */50 */
51int av_expr_parse_and_eval(double *res, const char *s,51int av_expr_parse_and_eval(double *res, const char *s,
@@ -68,7 +68,7 @@ int av_expr_parse_and_eval(double *res, const char *s, · 16 unmodified lines
68 * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers68 * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
69 * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments69 * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
70 * @param log_ctx parent logging context70 * @param log_ctx parent logging context
71 * @return 0 in case of success, a negative value corresponding to an71 * @return >= 0 in case of success, a negative value corresponding to an
72 * AVERROR code otherwise72 * AVERROR code otherwise
73 */73 */
74int av_expr_parse(AVExpr **expr, const char *s,74int av_expr_parse(AVExpr **expr, const char *s,
libavutil/parseutils.h+1−1
@@ -127,7 +127,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, · 126 unmodified lines
127 * @endcode127 * @endcode
128 * @param duration flag which tells how to interpret timestr, if not128 * @param duration flag which tells how to interpret timestr, if not
129 * zero timestr is interpreted as a duration, otherwise as a date129 * zero timestr is interpreted as a duration, otherwise as a date
130 * @return 0 in case of success, a negative value corresponding to an130 * @return >= 0 in case of success, a negative value corresponding to an
131 * AVERROR code otherwise131 * AVERROR code otherwise
132 */132 */
133int av_parse_time(int64_t *timeval, const char *timestr, int duration);133int av_parse_time(int64_t *timeval, const char *timestr, int duration);
libavutil/version.h+1−1
@@ -76,7 +76,7 @@ · 75 unmodified lines
76 76
77#define LIBAVUTIL_VERSION_MAJOR 5277#define LIBAVUTIL_VERSION_MAJOR 52
78#define LIBAVUTIL_VERSION_MINOR 4778#define LIBAVUTIL_VERSION_MINOR 47
79#define LIBAVUTIL_VERSION_MICRO 10079#define LIBAVUTIL_VERSION_MICRO 101
80 80
81#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \81#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
82 LIBAVUTIL_VERSION_MINOR, \82 LIBAVUTIL_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t