aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-10-09 09:22:36 +0200
committerAnton Khirnov <anton@khirnov.net>2020-10-28 14:54:35 +0100
commit36d7c1dee8d1fa1d81130932d2df93a8866c535f (patch)
treea1a6a298c5c918d7e53546a014589d576e6ea0a3
parent25bade3258af48ba309cee5a0c668a8c70334d04 (diff)
downloadffmpeg-36d7c1dee8d1fa1d81130932d2df93a8866c535f.tar.gz
lavf: move AVStream.pts_reorder_error[_count] to AVStreamInternal
Those are private fields, no reason to have them exposed in a public header.
-rw-r--r--libavformat/avformat.h6
-rw-r--r--libavformat/internal.h6
-rw-r--r--libavformat/utils.c18
3 files changed, 15 insertions, 15 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 158c025e4a..da07e8981e 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1185,12 +1185,6 @@ typedef struct AVStream {
int update_initial_durations_done;
/**
- * Internal data to generate dts from pts
- */
- int64_t pts_reorder_error[MAX_REORDER_DELAY+1];
- uint8_t pts_reorder_error_count[MAX_REORDER_DELAY+1];
-
- /**
* An opaque field for libavformat internal usage.
* Must not be accessed in any way by callers.
*/
diff --git a/libavformat/internal.h b/libavformat/internal.h
index c9eca1babb..95cb5b5d60 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -226,6 +226,12 @@ struct AVStreamInternal {
} *info;
/**
+ * Internal data to generate dts from pts
+ */
+ int64_t pts_reorder_error[MAX_REORDER_DELAY+1];
+ uint8_t pts_reorder_error_count[MAX_REORDER_DELAY+1];
+
+ /**
* Internal data to analyze DTS and detect faulty mpeg streams
*/
int64_t last_dts_for_order_check;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 096ed2e648..1025ca219e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1027,8 +1027,8 @@ static int64_t select_from_pts_buffer(AVStream *st, int64_t *pts_buffer, int64_t
if (dts == AV_NOPTS_VALUE) {
int64_t best_score = INT64_MAX;
for (i = 0; i<delay; i++) {
- if (st->pts_reorder_error_count[i]) {
- int64_t score = st->pts_reorder_error[i] / st->pts_reorder_error_count[i];
+ if (st->internal->pts_reorder_error_count[i]) {
+ int64_t score = st->internal->pts_reorder_error[i] / st->internal->pts_reorder_error_count[i];
if (score < best_score) {
best_score = score;
dts = pts_buffer[i];
@@ -1039,13 +1039,13 @@ static int64_t select_from_pts_buffer(AVStream *st, int64_t *pts_buffer, int64_t
for (i = 0; i<delay; i++) {
if (pts_buffer[i] != AV_NOPTS_VALUE) {
int64_t diff = FFABS(pts_buffer[i] - dts)
- + (uint64_t)st->pts_reorder_error[i];
- diff = FFMAX(diff, st->pts_reorder_error[i]);
- st->pts_reorder_error[i] = diff;
- st->pts_reorder_error_count[i]++;
- if (st->pts_reorder_error_count[i] > 250) {
- st->pts_reorder_error[i] >>= 1;
- st->pts_reorder_error_count[i] >>= 1;
+ + (uint64_t)st->internal->pts_reorder_error[i];
+ diff = FFMAX(diff, st->internal->pts_reorder_error[i]);
+ st->internal->pts_reorder_error[i] = diff;
+ st->internal->pts_reorder_error_count[i]++;
+ if (st->internal->pts_reorder_error_count[i] > 250) {
+ st->internal->pts_reorder_error[i] >>= 1;
+ st->internal->pts_reorder_error_count[i] >>= 1;
}
}
}