<div>
                    Hi All,
                </div><div><br></div><div>I'm writing a cocoa os x app that uses librtmp to download some stream. I got the source from the git repo (supposedly 2.4, although rtmp.h still says 2.3) and built the librtmp and linked to in my project.</div><div><br></div><div>When I'm reading a stream, I find that curiously the reading "hangs" after a while, and then start again after a minute or so (sometimes just failing with "ERROR: RTMP_ReadPacket, failed to read RTMP packet header"). When I mean hangs, it's just that RTMP_Read doesn't return, as if waiting from the server. Although I tested with the rtmpdump executable from the command line and everything goes fine, so bug is definitely not server side.</div><div>I've noticed that it was generally after downloading 7MB of data, and if I change the buffer size to something bigger, then the hanging happens much later, so it's seems to be directly related to the buffer size.</div><div><br></div><div>This is the sort of URL I use :</div><div><span>"rtmpe://theserver/thepath buffer=32768"</span></div><div><span><br></span></div><div><span>My code looks like :</span></div><div><span style="color: rgb(121, 72, 46); font-family: Menlo; "><span style="color: #be299d"><br></span></span></div><div><span style="color: rgb(121, 72, 46); font-family: Menlo; "><span style="color: #be299d">char</span><span style="color: #000000"> buffer[</span>RTMP_DEFAULT_CHUNKSIZE<span style="color: #000000">];</span></span></div><div><span>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo"><span style="color: #733ea4">size_t</span> readCount = <span style="color: #2f2fd1">0</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo"><span style="color: #be299d">while</span> ((readCount = <span style="color: #30595d">RTMP_Read</span>(rtmp, buffer, <span style="color: #79482e">RTMP_DEFAULT_CHUNKSIZE</span>)) > <span style="color: #2f2fd1">0</span> ) {</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo"><span class="Apple-tab-span" style="white-space:pre">  </span>[data <span style="color: #401f7d">appendBytes</span>:buffer <span style="color: #401f7d">length</span>:readCount];</p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo">}</p></span></div>
                <div><div><br></div><div><br></div><div>Any help ?</div><div><br></div><div>Thanks,</div><div>Rafael</div><div><br></div>-- <br>Rafael Cerioli<br>Sent with <a href="http://www.sparrowmailapp.com">Sparrow</a><br><div><br></div></div>