1
- From b5176510c15322f2223c5e16af20e65be98db163 Mon Sep 17 00:00:00 2001
1
+ From 7f96723900b9103059abc487f57aa34e049e8e9c Mon Sep 17 00:00:00 2001
2
2
From: qianlongxu <qianlongxu@gmail.com>
3
- Date: Wed, 19 Mar 2025 13:22:27 +0800
4
- Subject: [PATCH 29 ] bluray protocol add dvd fallback
3
+ Date: Fri, 28 Mar 2025 11:15:04 +0800
4
+ Subject: [PATCH 27 ] bluray protocol add dvd fallback
5
5
6
6
---
7
- libavformat/demux.c | 24 +++++++++++++++++++++---
8
- 1 file changed, 21 insertions(+), 3 deletions(-)
7
+ libavformat/demux.c | 31 ++++++++++++++++++++++++++-- ---
8
+ 1 file changed, 26 insertions(+), 5 deletions(-)
9
9
10
10
diff --git a/libavformat/demux.c b/libavformat/demux.c
11
- index 51fff7b..05e02db 100644
11
+ index 3c8f194..5620e0f 100644
12
12
--- a/libavformat/demux.c
13
13
+++ b/libavformat/demux.c
14
- @@ -158,7 +158,10 @@ static int init_input(AVFormatContext *s, const char *filename,
14
+ @@ -158,7 +158,8 @@ static int init_input(AVFormatContext *s, const char *filename,
15
15
int ret;
16
16
AVProbeData pd = { filename, NULL, 0 };
17
17
int score = AVPROBE_SCORE_RETRY;
18
18
-
19
19
+ AVDictionary *tmp_opts = NULL;
20
- + if (options && (av_stristart(filename, "bluray://", NULL) || av_stristart(filename, "dvd://", NULL))) {
21
- + av_dict_copy(&tmp_opts, *options, 0);
22
- + }
20
+ +
23
21
if (s->pb) {
24
22
s->flags |= AVFMT_FLAG_CUSTOM_IO;
25
23
if (!s->iformat)
26
- @@ -174,8 +177,23 @@ static int init_input(AVFormatContext *s, const char *filename,
24
+ @@ -173,10 +174,30 @@ static int init_input(AVFormatContext *s, const char *filename,
25
+ if ((s->iformat && s->iformat->flags & AVFMT_NOFILE) ||
27
26
(!s->iformat && (s->iformat = av_probe_input_format2(&pd, 0, &score))))
28
27
return score;
29
-
28
+ -
30
29
- if ((ret = s->io_open(s, &s->pb, filename, AVIO_FLAG_READ | s->avio_flags, options)) < 0)
31
30
- return ret;
31
+ -
32
+ +
33
+ + if (options && (av_stristart(filename, "bluray://", NULL) || av_stristart(filename, "dvd://", NULL))) {
34
+ + av_dict_copy(&tmp_opts, *options, 0);
35
+ + }
36
+ +
32
37
+ if ((ret = s->io_open(s, &s->pb, filename, AVIO_FLAG_READ | s->avio_flags,
33
38
+ options)) < 0) {
34
39
+ if (av_stristart(filename, "bluray://", NULL)) {
@@ -43,12 +48,14 @@ index 51fff7b..05e02db 100644
43
48
+ av_dict_free(&tmp_opts);
44
49
+ return ret;
45
50
+ } else {
51
+ + av_dict_free(&tmp_opts);
46
52
+ return ret;
47
53
+ }
48
54
+ }
49
-
55
+ + av_dict_free(&tmp_opts);
50
56
if (s->iformat)
51
57
return 0;
58
+ return av_probe_input_buffer2(s->pb, &s->iformat, filename,
52
59
- -
53
60
2.39.5 (Apple Git-154)
54
61
0 commit comments