diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index f908dfccb..9de6a2455 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -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);