[FFmpeg-cvslog] Replace remaining uses of parse_date with av_parse_time.
Anton Khirnov
git
Fri Feb 18 20:38:21 CET 2011
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Feb 16 08:52:37 2011 +0000| [ee60e04c2c07b907bf72d1092c43b972c9c5e725] | committer: Michael Niedermayer
Replace remaining uses of parse_date with av_parse_time.
Signed-off-by: Mans Rullgard <mans at mansr.com>
(cherry picked from commit 9fcae9735e3b97366dcee9ca3c2f6cf4faf6756f)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ee60e04c2c07b907bf72d1092c43b972c9c5e725
---
ffserver.c | 10 ++++------
libavformat/rtsp.c | 5 +++--
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/ffserver.c b/ffserver.c
index 58d4112..a2956d3 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2136,9 +2136,8 @@ static int open_input_stream(HTTPContext *c, const char *info)
buf_size = FFM_PACKET_SIZE;
/* compute position (absolute time) */
if (find_info_tag(buf, sizeof(buf), "date", info)) {
- stream_pos = parse_date(buf, 0);
- if (stream_pos == INT64_MIN)
- return -1;
+ if ((ret = av_parse_time(&stream_pos, buf, 0)) < 0)
+ return ret;
} else if (find_info_tag(buf, sizeof(buf), "buffer", info)) {
int prebuffer = strtol(buf, 0, 10);
stream_pos = av_gettime() - prebuffer * (int64_t)1000000;
@@ -2149,9 +2148,8 @@ static int open_input_stream(HTTPContext *c, const char *info)
buf_size = 0;
/* compute position (relative time) */
if (find_info_tag(buf, sizeof(buf), "date", info)) {
- stream_pos = parse_date(buf, 1);
- if (stream_pos == INT64_MIN)
- return -1;
+ if ((ret = av_parse_time(&stream_pos, buf, 1)) < 0)
+ return ret;
} else
stream_pos = 0;
}
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index d828c8d..cee3d7e 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -22,6 +22,7 @@
#include "libavutil/base64.h"
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
+#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "avformat.h"
@@ -99,11 +100,11 @@ static void rtsp_parse_range_npt(const char *p, int64_t *start, int64_t *end)
*end = AV_NOPTS_VALUE;
get_word_sep(buf, sizeof(buf), "-", &p);
- *start = parse_date(buf, 1);
+ av_parse_time(start, buf, 1);
if (*p == '-') {
p++;
get_word_sep(buf, sizeof(buf), "-", &p);
- *end = parse_date(buf, 1);
+ av_parse_time(end, buf, 1);
}
// av_log(NULL, AV_LOG_DEBUG, "Range Start: %lld\n", *start);
// av_log(NULL, AV_LOG_DEBUG, "Range End: %lld\n", *end);
More information about the ffmpeg-cvslog
mailing list