[FFmpeg-cvslog] rtsp: Avoid a cast when calling strtol

Martin Storsjö git at videolan.org
Tue Oct 30 13:56:23 CET 2012


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon Oct 22 23:13:49 2012 +0300| [f21d5c905dd5c6a56583c85623a376a029ec041a] | committer: Martin Storsjö

rtsp: Avoid a cast when calling strtol

This gets rid of this warning:

libavformat/rtsp.c: In function ‘rtsp_parse_transport’:
libavformat/rtsp.c:794: warning: cast discards qualifiers from pointer target type

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f21d5c905dd5c6a56583c85623a376a029ec041a
---

 libavformat/rtsp.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index bbe08e6..44de4af 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -765,8 +765,10 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
                     th->lower_transport = RTSP_LOWER_TRANSPORT_UDP_MULTICAST;
             } else if (!strcmp(parameter, "ttl")) {
                 if (*p == '=') {
+                    char *end;
                     p++;
-                    th->ttl = strtol(p, (char **)&p, 10);
+                    th->ttl = strtol(p, &end, 10);
+                    p = end;
                 }
             } else if (!strcmp(parameter, "destination")) {
                 if (*p == '=') {



More information about the ffmpeg-cvslog mailing list