OSDN Git Service

possible fix for WDTV vobsub duration problem
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 5 Nov 2009 22:50:06 +0000 (22:50 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 5 Nov 2009 22:50:06 +0000 (22:50 +0000)
There were 2 problems
1. The duration was not being written to the mkv track.  Other players use
   the timestamps in the vobsub.  WDTV appears to use the duration in the mkv.
2. The vobsub timestamps were being rewritten improperly in sync.c.  They
   don't need to be rewritten at all.

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

libhb/muxmkv.c
libhb/sync.c

index 2e8814c..f179cb7 100644 (file)
@@ -404,24 +404,24 @@ static int MKVMux( hb_mux_object_t * m, hb_mux_data_t * mux_data,
     }
     else if ( mux_data->subtitle )
     {
+        uint64_t   duration;
         timecode = buf->start * TIMECODE_SCALE;
         if( mk_startFrame(m->file, mux_data->track) < 0)
         {
             hb_error( "Failed to write frame to output file, Disk Full?" );
             *job->die = 1;
         }
+
+        duration = buf->stop * TIMECODE_SCALE - timecode;
         if( mux_data->sub_format == TEXTSUB )
         {
-            uint64_t   duration;
-
-            duration = buf->stop * TIMECODE_SCALE - timecode;
             mk_addFrameData(m->file, mux_data->track, buf->data, buf->size);
             mk_setFrameFlags(m->file, mux_data->track, timecode, 1, duration);
         }
         else
         {
             mk_addFrameData(m->file, mux_data->track, buf->data, buf->size);
-            mk_setFrameFlags(m->file, mux_data->track, timecode, 1, 0);
+            mk_setFrameFlags(m->file, mux_data->track, timecode, 1, duration);
         }
         mk_flushFrame(m->file, mux_data->track);
         return 0;
index 1ceeee9..514b1fb 100644 (file)
@@ -483,8 +483,6 @@ static void SyncVideo( hb_work_object_t * w )
                          */
                         if( sub->start < cur->start )
                         {
-                            uint64_t duration;
-                            duration = sub->stop - sub->start;
                             sub = hb_fifo_get( subtitle->fifo_raw );
                             hb_fifo_push( subtitle->fifo_out, sub );
                         } else {
@@ -664,16 +662,8 @@ static void SyncVideo( hb_work_object_t * w )
                         } else {
                             /*
                              * Pass-Through, pop it off of the raw queue, 
-                             * rewrite times and make it available to be 
-                             * reencoded.
                              */
-                            uint64_t sub_duration;
                             sub = hb_fifo_get( subtitle->fifo_raw );
-                            sub_duration = sub->stop - sub->start;
-                            sub->start = cur->start;
-                            buf_tmp = hb_fifo_see( job->fifo_raw );
-                            int64_t duration = buf_tmp->start - cur->start;
-                            sub->stop = sub->start + duration;
                             hb_fifo_push( subtitle->fifo_sync, sub );
                         }
                     } else {