diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-03-22 22:38:44 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-03-22 22:38:44 +0100 |
commit | 4952afff75bc60df9c842bc248f1da8fe57e04a6 (patch) | |
tree | 2a2d82baf5a7f5dfc8dc415e52f28f6266503eab /libavformat | |
parent | d375c1040032ed42f84b7d4ea53baad4a661b628 (diff) | |
download | ffmpeg-4952afff75bc60df9c842bc248f1da8fe57e04a6.tar.gz |
Do not use format string "%0.3f" for RTSP Range field.
Fixes ticket 10.
The format string was locale-depending.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rtspdec.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index 95b8690f3e..f0187de714 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -59,9 +59,14 @@ static int rtsp_read_play(AVFormatContext *s) if (rt->state == RTSP_STATE_PAUSED) { cmd[0] = 0; } else { - snprintf(cmd, sizeof(cmd), - "Range: npt=%0.3f-\r\n", - (double)rt->seek_timestamp / AV_TIME_BASE); + if (!rt->seek_timestamp) { + snprintf(cmd, sizeof(cmd), "Range: npt=0.000-\r\n"); + } else { + snprintf(cmd, sizeof(cmd), + "Range: npt=%"PRId64".%03"PRId64"-\r\n", + rt->seek_timestamp / AV_TIME_BASE, + rt->seek_timestamp / (AV_TIME_BASE / 1000) % 1000); + } } ff_rtsp_send_cmd(s, "PLAY", rt->control_uri, cmd, reply, NULL); if (reply->status_code != RTSP_STATUS_OK) { |