Iam trying to handle packets with librtmp but get an error saying
"free(): invalid pointer"
The code:
#include <stdio.h>
#include <stdlib.h>
#include <librtmp/rtmp.h>
#include <librtmp/log.h>
int main(){
RTMP *r;
RTMPPacket packet;
char uri[] = "rtmp://167.114.171.21:1936/tinyconf app=tinyconf timeout=180000 live=1 conn=S:heckeur swfurl=http://tinychat.com/embed/Tinychat-11.1-1.0.0.0602.swf";
RTMP_LogLevel loglvl=RTMP_LOGDEBUG2;
RTMP_LogSetLevel(loglvl);
r = RTMP_Alloc();
RTMP_Init(r);
RTMP_SetupURL(r, (char*)uri);
RTMP_Connect(r, NULL);
while (RTMP_IsConnected(r)) {
RTMP_ReadPacket(r, &packet);
if (!RTMPPacket_IsReady(&packet))
continue;
RTMP_ClientPacket(r, &packet);
RTMPPacket_Free(&packet);
}
RTMP_Close(r);
RTMP_Free(r);
return 1;
}
Here's a link to the log/backtrace. (As it's pretty long)
I'm unsure to why this is happening, is this a problem with my code or librtmp itself?
Aucun commentaire:
Enregistrer un commentaire