Skip to content

Commit a3a288c

Browse files
committed
[SoftCSA] Suppress audio in SoftDecoder for PIP to prevent audio routing corruption
When a CSA-ALT channel runs as PIP, the SoftDecoder unconditionally called setAudioPID(), opening audio1 and interfering with the main picture's audio0 routing. This caused reproducible audio loss when switching PIP from a SoftCSA channel to FreeTV. Add m_noaudio flag to eDVBSoftDecoder, matching the existing guard in the hardware decoder path (eDVBServicePlay::selectAudioStream).
1 parent cc0646c commit a3a288c

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

lib/service/servicedvb.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4365,6 +4365,7 @@ void eDVBServicePlay::setupSpeculativeDescrambling()
43654365

43664366
// Create SoftDecoder (will start when session activates)
43674367
m_soft_decoder = new eDVBSoftDecoder(m_service_handler, m_dvb_service, m_decoder_index);
4368+
m_soft_decoder->setNoAudio(m_noaudio);
43684369
m_soft_decoder->setSession(m_csa_session);
43694370

43704371
// Connect to SoftDecoder's audio PID selection signal

lib/service/servicedvbsoftdecoder.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ eDVBSoftDecoder::eDVBSoftDecoder(eDVBServicePMTHandler& source_handler,
1717
, m_dvr_fd(-1)
1818
, m_running(false)
1919
, m_stopping(false)
20+
, m_noaudio(false)
2021
, m_decoder_started(false)
2122
, m_last_pts(0)
2223
, m_stall_count(0)
@@ -675,10 +676,13 @@ void eDVBSoftDecoder::updateDecoder(int vpid, int vpidtype, int pcrpid)
675676
apid, atype, audio_index, program.audioStreams.size());
676677
}
677678

678-
m_decoder->setAudioPID(apid, atype);
679+
if (!m_noaudio)
680+
{
681+
m_decoder->setAudioPID(apid, atype);
679682

680-
// Notify parent about selected audio PID
681-
m_audio_pid_selected(apid);
683+
// Notify parent about selected audio PID
684+
m_audio_pid_selected(apid);
685+
}
682686
}
683687

684688
// Using explicit pcrpid breaks video on some HiSilicon devices (e.g. sf8008) in PVR loopback mode
@@ -750,6 +754,8 @@ int eDVBSoftDecoder::setTrickmode()
750754

751755
int eDVBSoftDecoder::setAudioPID(int pid, int type)
752756
{
757+
if (m_noaudio)
758+
return 0;
753759
if (m_decoder)
754760
return m_decoder->setAudioPID(pid, type);
755761
return -1;

lib/service/servicedvbsoftdecoder.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ class eDVBSoftDecoder : public iObject, public sigc::trackable
4444
int start();
4545
void stop();
4646

47+
// Suppress audio output (PIP mode)
48+
void setNoAudio(bool noaudio) { m_noaudio = noaudio; }
49+
4750
// Status
4851
bool isRunning() const { return m_running; }
4952

@@ -110,6 +113,7 @@ class eDVBSoftDecoder : public iObject, public sigc::trackable
110113
int m_dvr_fd;
111114
bool m_running;
112115
bool m_stopping;
116+
bool m_noaudio; // When true, suppress audio (PIP mode)
113117
std::set<int> m_pids_active;
114118

115119
// CW waiting: Timer-based decoder start

0 commit comments

Comments
 (0)