From e5f1bf73d573f8d4689c13ee424bd6c132f1dd8b Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <randrianasulu@gmail.com>
Date: Mon, 4 Apr 2022 04:36:39 +0300
Subject: [PATCH 69/71] Really fix ffmpeg.C for ffmpeg 4.4

---
 cinelerra-5.1/cinelerra/ffmpeg.C | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
index ff03e85e..14c1171c 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
@@ -733,7 +733,11 @@ int FFStream::seek(int64_t no, double rate)
 	int nb_index_entries = avformat_index_get_entries_count(st);
 #endif
 	if( !tstmp ) {
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59,16,100)
 		if( nb_index_entries > 0 ) tstmp = (avformat_index_get_entry(st, 0))->timestamp;
+#else
+		if( st->nb_index_entries > 0 ) tstmp = st->index_entries[0].timestamp;
+#endif
 		else if( st->start_time != AV_NOPTS_VALUE ) tstmp = st->start_time;
 #if LIBAVCODEC_VERSION_INT  <= AV_VERSION_INT(58,134,100)
 		else if( st->first_dts != AV_NOPTS_VALUE ) tstmp = st->first_dts;
-- 
2.35.1

