Skip to content

Commit ea78a22

Browse files
committed
fix add dummy demuxer bug
1 parent e7d68f3 commit ea78a22

File tree

1 file changed

+63
-7
lines changed

1 file changed

+63
-7
lines changed

patches/ffmpeg-n7.1.1/0009-add-3-dummy-ijkhttp-protocols.patch

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,53 @@
1-
From 8fe7e70aa2feb98f199e1d3c91afb435f6db25aa Mon Sep 17 00:00:00 2001
1+
From 7393491965cf7d321c16cd8409de1e51956e6ff7 Mon Sep 17 00:00:00 2001
22
From: qianlongxu <[email protected]>
3-
Date: Fri, 30 May 2025 09:24:42 +0800
3+
Date: Thu, 11 Sep 2025 15:27:28 +0800
44
Subject: [PATCH] add 3 dummy ijkhttp protocols
55

66
---
7-
libavformat/ijkutils.c | 3 +++
8-
libavformat/protocols.c | 3 +++
9-
2 files changed, 6 insertions(+)
7+
libavformat/allformats.c | 14 +++++++-------
8+
libavformat/ijkutils.c | 11 +++++++++++
9+
libavformat/protocols.c | 3 +++
10+
3 files changed, 21 insertions(+), 7 deletions(-)
1011

12+
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
13+
index dbae42e..31a9509 100644
14+
--- a/libavformat/allformats.c
15+
+++ b/libavformat/allformats.c
16+
@@ -576,14 +576,14 @@ extern const FFInputFormat ff_libmodplug_demuxer;
17+
extern const FFInputFormat ff_libopenmpt_demuxer;
18+
extern const FFInputFormat ff_vapoursynth_demuxer;
19+
20+
-// ijk
21+
-extern AVInputFormat ff_ijklivehook_demuxer;
22+
-extern AVInputFormat ff_ijklas_demuxer;
23+
+// ijk custom demuxers
24+
+extern FFInputFormat ff_ijklivehook_demuxer;
25+
+extern FFInputFormat ff_ijklas_demuxer;
26+
27+
-extern AVInputFormat ff_ijkplaceholder1_demuxer;
28+
-extern AVInputFormat ff_ijkplaceholder2_demuxer;
29+
-extern AVInputFormat ff_ijkplaceholder3_demuxer;
30+
-extern AVInputFormat ff_ijkplaceholder4_demuxer;
31+
+extern FFInputFormat ff_ijkplaceholder1_demuxer;
32+
+extern FFInputFormat ff_ijkplaceholder2_demuxer;
33+
+extern FFInputFormat ff_ijkplaceholder3_demuxer;
34+
+extern FFInputFormat ff_ijkplaceholder4_demuxer;
35+
36+
#include "libavformat/muxer_list.c"
37+
#include "libavformat/demuxer_list.c"
1138
diff --git a/libavformat/ijkutils.c b/libavformat/ijkutils.c
12-
index 604e725..2f36c69 100644
39+
index 604e725..ddecc30 100644
1340
--- a/libavformat/ijkutils.c
1441
+++ b/libavformat/ijkutils.c
15-
@@ -64,6 +64,9 @@ IJK_DUMMY_PROTOCOL(ijkhttphook);
42+
@@ -56,6 +56,7 @@ URLProtocol ff_##x##_protocol = { \
43+
44+
static int ijkdummy_open(URLContext *h, const char *arg, int flags, AVDictionary **options)
45+
{
46+
+ av_log(NULL, AV_LOG_ERROR, "you called a dummp protocol:%s\n", h->prot->name);
47+
return -1;
48+
}
49+
50+
@@ -64,6 +65,9 @@ IJK_DUMMY_PROTOCOL(ijkhttphook);
1651
IJK_DUMMY_PROTOCOL(ijksegment);
1752
IJK_DUMMY_PROTOCOL(ijktcphook);
1853
IJK_DUMMY_PROTOCOL(ijkio);
@@ -22,6 +57,27 @@ index 604e725..2f36c69 100644
2257

2358
#define IJK_FF_DEMUXER(x) \
2459
extern FFInputFormat ff_##x##_demuxer; \
60+
@@ -78,6 +82,12 @@ int ijkav_register_##x##_demuxer(FFInputFormat *demuxer, int demuxer_size)
61+
return 0; \
62+
}
63+
64+
+static int ijkdummy_probe(const AVProbeData *p)
65+
+{
66+
+ av_log(NULL, AV_LOG_ERROR, "you called a dummp demuxer\n");
67+
+ return AVERROR_INVALIDDATA;
68+
+}
69+
+
70+
#define IJK_DUMMY_DEMUXER(x) \
71+
IJK_FF_DEMUXER(x); \
72+
static const AVClass ijk_##x##_demuxer_class = { \
73+
@@ -91,6 +101,7 @@ FFInputFormat ff_##x##_demuxer = { \
74+
.p.priv_class = &ijk_##x##_demuxer_class, \
75+
.priv_data_size = 1, \
76+
.flags_internal = FF_INFMT_FLAG_INIT_CLEANUP, \
77+
+ .read_probe = ijkdummy_probe, \
78+
};
79+
80+
/*
2581
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
2682
index 719caf8..b291b9f 100644
2783
--- a/libavformat/protocols.c

0 commit comments

Comments
 (0)