diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index e78510f2037bbc49de2fad9b971a8e4e7b31b9e6..6df828c363c433cdd9940e73db7c388b6c35f03b 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1031,6 +1031,7 @@ static PESContext *add_pes_stream(MpegTSContext *ts, int pid, int pcr_pid, int s
     pes->pid = pid;
     pes->pcr_pid = pcr_pid;
     pes->stream_type = stream_type;
+    pes->state = MPEGTS_SKIP;
     tss = mpegts_open_pes_filter(ts, pid, mpegts_push_data, pes);
     if (!tss) {
         av_free(pes);