mpegts: always reset pes packet state on new packet
authorMarton Balint <cus@passwd.hu>
Fri, 2 May 2014 15:17:01 +0000 (17:17 +0200)
committerMarton Balint <cus@passwd.hu>
Mon, 5 May 2014 20:33:52 +0000 (22:33 +0200)
Fixes ticket #3584.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/mpegts.c

index 7ed7bb4..0a5ac68 100644 (file)
@@ -918,9 +918,10 @@ static int mpegts_push_data(MpegTSFilter *filter,
         if (pes->state == MPEGTS_PAYLOAD && pes->data_index > 0) {
             new_pes_packet(pes, ts->pkt);
             ts->stop_parse = 1;
+        } else {
+            reset_pes_packet_state(pes);
         }
         pes->state         = MPEGTS_HEADER;
-        pes->data_index    = 0;
         pes->ts_packet_pos = pos;
     }
     p = buf;