Index: libs/libavformat/mpegts.c
===================================================================
--- libs/libavformat/mpegts.c	(revision 24251)
+++ libs/libavformat/mpegts.c	(working copy)
@@ -1794,6 +1794,13 @@
                 pes->data_index += buf_size;
             }
             buf_size = 0;
+            /* emit complete packets
+             * total_size is the number of bytes following pes_packet_length
+             * in the pes header, i.e. not counting the first 6 bytes */
+            if (pes->pes_header_size + pes->data_index >= pes->total_size + 6) {
+                ts->stop_parse = 1;
+                new_pes_packet(pes, ts->pkt);
+            }
             break;
         case MPEGTS_SKIP:
             buf_size = 0;

