OSDN Git Service

Don't discard titles during scan just because of a read failure on one or more of...
[handbrake-jp/handbrake-jp-git.git] / libhb / hb.c
index e90daeb..a53bd1f 100644 (file)
@@ -104,6 +104,11 @@ hb_handle_t * hb_init_real( int verbose, int update_check )
         }
     }
 
+    /*
+     * Initialise buffer pool
+     */
+    hb_buffer_pool_init();
+
     /* CPU count detection */
     hb_log( "hb_init: checking cpu count" );
     h->cpu_count = hb_get_cpu_count();
@@ -364,7 +369,7 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture,
                              title->height - (job->crop[0] + job->crop[1]),
                              PIX_FMT_YUV420P,
                              job->width, job->height, PIX_FMT_YUV420P,
-                             SWS_LANCZOS, NULL, NULL, NULL);
+                             (uint16_t)(SWS_LANCZOS|SWS_ACCURATE_RND), NULL, NULL, NULL);
 
     // Scale
     sws_scale(context,
@@ -378,7 +383,7 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture,
     // Get preview context
     context = sws_getContext(job->width, job->height, PIX_FMT_YUV420P,
                              job->width, job->height, PIX_FMT_RGBA32,
-                             SWS_LANCZOS, NULL, NULL, NULL);
+                             (uint16_t)(SWS_LANCZOS|SWS_ACCURATE_RND), NULL, NULL, NULL);
 
     // Create preview
     sws_scale(context,
@@ -419,10 +424,6 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture,
     avpicture_free( &pic_scale );
     avpicture_free( &pic_deint );
     avpicture_free( &pic_in );
-    free( buf1 );
-    free( buf2 );
-    free( buf3 );
-    free( buf4 );
 }
 
 /**
@@ -611,7 +612,7 @@ void hb_add( hb_handle_t * h, hb_job_t * job )
      */
     memset( audio_lang, 0, sizeof( audio_lang ) );
 
-    if ( job->subtitle_scan || job->native_language ) {
+    if ( job->indepth_scan || job->native_language ) {
       
         /*
          * Find the first audio language that is being encoded
@@ -663,7 +664,7 @@ void hb_add( hb_handle_t * h, hb_job_t * job )
      * If doing a subtitle scan then add all the matching subtitles for this
      * language.
      */
-    if ( job->subtitle_scan ) 
+    if ( job->indepth_scan ) 
     {
         for( i=0; i < hb_list_count( title->list_subtitle ); i++ ) 
         {
@@ -800,6 +801,7 @@ void hb_start( hb_handle_t * h )
 {
     /* XXX Hack */
     h->job_count = hb_list_count( h->jobs );
+    h->job_count_permanent = h->job_count;
 
     hb_lock( h->state_lock );
     h->state.state = HB_STATE_WORKING;
@@ -929,6 +931,7 @@ void hb_close( hb_handle_t ** _h )
     hb_lock_close( &h->pause_lock );
     free( h );
     *_h = NULL;
+
 }
 
 /**