diff --git a/src/opus_encoder.c b/src/opus_encoder.c
index ab08bff8062b13595904cd555bb467b7a77fdb95..ab9e3e89f7af2dc488ffa0ef5e76fd1c559efe7c 100644
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -2150,6 +2150,8 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_
           RESTORE_STACK;
           return 1;
        }
+    } else {
+       st->nb_no_activity_frames = 0;
     }
 #endif