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
498498 * @param filename file to read from
499499 * @param bufptr location where pointer to buffer is returned
500500 * @param size location where size of buffer is returned
501− * @return 0 in case of success, a negative value corresponding to an
501+ * @return >= 0 in case of success, a negative value corresponding to an
502502 * AVERROR error code in case of failure.
503503 */
504504 int 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
184184 *
185185 * @param avctx the AVCodecContext where to extract extra context to
186186 * @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 otherwise
187+ * @return >= 0 in case of success, a negative error code otherwise
188188 */
189189 static int extract_header(AVCodecContext *const avctx,
190190 const AVPacket *const avpkt) {
libavcodec/version.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 55
3232 #define LIBAVCODEC_VERSION_MINOR 37
33−#define LIBAVCODEC_VERSION_MICRO 101
33+#define LIBAVCODEC_VERSION_MICRO 102
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3636 LIBAVCODEC_VERSION_MINOR, \
libavcodec/wmaprodec.c+1−1
@@ -681,7 +681,7 @@ static void decode_decorrelation_matrix(WMAProDecodeCtx *s, · 680 unmodified lines
681681 /**
682682 *@brief Decode channel transformation parameters
683683 *@param s codec context
684− *@return 0 in case of success, < 0 in case of bitstream errors
684+ *@return >= 0 in case of success, < 0 in case of bitstream errors
685685 */
686686 static int decode_channel_transform(WMAProDecodeCtx* s)
687687 {
libavfilter/avcodec.h+3−3
@@ -72,7 +72,7 @@ AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type, · 71 unmodified lines
7272 *
7373 * @param frame an already allocated AVFrame
7474 * @param samplesref an audio buffer reference
75− * @return 0 in case of success, a negative AVERROR code in case of
75+ * @return >= 0 in case of success, a negative AVERROR code in case of
7676 * failure
7777 * @deprecated Use avfilter_copy_buf_props() instead.
7878 */
@@ -85,7 +85,7 @@ int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame, · 6 unmodified lines
8585 *
8686 * @param frame an already allocated AVFrame
8787 * @param picref a video buffer reference
88− * @return 0 in case of success, a negative AVERROR code in case of
88+ * @return >= 0 in case of success, a negative AVERROR code in case of
8989 * failure
9090 * @deprecated Use avfilter_copy_buf_props() instead.
9191 */
@@ -98,7 +98,7 @@ int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame, · 6 unmodified lines
9898 *
9999 * @param frame an already allocated AVFrame
100100 * @param ref a video or audio buffer reference
101− * @return 0 in case of success, a negative AVERROR code in case of
101+ * @return >= 0 in case of success, a negative AVERROR code in case of
102102 * failure
103103 * @deprecated Use avfilter_copy_buf_props() instead.
104104 */
libavfilter/avfilter.h+1−1
@@ -1316,7 +1316,7 @@ enum { · 1315 unmodified lines
13161316 *
13171317 * @param graphctx the filter graph
13181318 * @param log_ctx context used for logging
1319− * @return 0 in case of success, a negative AVERROR code otherwise
1319+ * @return >= 0 in case of success, a negative AVERROR code otherwise
13201320 */
13211321 int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx);
13221322
libavfilter/avfiltergraph.c+2−2
@@ -224,7 +224,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 223 unmodified lines
224224 * A graph is considered valid if all its input and output pads are
225225 * connected.
226226 *
227− * @return 0 in case of success, a negative value otherwise
227+ * @return >= 0 in case of success, a negative value otherwise
228228 */
229229 static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx)
230230 {
@@ -262,7 +262,7 @@ static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx) · 31 unmodified lines
262262 /**
263263 * Configure all the links of graphctx.
264264 *
265− * @return 0 in case of success, a negative value otherwise
265+ * @return >= 0 in case of success, a negative value otherwise
266266 */
267267 static int graph_config_links(AVFilterGraph *graph, AVClass *log_ctx)
268268 {
libavfilter/graphparser.c+2−2
@@ -89,7 +89,7 @@ static char *parse_link_name(const char **buf, void *log_ctx) · 88 unmodified lines
8989 * @param filt_name the name of the filter to create
9090 * @param args the arguments provided to the filter during its initialization
9191 * @param log_ctx the log context to use
92− * @return 0 in case of success, a negative AVERROR code otherwise
92+ * @return >= 0 in case of success, a negative AVERROR code otherwise
9393 */
9494 static int create_filter(AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index,
9595 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
152152 * @param index an index which is assigned to the created filter
153153 * instance, and which is supposed to be unique for each filter
154154 * instance added to the filtergraph
155− * @return 0 in case of success, a negative AVERROR code otherwise
155+ * @return >= 0 in case of success, a negative AVERROR code otherwise
156156 */
157157 static int parse_filter(AVFilterContext **filt_ctx, const char **buf, AVFilterGraph *graph,
158158 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
169169 * @param ret pixel format pointer to where the value should be written
170170 * @param arg string to parse
171171 * @param log_ctx log context
172− * @return 0 in case of success, a negative AVERROR code on error
172+ * @return >= 0 in case of success, a negative AVERROR code on error
173173 */
174174 int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ctx);
175175
@@ -179,7 +179,7 @@ int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ct · 3 unmodified lines
179179 * @param ret unsigned integer pointer to where the value should be written
180180 * @param arg string to parse
181181 * @param log_ctx log context
182− * @return 0 in case of success, a negative AVERROR code on error
182+ * @return >= 0 in case of success, a negative AVERROR code on error
183183 */
184184 int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx);
185185
@@ -189,7 +189,7 @@ int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx); · 3 unmodified lines
189189 * @param ret unsigned AVRational pointer to where the value should be written
190190 * @param arg string to parse
191191 * @param log_ctx log context
192− * @return 0 in case of success, a negative AVERROR code on error
192+ * @return >= 0 in case of success, a negative AVERROR code on error
193193 */
194194 int ff_parse_time_base(AVRational *ret, const char *arg, void *log_ctx);
195195
@@ -199,7 +199,7 @@ int ff_parse_time_base(AVRational *ret, const char *arg, void *log_ctx); · 3 unmodified lines
199199 * @param ret integer pointer to where the value should be written
200200 * @param arg string to parse
201201 * @param log_ctx log context
202− * @return 0 in case of success, a negative AVERROR code on error
202+ * @return >= 0 in case of success, a negative AVERROR code on error
203203 */
204204 int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx);
205205
@@ -209,7 +209,7 @@ int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx); · 3 unmodified lines
209209 * @param ret 64bit integer pointer to where the value should be written.
210210 * @param arg string to parse
211211 * @param log_ctx log context
212− * @return 0 in case of success, a negative AVERROR code on error
212+ * @return >= 0 in case of success, a negative AVERROR code on error
213213 */
214214 int ff_parse_channel_layout(int64_t *ret, const char *arg, void *log_ctx);
215215
libavfilter/lavfutils.h+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 * @param pix_fmt pointer to the pixel format of the loaded image
3535 * @param filename the name of the image file to load
3636 * @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.
3838 */
3939 int ff_load_image(uint8_t *data[4], int linesize[4],
4040 int *w, int *h, enum AVPixelFormat *pix_fmt,
libavfilter/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131
3232 #define LIBAVFILTER_VERSION_MAJOR 3
3333 #define LIBAVFILTER_VERSION_MINOR 88
34−#define LIBAVFILTER_VERSION_MICRO 101
34+#define LIBAVFILTER_VERSION_MICRO 102
3535
3636 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
3737 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
368368 * In case of failure the pointed to value is set to NULL.
369369 * @param flags flags which control how the resource indicated by url
370370 * is to be opened
371− * @return 0 in case of success, a negative value corresponding to an
371+ * @return >= 0 in case of success, a negative value corresponding to an
372372 * AVERROR code in case of failure
373373 */
374374 int 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
387387 * @param options A dictionary filled with protocol-private options. On return
388388 * this parameter will be destroyed and replaced with a dict containing options
389389 * that were not found. May be NULL.
390− * @return 0 in case of success, a negative value corresponding to an
390+ * @return >= 0 in case of success, a negative value corresponding to an
391391 * AVERROR code in case of failure
392392 */
393393 int 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
7878 * @param s The read-only AVIOContext to rewind
7979 * @param buf The probe buffer containing the first buf_size bytes of the file
8080 * @param buf_size The size of buf
81− * @return 0 in case of success, a negative value corresponding to an
81+ * @return >= 0 in case of success, a negative value corresponding to an
8282 * AVERROR code in case of failure
8383 */
8484 int 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
125125 *
126126 * @param s Used to return the pointer to the created AVIOContext.
127127 * In case of failure the pointed to value is set to NULL.
128− * @return 0 in case of success, a negative value corresponding to an
128+ * @return >= 0 in case of success, a negative value corresponding to an
129129 * AVERROR code in case of failure
130130 */
131131 int ffio_fdopen(AVIOContext **s, URLContext *h);
libavformat/url.h+2−2
@@ -101,7 +101,7 @@ typedef struct URLProtocol { · 100 unmodified lines
101101 * is to be opened
102102 * @param int_cb interrupt callback to use for the URLContext, may be
103103 * NULL
104− * @return 0 in case of success, a negative value corresponding to an
104+ * @return >= 0 in case of success, a negative value corresponding to an
105105 * AVERROR code in case of failure
106106 */
107107 int ffurl_alloc(URLContext **puc, const char *filename, int flags,
@@ -130,7 +130,7 @@ int ffurl_connect(URLContext *uc, AVDictionary **options); · 22 unmodified lines
130130 * @param options A dictionary filled with protocol-private options. On return
131131 * this parameter will be destroyed and replaced with a dict containing options
132132 * that were not found. May be NULL.
133− * @return 0 in case of success, a negative value corresponding to an
133+ * @return >= 0 in case of success, a negative value corresponding to an
134134 * AVERROR code in case of failure
135135 */
136136 int ffurl_open(URLContext **puc, const char *filename, int flags,
libavformat/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131
3232 #define LIBAVFORMAT_VERSION_MAJOR 55
3333 #define LIBAVFORMAT_VERSION_MINOR 19
34−#define LIBAVFORMAT_VERSION_MICRO 102
34+#define LIBAVFORMAT_VERSION_MICRO 103
3535
3636 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
3737 LIBAVFORMAT_VERSION_MINOR, \
libavutil/eval.h+2−2
@@ -45,7 +45,7 @@ typedef struct AVExpr AVExpr; · 44 unmodified lines
4545 * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
4646 * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
4747 * @param log_ctx parent logging context
48− * @return 0 in case of success, a negative value corresponding to an
48+ * @return >= 0 in case of success, a negative value corresponding to an
4949 * AVERROR code otherwise
5050 */
5151 int 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
6868 * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
6969 * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
7070 * @param log_ctx parent logging context
71− * @return 0 in case of success, a negative value corresponding to an
71+ * @return >= 0 in case of success, a negative value corresponding to an
7272 * AVERROR code otherwise
7373 */
7474 int 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
127127 * @endcode
128128 * @param duration flag which tells how to interpret timestr, if not
129129 * zero timestr is interpreted as a duration, otherwise as a date
130− * @return 0 in case of success, a negative value corresponding to an
130+ * @return >= 0 in case of success, a negative value corresponding to an
131131 * AVERROR code otherwise
132132 */
133133 int av_parse_time(int64_t *timeval, const char *timestr, int duration);
libavutil/version.h+1−1
@@ -76,7 +76,7 @@ · 75 unmodified lines
7676
7777 #define LIBAVUTIL_VERSION_MAJOR 52
7878 #define LIBAVUTIL_VERSION_MINOR 47
79−#define LIBAVUTIL_VERSION_MICRO 100
79+#define LIBAVUTIL_VERSION_MICRO 101
8080
8181 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
8282 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