1- From b5176510c15322f2223c5e16af20e65be98db163 Mon Sep 17 00:00:00 2001
1+ From 7f96723900b9103059abc487f57aa34e049e8e9c Mon Sep 17 00:00:00 2001
22From: qianlongxu <
[email protected] >
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
55
66---
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(-)
99
1010diff --git a/libavformat/demux.c b/libavformat/demux.c
11- index 51fff7b..05e02db 100644
11+ index 3c8f194..5620e0f 100644
1212--- a/libavformat/demux.c
1313+++ 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,
1515 int ret;
1616 AVProbeData pd = { filename, NULL, 0 };
1717 int score = AVPROBE_SCORE_RETRY;
1818-
1919+ 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+ +
2321 if (s->pb) {
2422 s->flags |= AVFMT_FLAG_CUSTOM_IO;
2523 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) ||
2726 (!s->iformat && (s->iformat = av_probe_input_format2(&pd, 0, &score))))
2827 return score;
29-
28+ -
3029- if ((ret = s->io_open(s, &s->pb, filename, AVIO_FLAG_READ | s->avio_flags, options)) < 0)
3130- 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+ +
3237+ if ((ret = s->io_open(s, &s->pb, filename, AVIO_FLAG_READ | s->avio_flags,
3338+ options)) < 0) {
3439+ if (av_stristart(filename, "bluray://", NULL)) {
@@ -43,12 +48,14 @@ index 51fff7b..05e02db 100644
4348+ av_dict_free(&tmp_opts);
4449+ return ret;
4550+ } else {
51+ + av_dict_free(&tmp_opts);
4652+ return ret;
4753+ }
4854+ }
49-
55+ + av_dict_free(&tmp_opts);
5056 if (s->iformat)
5157 return 0;
58+ return av_probe_input_buffer2(s->pb, &s->iformat, filename,
5259- -
53602.39.5 (Apple Git-154)
5461
0 commit comments