OSDN Git Service

import original 0.9.5 release
[handbrake-jp/handbrake-jp.git] / libhb / render.c
index a4943b7..8c7e9a2 100644 (file)
@@ -472,8 +472,14 @@ int renderWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
                 pv->dropped_frames++;
 
                 /* Pop the frame's subtitle and dispose of it. */
-                hb_buffer_t * subtitles = hb_fifo_get( pv->subtitle_queue );
-                hb_buffer_close( &subtitles );
+                hb_buffer_t * subpicture_list = hb_fifo_get( pv->subtitle_queue );
+                hb_buffer_t * subpicture;
+                hb_buffer_t * subpicture_next;
+                for ( subpicture = subpicture_list; subpicture; subpicture = subpicture_next )
+                {
+                    subpicture_next = subpicture->next_subpicture;
+                    hb_buffer_close( &subpicture );
+                }
                 buf_tmp_in = NULL;
                 break;
             }
@@ -500,10 +506,13 @@ int renderWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
     /* Apply subtitles */
     if( buf_tmp_in )
     {
-        hb_buffer_t * subtitles = hb_fifo_get( pv->subtitle_queue );
-        if( subtitles )
+        hb_buffer_t * subpicture_list = hb_fifo_get( pv->subtitle_queue );
+        hb_buffer_t * subpicture;
+        hb_buffer_t * subpicture_next;
+        for ( subpicture = subpicture_list; subpicture; subpicture = subpicture_next )
         {
-            ApplySub( job, buf_tmp_in, &subtitles );
+            subpicture_next = subpicture->next_subpicture;
+            ApplySub( job, buf_tmp_in, &subpicture );
         }
     }
 
@@ -712,16 +721,16 @@ int renderInit( hb_work_object_t * w, hb_job_t * job )
     if( job->crop[0] || job->crop[1] || job->crop[2] || job->crop[3] ||
         job->width != title->width || job->height != title->height )
     {
-        pv->context = sws_getContext(title->width  - (job->crop[2] + job->crop[3]),
+        pv->context = hb_sws_get_context(title->width  - (job->crop[2] + job->crop[3]),
                                      title->height - (job->crop[0] + job->crop[1]),
                                      PIX_FMT_YUV420P,
                                      job->width, job->height, PIX_FMT_YUV420P,
-                                     swsflags, NULL, NULL, NULL);
+                                     swsflags);
     }
 
     /* Setup FIFO queue for subtitle cache */
-    pv->subtitle_queue = hb_fifo_init( 8 );
-    pv->delay_queue = hb_fifo_init( 8 );
+    pv->subtitle_queue = hb_fifo_init( 8, 1 );
+    pv->delay_queue = hb_fifo_init( 8, 1 );
 
     /* VFR IVTC needs a bunch of time-keeping variables to track
       how many frames are dropped, how many are extended, what the