View Single Post
  #85  
Old 04-24-2013, 01:29 PM
gorilla.maguila gorilla.maguila is offline
Member
 
Join Date: Dec 2012
Posts: 62
gorilla.maguila is on a distinguished road
Default

Re: Customized rtmpdump binaries with patch file


Quote:
Originally Posted by KSV View Post
try updating the relevant block with following code.

Code:
          if (code == 302 && RTMP_FindFirstMatchingProperty(&obj2, &av_redirect, &p))
            {
              AMFProp_GetString(&p, &redirect);
              r->Link.redirected = TRUE;

              char *playpath = "//playpath";
              int len = redirect.av_len + strlen(playpath);
              char *url = malloc(len + 1);
              memcpy(url, redirect.av_val, redirect.av_len);
              memcpy(url + redirect.av_len, playpath, strlen(playpath));
              url[len] = '\0';
              r->Link.tcUrl.av_val = url;
              r->Link.tcUrl.av_len = redirect.av_len;
              RTMP_ParseURL(url, &r->Link.protocol, &r->Link.hostname, &parsedPort, &r->Link.playpath0, &r->Link.app);
              if (parsedPort)
                r->Link.port = parsedPort;
            }
        }

Thanks KSV, it's SOLVED.

Do you think it's worthy to look at the possible memory leaks pointed out by valgrind, like the

Code:
char *url = malloc(len + 1)
Never being freed, or they're false positive?

Thanks again
Reply With Quote