mirror of https://bitbucket.org/ausocean/av.git
Merged in kortschak/av/cgo/nocopy (pull request #20)
rtmp: remove unused allocation and copy
This commit is contained in:
commit
219971230c
|
@ -65,22 +65,16 @@ RTMP* start_session(RTMP* rtmp, char* url, uint connect_timeout) {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int write_frame(RTMP* rtmp, char* data, uint data_length) {
|
unsigned int write_frame(RTMP* rtmp, char* data, uint data_length) {
|
||||||
char* dataForC = malloc(data_length);
|
|
||||||
memcpy(dataForC,data,data_length);
|
|
||||||
if (!RTMP_IsConnected(rtmp)) {
|
if (!RTMP_IsConnected(rtmp)) {
|
||||||
printf("RTMP is not connected!\n");
|
printf("RTMP is not connected!\n");
|
||||||
free(dataForC);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RTMP_Write(rtmp, (const char*)data, data_length)) {
|
if (!RTMP_Write(rtmp, (const char*)data, data_length)) {
|
||||||
printf("RTMP write error!\n");
|
printf("RTMP write error!\n");
|
||||||
free(dataForC);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(dataForC);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue