Mercurial > libavcore.hg
comparison parseutils.c @ 2:b7595fe2d4a4 libavcore
Make av_parse_video_size() and av_parse_video_rate() return
AVERROR(EINVAL) rather than -1 in case of unsuccess.
| author | stefano |
|---|---|
| date | Mon, 26 Jul 2010 23:12:38 +0000 |
| parents | d2641c727ec5 |
| children | af138a6c3924 |
comparison
equal
deleted
inserted
replaced
| 1:d2641c727ec5 | 2:b7595fe2d4a4 |
|---|---|
| 105 if (*p) | 105 if (*p) |
| 106 p++; | 106 p++; |
| 107 frame_height = strtol(p, &p, 10); | 107 frame_height = strtol(p, &p, 10); |
| 108 } | 108 } |
| 109 if (frame_width <= 0 || frame_height <= 0) | 109 if (frame_width <= 0 || frame_height <= 0) |
| 110 return -1; | 110 return AVERROR(EINVAL); |
| 111 *width_ptr = frame_width; | 111 *width_ptr = frame_width; |
| 112 *height_ptr = frame_height; | 112 *height_ptr = frame_height; |
| 113 return 0; | 113 return 0; |
| 114 } | 114 } |
| 115 | 115 |
| 143 AVRational time_base = av_d2q(strtod(arg, 0), 1001000); | 143 AVRational time_base = av_d2q(strtod(arg, 0), 1001000); |
| 144 frame_rate->den = time_base.den; | 144 frame_rate->den = time_base.den; |
| 145 frame_rate->num = time_base.num; | 145 frame_rate->num = time_base.num; |
| 146 } | 146 } |
| 147 if (frame_rate->num <= 0 || frame_rate->den <= 0) | 147 if (frame_rate->num <= 0 || frame_rate->den <= 0) |
| 148 return -1; | 148 return AVERROR(EINVAL); |
| 149 return 0; | 149 return 0; |
| 150 } | 150 } |
