Revert "Send silent frame for muted audio downtrack (#1385)" (#1387)

This reverts commit 0e699d6ed0.
This commit is contained in:
cnderrauber
2023-02-07 14:10:39 +08:00
committed by GitHub
parent 0e699d6ed0
commit 470a6fc9f1
2 changed files with 32 additions and 65 deletions
+7 -1
View File
@@ -1462,7 +1462,6 @@ func (f *Forwarder) GetTranslationParams(extPkt *buffer.ExtPacket, layer int32)
defer f.lock.Unlock()
// Video: Do not drop on publisher mute to enable resume on publisher unmute without a key frame.
// Audio: Do not drop on publisher mute to ensure decoder does not get stuck at a noise frame.
if f.muted {
return &TranslationParams{
shouldDrop: true,
@@ -1471,6 +1470,13 @@ func (f *Forwarder) GetTranslationParams(extPkt *buffer.ExtPacket, layer int32)
switch f.kind {
case webrtc.RTPCodecTypeAudio:
// Audio: Blank frames are injected on publisher mute to ensure decoder does not get stuck at a noise frame. So, do not forward.
if f.pubMuted {
return &TranslationParams{
shouldDrop: true,
}, nil
}
return f.getTranslationParamsAudio(extPkt, layer)
case webrtc.RTPCodecTypeVideo:
return f.getTranslationParamsVideo(extPkt, layer)