mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
src/driver/streamts.cpp: use new instead of malloc
This commit is contained in:
@@ -259,11 +259,10 @@ void * streamts_live_thread(void *data)
|
|||||||
char cbuf[512];
|
char cbuf[512];
|
||||||
char *bp;
|
char *bp;
|
||||||
int fd = (int) data;
|
int fd = (int) data;
|
||||||
FILE * fp;
|
|
||||||
unsigned char demuxfd_count = 0;
|
unsigned char demuxfd_count = 0;
|
||||||
|
|
||||||
printf("Starting LIVE STREAM thread, fd %d\n", fd);
|
printf("Starting LIVE STREAM thread, fd %d\n", fd);
|
||||||
fp = fdopen(fd, "r+");
|
FILE * fp = fdopen(fd, "r+");
|
||||||
if(fp == NULL) {
|
if(fp == NULL) {
|
||||||
perror("fdopen");
|
perror("fdopen");
|
||||||
return 0;
|
return 0;
|
||||||
@@ -323,9 +322,9 @@ void * streamts_live_thread(void *data)
|
|||||||
pids[demuxfd_count++] = channel->getAudioChannel(i)->pid;
|
pids[demuxfd_count++] = channel->getAudioChannel(i)->pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = (unsigned char *) malloc(IN_SIZE);
|
buf = new unsigned char [IN_SIZE];
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
perror("malloc");
|
perror("NEW");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -353,7 +352,7 @@ void * streamts_live_thread(void *data)
|
|||||||
CCamManager::getInstance()->Stop(CZapit::getInstance()->GetCurrentChannelID(), CCamManager::STREAM);
|
CCamManager::getInstance()->Stop(CZapit::getInstance()->GetCurrentChannelID(), CCamManager::STREAM);
|
||||||
|
|
||||||
delete dmx;
|
delete dmx;
|
||||||
free(buf);
|
delete []buf;
|
||||||
close(fd);
|
close(fd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user