]> granicus.if.org Git - handbrake/commitdiff
decavcodec: fix wmapro audio timestamps
authorJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 19 Jun 2017 21:54:24 +0000 (14:54 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 19 Jun 2017 21:55:21 +0000 (14:55 -0700)
Fixes https://github.com/HandBrake/HandBrake/issues/717

libhb/decavcodec.c

index cf62002fe2043ac49a07bc3632893705de638354..a6f120800afddbd353d1f084a0da58f4d93927be 100644 (file)
@@ -1987,6 +1987,13 @@ static void decodeAudio(hb_work_private_t *pv, packet_info_t * packet_info)
     AVPacket         avp;
     int              ret;
 
+    // libav does not supply timestamps for wmapro audio (possibly others)
+    // if there is an input timestamp, initialize next_pts
+    if (pv->next_pts     == (int64_t)AV_NOPTS_VALUE &&
+        packet_info->pts !=          AV_NOPTS_VALUE)
+    {
+        pv->next_pts = packet_info->pts;
+    }
     av_init_packet(&avp);
     if (packet_info != NULL)
     {