@@ -573,6 +573,7 @@ static struct rtp *initialize_audio_network(struct audio_network_parameters *par
573
573
574
574
struct audio_decoder {
575
575
bool enabled;
576
+ bool decoded; // /< last frame was decoded
576
577
struct pbuf_audio_data pbuf_data;
577
578
};
578
579
@@ -776,6 +777,7 @@ static void *audio_receiver_thread(void *arg)
776
777
777
778
struct audio_decoder *dec_state = (struct audio_decoder *) cp->decoder_state ;
778
779
if (dec_state && dec_state->enabled ) {
780
+ dec_state->decoded = false ;
779
781
dec_state->pbuf_data .buffer .data_len = 0 ;
780
782
dec_state->pbuf_data .buffer .timestamp = -1 ;
781
783
// We iterate in loop since there can be more than one frmae present in
@@ -785,6 +787,7 @@ static void *audio_receiver_thread(void *arg)
785
787
786
788
current_pbuf = &dec_state->pbuf_data ;
787
789
decoded = true ;
790
+ dec_state->decoded = true ;
788
791
}
789
792
}
790
793
@@ -845,7 +848,7 @@ static void *audio_receiver_thread(void *arg)
845
848
cp = pdb_iter_init (s->audio_participants , &it);
846
849
while (cp != NULL ) {
847
850
struct audio_decoder *dec_state = (struct audio_decoder *) cp->decoder_state ;
848
- if (dec_state && dec_state->enabled && dec_state->pbuf_data . buffer . data_len > 0 ) {
851
+ if (dec_state && dec_state->enabled && dec_state->decoded ) {
849
852
struct audio_frame *f = &dec_state->pbuf_data .buffer ;
850
853
f->network_source = &dec_state->pbuf_data .source ;
851
854
audio_playback_put_frame (s->audio_playback_device , f);
0 commit comments