Skip to content

Commit 09e4723

Browse files
committed
add two ffmpeg patches
1 parent fa3fd2d commit 09e4723

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
From 4a89fee5b4793c8a116d3d33b712601fb6abddcf Mon Sep 17 00:00:00 2001
2+
From: qianlongxu <qianlongxu@gmail.com>
3+
Date: Thu, 17 Apr 2025 10:21:12 +0800
4+
Subject: [PATCH 30] not very useful log use trace level
5+
6+
---
7+
libavcodec/h2645_parse.c | 6 +++---
8+
libavcodec/h2645_vui.c | 2 +-
9+
libavformat/demux.c | 4 ++--
10+
3 files changed, 6 insertions(+), 6 deletions(-)
11+
12+
diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
13+
index 28db465..ac9e151 100644
14+
--- a/libavcodec/h2645_parse.c
15+
+++ b/libavcodec/h2645_parse.c
16+
@@ -353,7 +353,7 @@ static int vvc_parse_nal_header(H2645NAL *nal, void *logctx)
17+
if ((nal->type >= VVC_IDR_W_RADL && nal->type <= VVC_RSV_IRAP_11) && nal->temporal_id)
18+
return AVERROR_INVALIDDATA;
19+
20+
- av_log(logctx, AV_LOG_DEBUG,
21+
+ av_log(logctx, AV_LOG_TRACE,
22+
"nal_unit_type: %d(%s), nuh_layer_id: %d, temporal_id: %d\n",
23+
nal->type, vvc_nal_unit_name(nal->type), nal->nuh_layer_id, nal->temporal_id);
24+
25+
@@ -374,7 +374,7 @@ static int hevc_parse_nal_header(H2645NAL *nal, void *logctx)
26+
if (nal->temporal_id < 0)
27+
return AVERROR_INVALIDDATA;
28+
29+
- av_log(logctx, AV_LOG_DEBUG,
30+
+ av_log(logctx, AV_LOG_TRACE,
31+
"nal_unit_type: %d(%s), nuh_layer_id: %d, temporal_id: %d\n",
32+
nal->type, hevc_nal_unit_name(nal->type), nal->nuh_layer_id, nal->temporal_id);
33+
34+
@@ -391,7 +391,7 @@ static int h264_parse_nal_header(H2645NAL *nal, void *logctx)
35+
nal->ref_idc = get_bits(gb, 2);
36+
nal->type = get_bits(gb, 5);
37+
38+
- av_log(logctx, AV_LOG_DEBUG,
39+
+ av_log(logctx, AV_LOG_TRACE,
40+
"nal_unit_type: %d(%s), nal_ref_idc: %d\n",
41+
nal->type, h264_nal_unit_name(nal->type), nal->ref_idc);
42+
43+
diff --git a/libavcodec/h2645_vui.c b/libavcodec/h2645_vui.c
44+
index e5c7bf4..8301492 100644
45+
--- a/libavcodec/h2645_vui.c
46+
+++ b/libavcodec/h2645_vui.c
47+
@@ -36,7 +36,7 @@
48+
49+
void ff_h2645_decode_common_vui_params(GetBitContext *gb, H2645VUI *vui, void *logctx)
50+
{
51+
- av_log(logctx, AV_LOG_DEBUG, "Decoding VUI\n");
52+
+ av_log(logctx, AV_LOG_TRACE, "Decoding VUI\n");
53+
54+
vui->aspect_ratio_info_present_flag = get_bits1(gb);
55+
if (vui->aspect_ratio_info_present_flag) {
56+
diff --git a/libavformat/demux.c b/libavformat/demux.c
57+
index 15807f6..535acaf 100644
58+
--- a/libavformat/demux.c
59+
+++ b/libavformat/demux.c
60+
@@ -1979,11 +1979,11 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
61+
for (unsigned i = 0; i < ic->nb_streams; i++) {
62+
AVStream *const st = ic->streams[i];
63+
if (st->time_base.den)
64+
- av_log(ic, AV_LOG_TRACE, "stream %u: start_time: %s duration: %s\n", i,
65+
+ av_log(ic, AV_LOG_DEBUG, "stream %u: start_time: %s duration: %s\n", i,
66+
av_ts2timestr(st->start_time, &st->time_base),
67+
av_ts2timestr(st->duration, &st->time_base));
68+
}
69+
- av_log(ic, AV_LOG_TRACE,
70+
+ av_log(ic, AV_LOG_DEBUG,
71+
"format: start_time: %s duration: %s (estimate from %s) bitrate=%"PRId64" kb/s\n",
72+
av_ts2timestr(ic->start_time, &AV_TIME_BASE_Q),
73+
av_ts2timestr(ic->duration, &AV_TIME_BASE_Q),
74+
--
75+
2.39.5 (Apple Git-154)
76+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 3f0966825de7bf6ff6cb858c70f197fbeafe3419 Mon Sep 17 00:00:00 2001
2+
From: qianlongxu <qianlongxu@gmail.com>
3+
Date: Thu, 17 Apr 2025 10:36:54 +0800
4+
Subject: [PATCH 31] let avio can retry when avio encounter error but not eof
5+
6+
---
7+
libavformat/aviobuf.c | 5 ++++-
8+
1 file changed, 4 insertions(+), 1 deletion(-)
9+
10+
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
11+
index 2899c75..06012b7 100644
12+
--- a/libavformat/aviobuf.c
13+
+++ b/libavformat/aviobuf.c
14+
@@ -569,7 +569,10 @@ static void fill_buffer(AVIOContext *s)
15+
s->eof_reached = 1;
16+
17+
/* no need to do anything if EOF already reached */
18+
- if (s->eof_reached)
19+
+ /* when "len = read_packet_wrapper(s, dst, len);" has error, eof_reached marked to 1
20+
+ * in effect the stream not eof but encounter network error
21+
+ */
22+
+ if (s->eof_reached && !s->error)
23+
return;
24+
25+
if (s->update_checksum && dst == s->buffer) {
26+
--
27+
2.39.5 (Apple Git-154)
28+

0 commit comments

Comments
 (0)