Skip to content

Commit 6ac181f

Browse files
committed
update ffmpeg patches
1 parent f4f8498 commit 6ac181f

19 files changed

+819
-812
lines changed

patches/ffmpeg-release-5.1/0001-15-h264_ps-null-pointer-fault-tolerant.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 8d2dac9be4b04467c7d6bf4b4d3785adb8482a3f Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
33
Date: Mon, 22 May 2023 17:21:37 +0800
4-
Subject: [PATCH 01/15] h264_ps null pointer fault tolerant
4+
Subject: [PATCH 01/17] h264_ps null pointer fault tolerant
55

66
---
77
libavcodec/h264_ps.c | 8 ++++----

patches/ffmpeg-release-5.1/0002-flv-support-hevc.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 7b857db7e5c334b873ca7a113b47a35e5b1106e0 Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
33
Date: Mon, 22 May 2023 17:27:59 +0800
4-
Subject: [PATCH 02/15] flv support hevc
4+
Subject: [PATCH 02/17] flv support hevc
55

66
---
77
libavformat/flv.h | 1 +
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 2b7025ea0b9f72c365f7ce79ba462496e07e9a3d Mon Sep 17 00:00:00 2001
2+
From: qianlongxu <qianlongxu@gmail.com>
3+
Date: Wed, 22 May 2024 14:24:29 +0800
4+
Subject: [PATCH 03/17] correct file seekable value range, 0 means streamed can't
5+
seek, 1 means not streamed can seek.
6+
7+
---
8+
libavformat/file.c | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/libavformat/file.c b/libavformat/file.c
12+
index 98c9e81..a35dfca 100644
13+
--- a/libavformat/file.c
14+
+++ b/libavformat/file.c
15+
@@ -85,7 +85,7 @@ static const AVOption file_options[] = {
16+
{ "truncate", "truncate existing files on write", offsetof(FileContext, trunc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
17+
{ "blocksize", "set I/O operation maximum block size", offsetof(FileContext, blocksize), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
18+
{ "follow", "Follow a file as it is being written", offsetof(FileContext, follow), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
19+
- { "seekable", "Sets if the file is seekable", offsetof(FileContext, seekable), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 0, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
20+
+ { "seekable", "Sets if the file is seekable", offsetof(FileContext, seekable), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
21+
{ NULL }
22+
};
23+
24+
--
25+
2.39.3 (Apple Git-146)
26+

patches/ffmpeg-release-5.1/0003-file-use-file_seek.patch

Lines changed: 0 additions & 33 deletions
This file was deleted.

patches/ffmpeg-release-5.1/0004-restore-ijk-custom-protocols-except-long.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 3c3b8cd1efb6e28fccd4b964531c21bf0fc94c26 Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
33
Date: Tue, 23 Jan 2024 15:32:33 +0800
4-
Subject: [PATCH 04/15] restore ijk custom protocols except long url
4+
Subject: [PATCH 04/17] restore ijk custom protocols except long url
55

66
---
77
libavcodec/Makefile | 1 +

patches/ffmpeg-release-5.1/0005-hls-support-discontinuity.patch renamed to patches/ffmpeg-release-5.1/0005-hls-support-discontinuity-tag.patch

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
From ad70425a954678c0cbcb779b15d2bc3cd0d36f0f Mon Sep 17 00:00:00 2001
1+
From dc595d866ab9a0a67331b10dc969b434ab5e4e6b Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
3-
Date: Mon, 12 Jun 2023 16:15:15 +0800
4-
Subject: [PATCH 05/15] hls support discontinuity
3+
Date: Wed, 22 May 2024 14:55:43 +0800
4+
Subject: [PATCH 05/17] hls support discontinuity tag
55

66
---
7-
libavformat/hls.c | 60 +++++++++++++++++++++++++++++++++++++++++------
8-
1 file changed, 53 insertions(+), 7 deletions(-)
7+
libavformat/hls.c | 59 +++++++++++++++++++++++++++++++++++++++++------
8+
1 file changed, 52 insertions(+), 7 deletions(-)
99

1010
diff --git a/libavformat/hls.c b/libavformat/hls.c
11-
index bf7fdc1..2e3bff6 100644
11+
index bf7fdc1..6cf1fc2 100644
1212
--- a/libavformat/hls.c
1313
+++ b/libavformat/hls.c
1414
@@ -73,6 +73,8 @@ enum KeyType {
@@ -20,15 +20,7 @@ index bf7fdc1..2e3bff6 100644
2020
int64_t duration;
2121
int64_t url_offset;
2222
int64_t size;
23-
@@ -686,6 +688,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
24-
25-
av_dict_copy(&tmp, *opts, 0);
26-
av_dict_copy(&tmp, opts2, 0);
27-
+ av_dict_set(&tmp, "seekable", "1", 0);
28-
29-
if (is_http && c->http_persistent && *pb) {
30-
ret = open_url_keepalive(c->ctx, pb, url, &tmp);
31-
@@ -726,6 +729,8 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
23+
@@ -726,6 +728,8 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
3224
static int parse_playlist(HLSContext *c, const char *url,
3325
struct playlist *pls, AVIOContext *in)
3426
{
@@ -37,15 +29,15 @@ index bf7fdc1..2e3bff6 100644
3729
int ret = 0, is_segment = 0, is_variant = 0;
3830
int64_t duration = 0;
3931
enum KeyType key_type = KEY_NONE;
40-
@@ -797,6 +802,7 @@ static int parse_playlist(HLSContext *c, const char *url,
32+
@@ -797,6 +801,7 @@ static int parse_playlist(HLSContext *c, const char *url,
4133
pls->finished = 0;
4234
pls->type = PLS_TYPE_UNSPECIFIED;
4335
}
4436
+ int start_seq_no = -1;
4537
while (!avio_feof(in)) {
4638
ff_get_chomp_line(in, line, sizeof(line));
4739
if (av_strstart(line, "#EXT-X-STREAM-INF:", &ptr)) {
48-
@@ -846,7 +852,11 @@ static int parse_playlist(HLSContext *c, const char *url,
40+
@@ -846,7 +851,11 @@ static int parse_playlist(HLSContext *c, const char *url,
4941
"INT64_MAX/2, mask out the highest bit\n");
5042
seq_no &= INT64_MAX/2;
5143
}
@@ -58,7 +50,7 @@ index bf7fdc1..2e3bff6 100644
5850
} else if (av_strstart(line, "#EXT-X-PLAYLIST-TYPE:", &ptr)) {
5951
ret = ensure_playlist(c, &pls, url);
6052
if (ret < 0)
61-
@@ -911,6 +921,8 @@ static int parse_playlist(HLSContext *c, const char *url,
53+
@@ -911,6 +920,8 @@ static int parse_playlist(HLSContext *c, const char *url,
6254
} else if (av_strstart(line, "#EXT-X-ENDLIST", &ptr)) {
6355
if (pls)
6456
pls->finished = 1;
@@ -67,7 +59,7 @@ index bf7fdc1..2e3bff6 100644
6759
} else if (av_strstart(line, "#EXTINF:", &ptr)) {
6860
is_segment = 1;
6961
duration = atof(ptr) * AV_TIME_BASE;
70-
@@ -986,6 +998,11 @@ static int parse_playlist(HLSContext *c, const char *url,
62+
@@ -986,6 +997,11 @@ static int parse_playlist(HLSContext *c, const char *url,
7163
" set to default value to 1ms.\n", seg->url);
7264
duration = 0.001 * AV_TIME_BASE;
7365
}
@@ -79,15 +71,15 @@ index bf7fdc1..2e3bff6 100644
7971
seg->duration = duration;
8072
seg->key_type = key_type;
8173
dynarray_add(&pls->segments, &pls->n_segments, seg);
82-
@@ -2292,6 +2309,7 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
74+
@@ -2292,6 +2308,7 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
8375
* stream */
8476
if (pls->needed && !pls->pkt->data) {
8577
while (1) {
8678
+ int64_t pkt_ts = AV_NOPTS_VALUE;
8779
int64_t ts_diff;
8880
AVRational tb;
8981
struct segment *seg = NULL;
90-
@@ -2305,12 +2323,40 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
82+
@@ -2305,12 +2322,40 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
9183
if (pls->is_id3_timestamped && pls->pkt->stream_index == 0) {
9284
/* audio elementary streams are id3 timestamped */
9385
fill_timing_for_id3_timestamped_stream(pls);
@@ -132,7 +124,7 @@ index bf7fdc1..2e3bff6 100644
132124
}
133125

134126
seg = current_segment(pls);
135-
@@ -2327,13 +2373,13 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
127+
@@ -2327,13 +2372,13 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
136128
if (pls->seek_stream_index < 0 ||
137129
pls->seek_stream_index == pls->pkt->stream_index) {
138130

@@ -149,5 +141,5 @@ index bf7fdc1..2e3bff6 100644
149141
pls->seek_timestamp;
150142
if (ts_diff >= 0 && (pls->seek_flags & AVSEEK_FLAG_ANY ||
151143
--
152-
2.39.3 (Apple Git-145)
144+
2.39.3 (Apple Git-146)
153145

patches/ffmpeg-release-5.1/0008-fix-ffmpeg-constructed-wrong-avcc-for-vi.patch renamed to patches/ffmpeg-release-5.1/0006-fix-ffmpeg-constructed-wrong-avcc-for-vi.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 742d238b20c760356ece1e23522e740fcfd8737f Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
33
Date: Mon, 16 May 2022 16:15:10 +0800
4-
Subject: [PATCH 08/15] fix ffmpeg constructed wrong avcc for
4+
Subject: [PATCH 06/17] fix ffmpeg constructed wrong avcc for
55
videotoolbox hwaccel.
66

77
---

0 commit comments

Comments
 (0)