mirror of https://bitbucket.org/ausocean/av.git
rtmp: remove unused allocation and copy
This commit is contained in:
parent
12c458b415
commit
65a4abb24b
|
@ -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