From 566dbf651306046e182e826ca854d8d8f68aa75d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 1 Sep 2013 17:30:53 +0200 Subject: [PATCH] zapit: fix A/V start/stop for new azbox drivers Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1db98b11cd557767e7cd4da2b76ff33c7fe96315 Author: Stefan Seyfried Date: 2013-09-01 (Sun, 01 Sep 2013) --- src/zapit/src/zapit.cpp | 42 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 48482a235..5a63d5f83 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -2049,32 +2049,6 @@ bool CZapit::StartPlayBack(CZapitChannel *thisChannel) videoDecoder->SetStreamType((VIDEO_FORMAT)thisChannel->type); // videoDecoder->SetSync(VIDEO_PLAY_MOTION); -#if HAVE_AZBOX_HARDWARE - if (have_audio) { - audioDemux->pesFilter(thisChannel->getAudioPid()); - } - /* select audio output and start audio */ - if (have_audio) { - SetAudioStreamType(thisChannel->getAudioChannel()->audioChannelType); - audioDemux->Start(); - audioDecoder->Start(); - } - if (have_video) { - videoDemux->pesFilter(thisChannel->getVideoPid()); - } - /* start video */ - if (have_video) { - videoDemux->Start(); - videoDecoder->Start(0, thisChannel->getPcrPid(), thisChannel->getVideoPid()); - } - if (have_pcr) { - pcrDemux->pesFilter(thisChannel->getPcrPid()); - } - if (have_pcr) { - //printf("[zapit] starting PCR 0x%X\n", thisChannel->getPcrPid()); - pcrDemux->Start(); - } -#else if (have_pcr) { pcrDemux->pesFilter(thisChannel->getPcrPid()); } @@ -2105,14 +2079,19 @@ bool CZapit::StartPlayBack(CZapitChannel *thisChannel) } /* start video */ +#if HAVE_AZBOX_HARDWARE + videoDemux->Start(); + /* no idea why we need to start *video* to get sound for radio... :-) */ + videoDecoder->Start(); +#else if (have_video) { videoDecoder->Start(0, thisChannel->getPcrPid(), thisChannel->getVideoPid()); videoDemux->Start(); } +#endif #ifdef USE_VBI if(have_teletext) videoDecoder->StartVBI(thisChannel->getTeletextPid()); -#endif #endif playing = true; @@ -2134,17 +2113,22 @@ bool CZapit::StopPlayBack(bool send_pmt) #if HAVE_AZBOX_HARDWARE pcrDemux->Stop(); + + if (current_channel && current_channel->getVideoPid()) { + videoDemux->Stop(); + videoDecoder->Stop(standby ? false : true); + } audioDemux->Stop(); - videoDemux->Stop(); + audioDecoder->Stop(); #else videoDemux->Stop(); audioDemux->Stop(); pcrDemux->Stop(); -#endif audioDecoder->Stop(); /* hack. if standby, dont blank video -> for paused timeshift */ videoDecoder->Stop(standby ? false : true); +#endif #ifdef USE_VBI videoDecoder->StopVBI(); #endif