mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
driver/streamts.cpp: fix streaming to new connection; send current channel pids, if no pids in url
This commit is contained in:
@@ -208,8 +208,6 @@ void streamts_main_thread(void * /*data*/)
|
||||
if (pfd[i].revents & (POLLIN | POLLPRI | POLLHUP | POLLRDHUP)) {
|
||||
printf("fd %d has events %x\n", pfd[i].fd, pfd[i].revents);
|
||||
if (pfd[i].fd == listenfd) {
|
||||
if(connfd >= 0)
|
||||
close(connfd);
|
||||
connfd = accept (listenfd, (struct sockaddr *) &servaddr, (socklen_t *) & clilen);
|
||||
printf("new connection, fd %d\n", connfd);
|
||||
if(connfd < 0) {
|
||||
@@ -315,7 +313,14 @@ void * streamts_live_thread(void *data)
|
||||
|
||||
if(demuxfd_count == 0) {
|
||||
printf("No pids!\n");
|
||||
return 0;
|
||||
CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel();
|
||||
if(!channel)
|
||||
return 0;
|
||||
pids[demuxfd_count++] = 0;
|
||||
pids[demuxfd_count++] = channel->getPmtPid();
|
||||
pids[demuxfd_count++] = channel->getVideoPid();
|
||||
for (int i = 0; i < channel->getAudioChannelCount(); i++)
|
||||
pids[demuxfd_count++] = channel->getAudioChannel(i)->pid;
|
||||
}
|
||||
|
||||
buf = (unsigned char *) malloc(IN_SIZE);
|
||||
|
Reference in New Issue
Block a user