diff rtsp.c @ 6348:c709176da1ad libavformat

Preserve status reason It is used to provide meaningful error messages.
author lu_zero
date Fri, 06 Aug 2010 10:26:30 +0000
parents 491eea5c52d6
children 93c7a56fa912
line wrap: on
line diff
--- a/rtsp.c	Thu Aug 05 04:42:36 2010 +0000
+++ b/rtsp.c	Fri Aug 06 10:26:30 2010 +0000
@@ -824,6 +824,7 @@
             get_word(buf1, sizeof(buf1), &p);
             get_word(buf1, sizeof(buf1), &p);
             reply->status_code = atoi(buf1);
+            av_strlcpy(reply->reason, p, sizeof(reply->reason));
         } else {
             ff_rtsp_parse_line(reply, p, &rt->auth_state);
             av_strlcat(rt->last_reply, p,    sizeof(rt->last_reply));
@@ -961,9 +962,10 @@
         goto retry;
 
     if (reply->status_code > 400){
-        av_log(s, AV_LOG_ERROR, "method %s failed, %d\n",
+        av_log(s, AV_LOG_ERROR, "method %s failed: %d%s\n",
                method,
-               reply->status_code);
+               reply->status_code,
+               reply->reason);
         av_log(s, AV_LOG_DEBUG, "%s\n", rt->last_reply);
     }