gcc, llvm: don't use -DNDEBUG
[kiss-trunc88.git] / ffmpeg / patches / vp9_dts_correction.patch
blob0e0e6c48641b163d53c2c6981313ee6f8b987625
1 From 16d4ca0761d7d8dcd64e6977903deebe903243e6 Mon Sep 17 00:00:00 2001
2 From: Danny Wu <admin@glados.cc>
3 Date: Wed, 12 May 2021 23:29:35 -0400
4 Subject: [PATCH] Fixes ticket 9086.
6 Since early 2021, some of YouTube's VP9 encodes have non-monotonous DTS.
7 This makes ffmpeg fatally fail when trying to copy or encode the V9 video.
9 ffmpeg already includes functionality to correct this, however it was
10 disabled for VP9 stream copies in 2e6636aa87303d37b112e79f093ca39500f92364
12 This patch restores the DTS correction logic, and allows ffmpeg to correctly
13 encode (invalid) videos produced by youtube.com. I have verified that frames
14 are NOT being cut (so it does not re-introduce 4313).
15 ---
16 fftools/ffmpeg.c | 1 -
17 1 file changed, 1 deletion(-)
19 diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
20 index 3ad11452da..67deb7762f 100644
21 --- a/fftools/ffmpeg.c
22 +++ b/fftools/ffmpeg.c
23 @@ -823,7 +823,6 @@ static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int u
25 if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) &&
26 pkt->dts != AV_NOPTS_VALUE &&
27 - !(st->codecpar->codec_id == AV_CODEC_ID_VP9 && ost->stream_copy) &&
28 ost->last_mux_dts != AV_NOPTS_VALUE) {
29 int64_t max = ost->last_mux_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT);
30 if (pkt->dts < max) {
31 --
32 2.17.1