Description: Rescale frame timestamps
 Without this, the timestamps are wrong with most codecs, making the
 output garbage.
Author: Thibaut Paumard <thibaut@debian.org>
Origin: vendor
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890880
Forwarded: not-needed
Applied-Upstream: ed6b754e03f280708991f579db42dca136431c35
Last-Update: 2018-02-20
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/yav.c
+++ b/yav.c
@@ -391,6 +391,7 @@
     AVPacket pkt;
     av_init_packet(&pkt);
     pkt.flags |= AV_PKT_FLAG_KEY;
+    av_packet_rescale_ts(&pkt, c->time_base, obj->video_st->time_base);
     pkt.stream_index = obj->video_st->index;
     pkt.data= obj->video_outbuf;
     // pkt.size= out_size;
@@ -408,6 +409,7 @@
     }
     /* If size is zero, it means the image was buffered. */
     if (!ret && got_packet && pkt.size) {
+      av_packet_rescale_ts(&pkt, c->time_base, obj->video_st->time_base);
       pkt.stream_index = obj->video_st->index;
       /* Write the compressed frame to the media file. */
       ret = av_interleaved_write_frame(obj->oc, &pkt);
