]> granicus.if.org Git - handbrake/commitdiff
scan: fix failure to find audio bitrate during scan.
authorjstebbins <jstebbins.hb@gmail.com>
Mon, 20 Apr 2015 16:59:30 +0000 (16:59 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Mon, 20 Apr 2015 16:59:30 +0000 (16:59 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.10.x@7107 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/scan.c

index 731b048a585a8321c19c0c28bbaf472e062e274c..3826897a41c3f428411926a486a0082cb7bc41bc 100644 (file)
@@ -621,8 +621,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)
             {
@@ -679,6 +680,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 );