]> granicus.if.org Git - handbrake/commitdiff
scan: potential fix for missing audio tracks
authorjstebbins <jstebbins.hb@gmail.com>
Fri, 12 Dec 2014 17:04:46 +0000 (17:04 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Fri, 12 Dec 2014 17:04:46 +0000 (17:04 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6597 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/scan.c

index 7ab7e17c7e2fa9222b62ad026c9d05abdbd73832..8c8ce433fcfaf48ffc51314a55e2ff11db191f1b 100644 (file)
@@ -599,8 +599,9 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title, int flush )
 
         hb_buffer_t * vid_buf = NULL;
 
-        int total_read = 0;
-        while (total_read < PREVIEW_READ_THRESH)
+        int total_read = 0, packets = 0;
+        while (total_read < PREVIEW_READ_THRESH ||
+              (!AllAudioOK(title) && packets < 10000)) 
         {
             if (data->bd)
             {
@@ -657,6 +658,7 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title, int flush )
                 goto skip_preview;
             }
             total_read += buf->size;
+            packets++;
 
             (hb_demux[title->demuxer])(buf, list_es, 0 );