From 5c14b33d1f8c65a0a6fee61751a6d642dab7f312 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 20 Apr 2012 15:41:52 +0400 Subject: [PATCH] zapit/src/zapit.cpp: attempt to fix lost sound after pmt update, not tested --- src/zapit/src/zapit.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 03beb29a8..363ab5735 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -2089,9 +2089,19 @@ void CZapit::run() if(current_channel) { t_channel_id channel_id = current_channel->getChannelID(); int vpid = current_channel->getVideoPid(); + int apid = current_channel->getAudioPid(); CPmt pmt; pmt.Parse(current_channel); - if(vpid != current_channel->getVideoPid()) { + bool apid_found = false; + /* check if selected audio pid still present */ + for (int i = 0; i < current_channel->getAudioChannelCount(); i++) { + if (current_channel->getAudioChannel(i)->pid == apid) { + apid_found = true; + break; + } + } + + if(!apid_found || vpid != current_channel->getVideoPid()) { ZapIt(current_channel->getChannelID(), true); } else { SendPMT(true);