]> granicus.if.org Git - handbrake/commitdiff
decavcodec: recompute frame duration for every frame
authorJohn Stebbins <jstebbins.hb@gmail.com>
Sun, 28 Feb 2016 21:54:18 +0000 (14:54 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Sun, 28 Feb 2016 21:54:18 +0000 (14:54 -0700)
It can change mid-stream

libhb/decavcodec.c

index c7ed9494bc02de6c21674f29c5298b0bab35ad1f..0a45b4ca9a38e951055fd5c960c47e283b0fd5c4 100644 (file)
@@ -1307,8 +1307,9 @@ static int decodeFrame( hb_work_object_t *w, uint8_t *data, int size, int sequen
         // point frame.pts should hold the frame's pts from the original data
         // stream or AV_NOPTS_VALUE if it didn't have one. in the latter case
         // we generate the next pts in sequence for it.
-        if ( !pv->frame_duration_set )
-            compute_frame_duration( pv );
+
+        // recompute the frame/field duration, because sometimes it changes
+        compute_frame_duration( pv );
 
         double pts;
         double frame_dur = pv->duration;