OSDN Git Service

fix srt track stop time
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 27 Sep 2009 19:36:19 +0000 (19:36 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 27 Sep 2009 19:36:19 +0000 (19:36 +0000)
srt stop time was being set to the end of the start chapter instead of the end
of the stop chapter.

git-svn-id: svn://localhost/HandBrake/trunk@2843 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/decsrtsub.c

index 0fcb1a0..5c99218 100644 (file)
@@ -249,14 +249,17 @@ static int decsrtInit( hb_work_object_t * w, hb_job_t * job )
                 retval = 0;
             }
         }
-        chapter = hb_list_item( title->list_chapter, i - 1 );
-
-        if( chapter )
+        pv->stop_time = pv->start_time;
+        for( i = job->chapter_start; i <= job->chapter_end; ++i )
         {
-            pv->stop_time = pv->start_time + chapter->duration;
-        } else {
-            hb_error( "Could not locate chapter %d for SRT stop time", i );
-            retval = 0;
+            chapter = hb_list_item( title->list_chapter, i - 1 );
+            if( chapter )
+            {
+                pv->stop_time += chapter->duration;
+            } else {
+                hb_error( "Could not locate chapter %d for SRT start time", i );
+                retval = 0;
+            }
         }
 
         hb_deep_log( 3, "SRT Start time %"PRId64", stop time %"PRId64, pv->start_time, pv->stop_time);