changeset 36412:e76f2a8256a6

Make PES detection less sensitive. Should fix potential mis-detection of some AAC streams.
author reimar
date Fri, 15 Nov 2013 19:36:29 +0000
parents ac8cef6c0dc3
children 2dfea9cc8e2b
files libmpdemux/demux_mpg.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mpg.c	Fri Nov 15 19:36:27 2013 +0000
+++ b/libmpdemux/demux_mpg.c	Fri Nov 15 19:36:29 2013 +0000
@@ -871,7 +871,12 @@
           mp_msg(MSGT_DEMUX,MSGL_ERR,MSGTR_DoesntContainSelectedStream);
           return 0;
         }
-      if(demux->synced==3) demux->synced=(ret==1)?2:0; // PES detect
+      if(demux->synced == 3) { // PES detect
+         update_stats(head);
+         if (ret < 0) demux->synced = 0;
+         else if (ret == 1 && num_elementary_packetsPES > 1 && !mpeg_pts_error) demux->synced = 2;
+         else ret = 0;
+      }
   } else {
     update_stats(head);
     if(head>=0x100 && head<0x1B0)