From 4d2e6763a6487c57329e1f75791dfb818f5e7d8d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 21 Jun 2012 14:35:47 +0400 Subject: [PATCH] driver/streamts.cpp: fix streaming to new connection; send current channel pids, if no pids in url Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cfb4a774859b3b69916cdc2d9e547e367f4c079f Author: [CST] Focus Date: 2012-06-21 (Thu, 21 Jun 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/streamts.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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);