[FFmpeg-soc] [soc]: r4756 - rtmp/rtmpproto.c

kostya subversion at mplayerhq.hu
Wed Jul 22 08:02:33 CEST 2009


Author: kostya
Date: Wed Jul 22 08:02:33 2009
New Revision: 4756

Log:
Print received server error

Modified:
   rtmp/rtmpproto.c

Modified: rtmp/rtmpproto.c
==============================================================================
--- rtmp/rtmpproto.c	Wed Jul 22 07:59:09 2009	(r4755)
+++ rtmp/rtmpproto.c	Wed Jul 22 08:02:33 2009	(r4756)
@@ -370,7 +370,11 @@ static int rtmp_parse_result(URLContext 
             gen_pong(s, rt, pkt);
         break;
     case RTMP_PT_INVOKE:
-        if (!memcmp(pkt->data, "\002\000\006_error", 9)) {//TODO: search data for error description
+        if (!memcmp(pkt->data, "\002\000\006_error", 9)) {
+            uint8_t tmpstr[256];
+
+            if (!ff_amf_find_field(pkt->data + 9, "description", tmpstr, sizeof(tmpstr)))
+                av_log(NULL/*s*/, AV_LOG_ERROR, "Server error: %s\n",tmpstr);
             return -1;
         }
         if (!memcmp(pkt->data, "\002\000\007_result", 10)) {


More information about the FFmpeg-soc mailing list