Permalink
Browse files

start streaming if there is an audio and a video channel available

  • Loading branch information...
1 parent b62ccbd commit 98e1ea14ebbd76c771d304af0eb9bb2946befc89 @pipelka committed Jun 25, 2012
Showing with 16 additions and 3 deletions.
  1. +16 −3 src/live/livestreamer.c
View
@@ -828,9 +828,22 @@ void cLiveStreamer::SetLanguage(int lang, eStreamType streamtype)
bool cLiveStreamer::IsReady()
{
+ bool bHaveAudio = false;
+ bool bHaveVideo = false;
+ bool bAllParsed = true;
+
for (std::list<cTSDemuxer*>::iterator i = m_Demuxers.begin(); i != m_Demuxers.end(); i++)
- if (!(*i)->IsParsed())
- return false;
+ {
+ if ((*i)->IsParsed())
+ {
+ if ((*i)->Content() == scAUDIO)
+ bHaveAudio = true;
+ else if ((*i)->Content() == scVIDEO)
+ bHaveVideo = true;
+ }
+ else
+ bAllParsed = false;
+ }
- return true;
+ return (bHaveAudio && bHaveVideo) || bAllParsed;
}

0 comments on commit 98e1ea1

Please sign in to comment.