]> git.sesse.net Git - ffmpeg/commitdiff
lavf: move AVStream.interleaver_chunk_* to AVStreamInternal
authorAnton Khirnov <anton@khirnov.net>
Fri, 9 Oct 2020 07:22:36 +0000 (09:22 +0200)
committerAnton Khirnov <anton@khirnov.net>
Wed, 28 Oct 2020 13:58:28 +0000 (14:58 +0100)
Those are private fields, no reason to have them exposed in a public
header.

libavformat/avformat.h
libavformat/internal.h
libavformat/mux.c

index 8c4ae9e6e5e00529ad79f5238ac5364891ca8557..ae32f78393b501bb2f6a393b61f37da2c0844a0b 100644 (file)
@@ -1106,9 +1106,6 @@ typedef struct AVStream {
     int pmt_version;
     int pmt_stream_idx;
 
-    int64_t interleaver_chunk_size;
-    int64_t interleaver_chunk_duration;
-
     /**
      * An opaque field for libavformat internal usage.
      * Must not be accessed in any way by callers.
index d8ceebb26e0a6f40e25567be330215192cd0c271..87d62c51b2b40dc48d4441cbfcf8b88cada60a23 100644 (file)
@@ -225,6 +225,9 @@ struct AVStreamInternal {
 
     } *info;
 
+    int64_t interleaver_chunk_size;
+    int64_t interleaver_chunk_duration;
+
     /**
      * stream probing state
      * -1   -> probing finished
index 8a2d6370f63978d68589a316086c59402921820d..8a53f0feebd91310b912c8520b25f95aa8e90676 100644 (file)
@@ -839,19 +839,19 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
 
     if (chunked) {
         uint64_t max= av_rescale_q_rnd(s->max_chunk_duration, AV_TIME_BASE_Q, st->time_base, AV_ROUND_UP);
-        st->interleaver_chunk_size     += pkt->size;
-        st->interleaver_chunk_duration += pkt->duration;
-        if (   (s->max_chunk_size && st->interleaver_chunk_size > s->max_chunk_size)
-            || (max && st->interleaver_chunk_duration           > max)) {
-            st->interleaver_chunk_size = 0;
+        st->internal->interleaver_chunk_size     += pkt->size;
+        st->internal->interleaver_chunk_duration += pkt->duration;
+        if (   (s->max_chunk_size && st->internal->interleaver_chunk_size > s->max_chunk_size)
+            || (max && st->internal->interleaver_chunk_duration           > max)) {
+            st->internal->interleaver_chunk_size = 0;
             pkt->flags |= CHUNK_START;
-            if (max && st->interleaver_chunk_duration > max) {
+            if (max && st->internal->interleaver_chunk_duration > max) {
                 int64_t syncoffset = (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)*max/2;
                 int64_t syncto = av_rescale(pkt->dts + syncoffset, 1, max)*max - syncoffset;
 
-                st->interleaver_chunk_duration += (pkt->dts - syncto)/8 - max;
+                st->internal->interleaver_chunk_duration += (pkt->dts - syncto)/8 - max;
             } else
-                st->interleaver_chunk_duration = 0;
+                st->internal->interleaver_chunk_duration = 0;
         }
     }
     if (*next_point) {