Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build against FFmpeg5.1 #51

Closed
umlaeute opened this issue Aug 30, 2022 · 0 comments
Closed

Unable to build against FFmpeg5.1 #51

umlaeute opened this issue Aug 30, 2022 · 0 comments

Comments

@umlaeute
Copy link

Similar to x42/harvid#11, xjadeo also fails to build with FFmpeg-5.1 (see the harvid issue for details).

here's a more radical approach, that just unconditionally calls avcodec_flush_buffers() for all ffmpeg-versions:

--- xjadeo.orig/src/xjadeo/xjadeo.c
+++ xjadeo/src/xjadeo/xjadeo.c
@@ -575,9 +575,7 @@
 			seek = av_seek_frame (pFormatCtx, videoStream, fidx[framenumber].seekpts, AVSEEK_FLAG_BACKWARD);
 		}
 
-		if (pCodecCtx->codec->flush) {
-			avcodec_flush_buffers (pCodecCtx);
-		}
+		avcodec_flush_buffers (pCodecCtx);
 
 		if (seek < 0) {
 			if (!want_quiet)
@@ -915,9 +913,7 @@
 			error |= 16;
 			break;
 		}
-		if (pCodecCtx->codec->flush) {
-			avcodec_flush_buffers (pCodecCtx);
-		}
+		avcodec_flush_buffers (pCodecCtx);
 
 		int err = 0;
 		int bailout = 100;
@@ -1053,9 +1049,7 @@
 			printf("NOBYTE 2\n");
 			break;
 		}
-		if (pCodecCtx->codec->flush) {
-			avcodec_flush_buffers (pCodecCtx);
-		}
+		avcodec_flush_buffers (pCodecCtx);
 
 		int64_t pts = AV_NOPTS_VALUE;
 		while (!got_pic) {
@@ -1118,9 +1112,7 @@
 		} else {
 			av_seek_frame (pFormatCtx, videoStream, fidx[i].seekpts, AVSEEK_FLAG_BACKWARD);
 		}
-		if (pCodecCtx->codec->flush) {
-			avcodec_flush_buffers (pCodecCtx);
-		}
+		avcodec_flush_buffers (pCodecCtx);
 		while (!got_pic) {
 
 			if (av_read_frame (pFormatCtx, &packet) < 0) {
@@ -1192,9 +1184,7 @@
 	}
 
 	av_seek_frame (pFormatCtx, videoStream, 0, AVSEEK_FLAG_BACKWARD);
-	if (pCodecCtx->codec->flush) {
-		avcodec_flush_buffers (pCodecCtx);
-	}
+	avcodec_flush_buffers (pCodecCtx);
 	if (!error) {
 		scan_complete = 1;
 	}
@x42 x42 closed this as completed in 973f004 Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant