shithub: treason

Download patch

ref: d02ead46e224157689db029b70f8fb0f40409738
parent: b6f90701508babfab5fec9c71f6f43a72c933737
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Fri May 14 18:33:05 EDT 2021

h264: ignore flushed frames with past timestamps

--- a/decoder_h264.c	Tue Mar  2 12:39:13 2021
+++ b/decoder_h264.c	Fri May 14 18:33:05 2021
@@ -310,9 +310,11 @@
 					flush(a);
 					ts = a->info.uiOutYuvTimeStamp;
 					if(ts < lasttimestamp){
-						werrstr("wrong timestamp at flush: %llud < %llud", ts, lasttimestamp);
-						res = -1;
-						break;
+						/* FIXME this happens in some videos... */
+						//werrstr("wrong timestamp at flush: %llud < %llud", ts, lasttimestamp);
+						//res = -1;
+						//break;
+						continue;
 					}
 					if(sendframe(a, (ts - lasttimestamp) * d->timebase * 1000000000ULL, d->frames) < 0)
 						goto done;