Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold
@ 2023-04-27 14:25 Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 02/21] fftools/ffmpeg: reduce access to OutputStream.enc_ctx Anton Khirnov
                   ` (20 more replies)
  0 siblings, 21 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

This option has had no effect since -async was removed in
3d86a13b47b726e49c2d780c5f723c290e8a36b4
---
 doc/ffmpeg.texi      |  6 ------
 fftools/ffmpeg.h     |  2 +-
 fftools/ffmpeg_opt.c | 14 ++++++++++++--
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 34c413355e..0fea0bacb1 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -1749,12 +1749,6 @@ The default is -1.1. One possible usecase is to avoid framedrops in case
 of noisy timestamps or to increase frame drop precision in case of exact
 timestamps.
 
-@item -adrift_threshold @var{time}
-Set the minimum difference between timestamps and audio data (in seconds) to trigger
-adding/dropping samples to make it match the timestamps. This option effectively is
-a threshold to select between hard (add/drop) and soft (squeeze/stretch) compensation.
-@code{-async} must be set to a positive value.
-
 @item -apad @var{parameters} (@emph{output,per-stream})
 Pad the output audio stream(s). This is the same as applying @code{-af apad}.
 Argument is a string of filter parameters composed the same as with the @code{apad} filter.
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 95591f4bba..a41bc9b518 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -55,6 +55,7 @@
 #define FFMPEG_OPT_MAP_SYNC 1
 #define FFMPEG_ROTATION_METADATA 1
 #define FFMPEG_OPT_QPHIST 1
+#define FFMPEG_OPT_ADRIFT_THRESHOLD 1
 
 enum VideoSyncMethod {
     VSYNC_AUTO = -1,
@@ -728,7 +729,6 @@ extern int        nb_filtergraphs;
 extern char *vstats_filename;
 extern char *sdp_filename;
 
-extern float audio_drift_threshold;
 extern float dts_delta_threshold;
 extern float dts_error_threshold;
 
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index c99263b6a5..cf385c388e 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -1347,6 +1347,14 @@ static int opt_qphist(void *optctx, const char *opt, const char *arg)
 }
 #endif
 
+#if FFMPEG_OPT_ADRIFT_THRESHOLD
+static int opt_adrift_threshold(void *optctx, const char *opt, const char *arg)
+{
+    av_log(NULL, AV_LOG_WARNING, "Option -%s is deprecated and has no effect\n", opt);
+    return 0;
+}
+#endif
+
 #define OFFSET(x) offsetof(OptionsContext, x)
 const OptionDef options[] = {
     /* main options */
@@ -1453,8 +1461,10 @@ const OptionDef options[] = {
         "set video sync method globally; deprecated, use -fps_mode", "" },
     { "frame_drop_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT,      { &frame_drop_threshold },
         "frame drop threshold", "" },
-    { "adrift_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT,          { &audio_drift_threshold },
-        "audio drift threshold", "threshold" },
+#if FFMPEG_OPT_ADRIFT_THRESHOLD
+    { "adrift_threshold", HAS_ARG | OPT_EXPERT,                      { .func_arg = opt_adrift_threshold },
+        "deprecated, does nothing", "threshold" },
+#endif
     { "copyts",         OPT_BOOL | OPT_EXPERT,                       { &copy_ts },
         "copy timestamps" },
     { "start_at_zero",  OPT_BOOL | OPT_EXPERT,                       { &start_at_zero },
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 02/21] fftools/ffmpeg: reduce access to OutputStream.enc_ctx
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 03/21] fftools/ffmpeg: drop OutputStream.pict_type Anton Khirnov
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

It will be made private to Encoder in the future.
---
 fftools/ffmpeg.c     | 7 +++----
 fftools/ffmpeg_mux.c | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 15fe839914..1ae2c5c18f 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -649,8 +649,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
     av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC);
     av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC);
     for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
-        const AVCodecContext * const enc = ost->enc_ctx;
-        const float q = enc ? ost->quality / (float) FF_QP2LAMBDA : -1;
+        const float q = ost->enc ? ost->quality / (float) FF_QP2LAMBDA : -1;
 
         if (vid && ost->type == AVMEDIA_TYPE_VIDEO) {
             av_bprintf(&buf, "q=%2.1f ", q);
@@ -1155,7 +1154,7 @@ static int process_subtitle(InputStream *ist, AVSubtitle *subtitle, int *got_out
 
     for (int oidx = 0; oidx < ist->nb_outputs; oidx++) {
         OutputStream *ost = ist->outputs[oidx];
-        if (!ost->enc_ctx || ost->enc_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE)
+        if (!ost->enc || ost->type != AVMEDIA_TYPE_SUBTITLE)
             continue;
 
         enc_subtitle(output_files[ost->file_index], ost, subtitle);
@@ -1527,7 +1526,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
 
     for (int oidx = 0; oidx < ist->nb_outputs; oidx++) {
         OutputStream *ost = ist->outputs[oidx];
-        if (ost->enc_ctx || (!pkt && no_eof))
+        if (ost->enc || (!pkt && no_eof))
             continue;
 
         if (duration_exceeded) {
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index a19f1a1f1e..52f98fb76a 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -742,7 +742,7 @@ static void mux_final_stats(Muxer *mux)
 
         av_log(of, AV_LOG_VERBOSE, "  Output stream #%d:%d (%s): ",
                of->index, j, av_get_media_type_string(type));
-        if (ost->enc_ctx) {
+        if (ost->enc) {
             av_log(of, AV_LOG_VERBOSE, "%"PRIu64" frames encoded",
                    ost->frames_encoded);
             if (type == AVMEDIA_TYPE_AUDIO)
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 03/21] fftools/ffmpeg: drop OutputStream.pict_type
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 02/21] fftools/ffmpeg: reduce access to OutputStream.enc_ctx Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 04/21] fftools/ffmpeg: drop OutputStream.error Anton Khirnov
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

It is no longer used outside of update_video_stats(), so make it a stack
variable in that function.
---
 fftools/ffmpeg.h     | 3 ---
 fftools/ffmpeg_enc.c | 5 +++--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index a41bc9b518..c3cb365a3b 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -671,9 +671,6 @@ typedef struct OutputStream {
     /* packet quality factor */
     int quality;
 
-    /* packet picture type */
-    int pict_type;
-
     /* frame encode sum of squared error values */
     int64_t error[4];
 
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 859c7fdeee..096e0ce14a 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -587,11 +587,12 @@ static void update_video_stats(OutputStream *ost, const AVPacket *pkt, int write
     const uint8_t *sd = av_packet_get_side_data(pkt, AV_PKT_DATA_QUALITY_STATS,
                                                 NULL);
     AVCodecContext *enc = ost->enc_ctx;
+    enum AVPictureType pict_type;
     int64_t frame_number;
     double ti1, bitrate, avg_bitrate;
 
     ost->quality   = sd ? AV_RL32(sd) : -1;
-    ost->pict_type = sd ? sd[4] : AV_PICTURE_TYPE_NONE;
+    pict_type      = sd ? sd[4] : AV_PICTURE_TYPE_NONE;
 
     for (int i = 0; i<FF_ARRAY_ELEMS(ost->error); i++) {
         if (sd && i < sd[5])
@@ -634,7 +635,7 @@ static void update_video_stats(OutputStream *ost, const AVPacket *pkt, int write
     avg_bitrate = (double)(e->data_size * 8) / ti1 / 1000.0;
     fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ",
            (double)e->data_size / 1024, ti1, bitrate, avg_bitrate);
-    fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(ost->pict_type));
+    fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(pict_type));
 }
 
 static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 04/21] fftools/ffmpeg: drop OutputStream.error
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 02/21] fftools/ffmpeg: reduce access to OutputStream.enc_ctx Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 03/21] fftools/ffmpeg: drop OutputStream.pict_type Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 05/21] fftools/ffmpeg: move OutputStream.packets_encoded to Encoder Anton Khirnov
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

Only the first component is used in update_video_stats(), so make it a
stack variable in that function.
---
 fftools/ffmpeg.h     |  8 --------
 fftools/ffmpeg_enc.c | 20 +++++++++++++-------
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index c3cb365a3b..c4b77ab2c8 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -671,9 +671,6 @@ typedef struct OutputStream {
     /* packet quality factor */
     int quality;
 
-    /* frame encode sum of squared error values */
-    int64_t error[4];
-
     int sq_idx_encode;
     int sq_idx_mux;
 
@@ -920,11 +917,6 @@ InputStream *ist_iter(InputStream *prev);
  * pass NULL to start iteration */
 OutputStream *ost_iter(OutputStream *prev);
 
-static inline double psnr(double d)
-{
-    return -10.0 * log10(d);
-}
-
 void close_output_stream(OutputStream *ost);
 int trigger_fix_sub_duration_heartbeat(OutputStream *ost, const AVPacket *pkt);
 void update_benchmark(const char *fmt, ...);
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 096e0ce14a..c368097cd0 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -581,6 +581,11 @@ void enc_stats_write(OutputStream *ost, EncStats *es,
     avio_flush(io);
 }
 
+static inline double psnr(double d)
+{
+    return -10.0 * log10(d);
+}
+
 static void update_video_stats(OutputStream *ost, const AVPacket *pkt, int write_vstats)
 {
     Encoder        *e = ost->enc;
@@ -590,15 +595,16 @@ static void update_video_stats(OutputStream *ost, const AVPacket *pkt, int write
     enum AVPictureType pict_type;
     int64_t frame_number;
     double ti1, bitrate, avg_bitrate;
+    double psnr_val = -1;
 
     ost->quality   = sd ? AV_RL32(sd) : -1;
     pict_type      = sd ? sd[4] : AV_PICTURE_TYPE_NONE;
 
-    for (int i = 0; i<FF_ARRAY_ELEMS(ost->error); i++) {
-        if (sd && i < sd[5])
-            ost->error[i] = AV_RL64(sd + 8 + 8*i);
-        else
-            ost->error[i] = -1;
+    if ((enc->flags & AV_CODEC_FLAG_PSNR) && sd && sd[5]) {
+        // FIXME the scaling assumes 8bit
+        double error = AV_RL64(sd + 8) / (enc->width * enc->height * 255.0 * 255.0);
+        if (error >= 0 && error <= 1)
+            psnr_val = psnr(error);
     }
 
     if (!write_vstats)
@@ -622,8 +628,8 @@ static void update_video_stats(OutputStream *ost, const AVPacket *pkt, int write
                 ost->quality / (float)FF_QP2LAMBDA);
     }
 
-    if (ost->error[0]>=0 && (enc->flags & AV_CODEC_FLAG_PSNR))
-        fprintf(vstats_file, "PSNR= %6.2f ", psnr(ost->error[0] / (enc->width * enc->height * 255.0 * 255.0)));
+    if (psnr_val >= 0)
+        fprintf(vstats_file, "PSNR= %6.2f ", psnr_val);
 
     fprintf(vstats_file,"f_size= %6d ", pkt->size);
     /* compute pts value */
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 05/21] fftools/ffmpeg: move OutputStream.packets_encoded to Encoder
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (2 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 04/21] fftools/ffmpeg: drop OutputStream.error Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 06/21] fftools/ffmpeg: drop undocumented runtime debug-setting Anton Khirnov
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

It is no longer used outside of ffmpeg_enc.
---
 fftools/ffmpeg.h     | 2 --
 fftools/ffmpeg_enc.c | 9 ++++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index c4b77ab2c8..116087354d 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -665,8 +665,6 @@ typedef struct OutputStream {
     // number of frames/samples sent to the encoder
     uint64_t frames_encoded;
     uint64_t samples_encoded;
-    // number of packets received from the encoder
-    uint64_t packets_encoded;
 
     /* packet quality factor */
     int quality;
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index c368097cd0..5707199ac5 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -59,6 +59,9 @@ struct Encoder {
 
     // combined size of all the packets received from the encoder
     uint64_t data_size;
+
+    // number of packets received from the encoder
+    uint64_t packets_encoded;
 };
 
 static uint64_t dup_warning = 1000;
@@ -619,7 +622,7 @@ static void update_video_stats(OutputStream *ost, const AVPacket *pkt, int write
         }
     }
 
-    frame_number = ost->packets_encoded;
+    frame_number = e->packets_encoded;
     if (vstats_version <= 1) {
         fprintf(vstats_file, "frame= %5"PRId64" q= %2.1f ", frame_number,
                 ost->quality / (float)FF_QP2LAMBDA);
@@ -708,7 +711,7 @@ static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)
             update_video_stats(ost, pkt, !!vstats_filename);
         if (ost->enc_stats_post.io)
             enc_stats_write(ost, &ost->enc_stats_post, NULL, pkt,
-                            ost->packets_encoded);
+                            e->packets_encoded);
 
         if (debug_ts) {
             av_log(ost, AV_LOG_INFO, "encoder -> type:%s "
@@ -742,7 +745,7 @@ static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)
 
         e->data_size += pkt->size;
 
-        ost->packets_encoded++;
+        e->packets_encoded++;
 
         of_output_packet(of, pkt, ost, 0);
     }
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 06/21] fftools/ffmpeg: drop undocumented runtime debug-setting
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (3 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 05/21] fftools/ffmpeg: move OutputStream.packets_encoded to Encoder Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 07/21] fftools/ffmpeg_filter: make ifilter_parameters_from_frame() static Anton Khirnov
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

This feature is of highly questionable usefulness and - as the comment
in the code says - is not actually supported by the API.
---
 fftools/ffmpeg.c | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 1ae2c5c18f..453d3763be 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1768,40 +1768,6 @@ static int check_keyboard_interaction(int64_t cur_time)
                    "only %d given in string '%s'\n", n, buf);
         }
     }
-    if (key == 'd' || key == 'D'){
-        int debug=0;
-        if(key == 'D') {
-            InputStream *ist = ist_iter(NULL);
-
-            if (ist)
-                debug = ist->dec_ctx->debug << 1;
-
-            if(!debug) debug = 1;
-            while (debug & FF_DEBUG_DCT_COEFF) //unsupported, would just crash
-                debug += debug;
-        }else{
-            char buf[32];
-            int k = 0;
-            i = 0;
-            set_tty_echo(1);
-            while ((k = read_key()) != '\n' && k != '\r' && i < sizeof(buf)-1)
-                if (k > 0)
-                    buf[i++] = k;
-            buf[i] = 0;
-            set_tty_echo(0);
-            fprintf(stderr, "\n");
-            if (k <= 0 || sscanf(buf, "%d", &debug)!=1)
-                fprintf(stderr,"error parsing debug value\n");
-        }
-        for (InputStream *ist = ist_iter(NULL); ist; ist = ist_iter(ist))
-            ist->dec_ctx->debug = debug;
-        for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
-            if (ost->enc_ctx)
-                ost->enc_ctx->debug = debug;
-        }
-        if(debug) av_log_set_level(AV_LOG_DEBUG);
-        fprintf(stderr,"debug=%d\n", debug);
-    }
     if (key == '?'){
         fprintf(stderr, "key    function\n"
                         "?      show this help\n"
@@ -1809,7 +1775,6 @@ static int check_keyboard_interaction(int64_t cur_time)
                         "-      decrease verbosity\n"
                         "c      Send command to first matching filter supporting it\n"
                         "C      Send/Queue command to all matching filters\n"
-                        "D      cycle through available debug modes\n"
                         "h      dump packets/hex press to cycle through the 3 states\n"
                         "q      quit\n"
                         "s      Show QP histogram\n"
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 07/21] fftools/ffmpeg_filter: make ifilter_parameters_from_frame() static
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (4 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 06/21] fftools/ffmpeg: drop undocumented runtime debug-setting Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data Anton Khirnov
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

It is no longer used outside of this file.
---
 fftools/ffmpeg.h        | 1 -
 fftools/ffmpeg_filter.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 116087354d..cc384b4b30 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -794,7 +794,6 @@ void sub2video_update(InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub);
 int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference);
 int ifilter_send_eof(InputFilter *ifilter, int64_t pts);
 
-int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame);
 int ifilter_parameters_from_codecpar(InputFilter *ifilter, AVCodecParameters *par);
 int ifilter_has_all_input_formats(FilterGraph *fg);
 
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index b26160b375..c90e8bec91 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1309,7 +1309,7 @@ fail:
     return ret;
 }
 
-int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame)
+static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame)
 {
     AVFrameSideData *sd;
     int ret;
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (5 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 07/21] fftools/ffmpeg_filter: make ifilter_parameters_from_frame() static Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-28  8:45   ` Nicolas George
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 09/21] fftools/ffmpeg_filter: make graph_desc private Anton Khirnov
                   ` (13 subsequent siblings)
  20 siblings, 1 reply; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

Start by moving OutputStream.filtered_frame to it, which really belongs
to the filtergraph rather than the output stream.
---
 fftools/ffmpeg.h          |  1 -
 fftools/ffmpeg_filter.c   | 31 ++++++++++++++++++++++++++-----
 fftools/ffmpeg_mux.c      |  1 -
 fftools/ffmpeg_mux_init.c |  4 ----
 4 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index cc384b4b30..2acbccfe2c 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -604,7 +604,6 @@ typedef struct OutputStream {
 
     Encoder *enc;
     AVCodecContext *enc_ctx;
-    AVFrame *filtered_frame;
     AVPacket *pkt;
     int64_t last_dropped;
 
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index c90e8bec91..4b7b34b05d 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -38,6 +38,18 @@
 #include "libavutil/samplefmt.h"
 #include "libavutil/timestamp.h"
 
+typedef struct FilterGraphPriv {
+    FilterGraph fg;
+
+    // frame for temporarily holding output from the filtergraph
+    AVFrame *frame;
+} FilterGraphPriv;
+
+static FilterGraphPriv *fgp_from_fg(FilterGraph *fg)
+{
+    return (FilterGraphPriv*)fg;
+}
+
 // FIXME: YUV420P etc. are actually supported with full color range,
 // yet the latter information isn't available here.
 static const enum AVPixelFormat *get_compliance_normal_pix_fmts(const AVCodec *codec, const enum AVPixelFormat default_formats[])
@@ -192,9 +204,11 @@ static OutputFilter *ofilter_alloc(FilterGraph *fg)
 void fg_free(FilterGraph **pfg)
 {
     FilterGraph *fg = *pfg;
+    FilterGraphPriv *fgp;
 
     if (!fg)
         return;
+    fgp = fgp_from_fg(fg);
 
     avfilter_graph_free(&fg->graph);
     for (int j = 0; j < fg->nb_inputs; j++) {
@@ -230,17 +244,23 @@ void fg_free(FilterGraph **pfg)
     av_freep(&fg->outputs);
     av_freep(&fg->graph_desc);
 
+    av_frame_free(&fgp->frame);
+
     av_freep(pfg);
 }
 
 FilterGraph *fg_create(char *graph_desc)
 {
-    FilterGraph *fg;
+    FilterGraphPriv *fgp = allocate_array_elem(&filtergraphs, sizeof(*fgp), &nb_filtergraphs);
+    FilterGraph      *fg = &fgp->fg;
 
-    fg = ALLOC_ARRAY_ELEM(filtergraphs, nb_filtergraphs);
     fg->index      = nb_filtergraphs - 1;
     fg->graph_desc = graph_desc;
 
+    fgp->frame = av_frame_alloc();
+    if (!fgp->frame)
+        report_and_exit(AVERROR(ENOMEM));
+
     return fg;
 }
 
@@ -1348,18 +1368,19 @@ int filtergraph_is_simple(FilterGraph *fg)
 
 int reap_filters(int flush)
 {
-    AVFrame *filtered_frame = NULL;
-
     /* Reap all buffers present in the buffer sinks */
     for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) {
+        FilterGraphPriv *fgp;
+        AVFrame *filtered_frame;
         AVFilterContext *filter;
         int ret = 0;
 
         if (!ost->filter || !ost->filter->graph->graph)
             continue;
         filter = ost->filter->filter;
+        fgp    = fgp_from_fg(ost->filter->graph);
 
-        filtered_frame = ost->filtered_frame;
+        filtered_frame = fgp->frame;
 
         while (1) {
             ret = av_buffersink_get_frame_flags(filter, filtered_frame,
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index 52f98fb76a..afcd4df99b 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -845,7 +845,6 @@ static void ost_free(OutputStream **post)
 
     av_bsf_free(&ms->bsf_ctx);
 
-    av_frame_free(&ost->filtered_frame);
     av_packet_free(&ost->pkt);
     av_dict_free(&ost->encoder_opts);
 
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 7a2db9f0e8..2c0e2faf4a 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -1026,10 +1026,6 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o,
         av_strlcat(ms->log_name, "/copy", sizeof(ms->log_name));
     }
 
-    ost->filtered_frame = av_frame_alloc();
-    if (!ost->filtered_frame)
-        report_and_exit(AVERROR(ENOMEM));
-
     ost->pkt = av_packet_alloc();
     if (!ost->pkt)
         report_and_exit(AVERROR(ENOMEM));
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 09/21] fftools/ffmpeg_filter: make graph_desc private
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (6 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-28  8:46   ` Nicolas George
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 10/21] fftools/ffmpeg_filter: factorize allocating InputFilter Anton Khirnov
                   ` (12 subsequent siblings)
  20 siblings, 1 reply; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

It is not used outside of ffmpeg_filter.
---
 fftools/ffmpeg.h        |  1 -
 fftools/ffmpeg_filter.c | 22 ++++++++++++++--------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 2acbccfe2c..e0e923e902 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -323,7 +323,6 @@ typedef struct OutputFilter {
 
 typedef struct FilterGraph {
     int            index;
-    const char    *graph_desc;
 
     AVFilterGraph *graph;
     // true when the filtergraph contains only meta filters
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 4b7b34b05d..12ecf54998 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -41,6 +41,8 @@
 typedef struct FilterGraphPriv {
     FilterGraph fg;
 
+    const char *graph_desc;
+
     // frame for temporarily holding output from the filtergraph
     AVFrame *frame;
 } FilterGraphPriv;
@@ -242,7 +244,7 @@ void fg_free(FilterGraph **pfg)
         av_freep(&fg->outputs[j]);
     }
     av_freep(&fg->outputs);
-    av_freep(&fg->graph_desc);
+    av_freep(&fgp->graph_desc);
 
     av_frame_free(&fgp->frame);
 
@@ -255,7 +257,7 @@ FilterGraph *fg_create(char *graph_desc)
     FilterGraph      *fg = &fgp->fg;
 
     fg->index      = nb_filtergraphs - 1;
-    fg->graph_desc = graph_desc;
+    fgp->graph_desc = graph_desc;
 
     fgp->frame = av_frame_alloc();
     if (!fgp->frame)
@@ -312,6 +314,7 @@ static char *describe_filter_link(FilterGraph *fg, AVFilterInOut *inout, int in)
 
 static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
 {
+    FilterGraphPriv *fgp = fgp_from_fg(fg);
     InputStream *ist = NULL;
     enum AVMediaType type = avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx);
     InputFilter *ifilter;
@@ -332,7 +335,7 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
 
         if (file_idx < 0 || file_idx >= nb_input_files) {
             av_log(NULL, AV_LOG_FATAL, "Invalid file index %d in filtergraph description %s.\n",
-                   file_idx, fg->graph_desc);
+                   file_idx, fgp->graph_desc);
             exit_program(1);
         }
         s = input_files[file_idx]->ctx;
@@ -350,13 +353,13 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
         }
         if (!st) {
             av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph description %s "
-                   "matches no streams.\n", p, fg->graph_desc);
+                   "matches no streams.\n", p, fgp->graph_desc);
             exit_program(1);
         }
         ist = input_files[file_idx]->streams[st->index];
         if (ist->user_set_discard == AVDISCARD_ALL) {
             av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph description %s "
-                   "matches a disabled input stream.\n", p, fg->graph_desc);
+                   "matches a disabled input stream.\n", p, fgp->graph_desc);
             exit_program(1);
         }
     } else {
@@ -560,6 +563,7 @@ fail:
 
 int init_complex_filtergraph(FilterGraph *fg)
 {
+    FilterGraphPriv *fgp = fgp_from_fg(fg);
     AVFilterInOut *inputs, *outputs, *cur;
     AVFilterGraph *graph;
     int ret = 0;
@@ -571,7 +575,7 @@ int init_complex_filtergraph(FilterGraph *fg)
         return AVERROR(ENOMEM);
     graph->nb_threads = 1;
 
-    ret = graph_parse(graph, fg->graph_desc, &inputs, &outputs, NULL);
+    ret = graph_parse(graph, fgp->graph_desc, &inputs, &outputs, NULL);
     if (ret < 0)
         goto fail;
 
@@ -1179,11 +1183,12 @@ static int graph_is_meta(AVFilterGraph *graph)
 
 int configure_filtergraph(FilterGraph *fg)
 {
+    FilterGraphPriv *fgp = fgp_from_fg(fg);
     AVBufferRef *hw_device;
     AVFilterInOut *inputs, *outputs, *cur;
     int ret, i, simple = filtergraph_is_simple(fg);
     const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter :
-                                      fg->graph_desc;
+                                      fgp->graph_desc;
 
     cleanup_filtergraph(fg);
     if (!(fg->graph = avfilter_graph_alloc()))
@@ -1363,7 +1368,8 @@ static int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *fr
 
 int filtergraph_is_simple(FilterGraph *fg)
 {
-    return !fg->graph_desc;
+    FilterGraphPriv *fgp = fgp_from_fg(fg);
+    return !fgp->graph_desc;
 }
 
 int reap_filters(int flush)
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 10/21] fftools/ffmpeg_filter: factorize allocating InputFilter
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (7 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 09/21] fftools/ffmpeg_filter: make graph_desc private Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 11/21] fftools/ffmpeg_filter: add InputFilter private data Anton Khirnov
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

---
 fftools/ffmpeg_filter.c | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 12ecf54998..ecabf3f886 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -203,6 +203,21 @@ static OutputFilter *ofilter_alloc(FilterGraph *fg)
     return ofilter;
 }
 
+static InputFilter *ifilter_alloc(FilterGraph *fg)
+{
+    InputFilter *ifilter;
+
+    ifilter         = ALLOC_ARRAY_ELEM(fg->inputs, fg->nb_inputs);
+    ifilter->graph  = fg;
+    ifilter->format = -1;
+
+    ifilter->frame_queue = av_fifo_alloc2(8, sizeof(AVFrame*), AV_FIFO_FLAG_AUTO_GROW);
+    if (!ifilter->frame_queue)
+        report_and_exit(AVERROR(ENOMEM));
+
+    return ifilter;
+}
+
 void fg_free(FilterGraph **pfg)
 {
     FilterGraph *fg = *pfg;
@@ -281,14 +296,8 @@ int init_simple_filtergraph(InputStream *ist, OutputStream *ost)
 
     ost->filter = ofilter;
 
-    ifilter = ALLOC_ARRAY_ELEM(fg->inputs, fg->nb_inputs);
+    ifilter         = ifilter_alloc(fg);
     ifilter->ist    = ist;
-    ifilter->graph  = fg;
-    ifilter->format = -1;
-
-    ifilter->frame_queue = av_fifo_alloc2(8, sizeof(AVFrame*), AV_FIFO_FLAG_AUTO_GROW);
-    if (!ifilter->frame_queue)
-        report_and_exit(AVERROR(ENOMEM));
 
     ist_filter_add(ist, ifilter, 1);
 
@@ -379,17 +388,11 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
     }
     av_assert0(ist);
 
-    ifilter = ALLOC_ARRAY_ELEM(fg->inputs, fg->nb_inputs);
+    ifilter = ifilter_alloc(fg);
     ifilter->ist    = ist;
-    ifilter->graph  = fg;
-    ifilter->format = -1;
     ifilter->type   = ist->st->codecpar->codec_type;
     ifilter->name   = describe_filter_link(fg, in, 1);
 
-    ifilter->frame_queue = av_fifo_alloc2(8, sizeof(AVFrame*), AV_FIFO_FLAG_AUTO_GROW);
-    if (!ifilter->frame_queue)
-        report_and_exit(AVERROR(ENOMEM));
-
     ist_filter_add(ist, ifilter, 0);
 }
 
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 11/21] fftools/ffmpeg_filter: add InputFilter private data
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (8 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 10/21] fftools/ffmpeg_filter: factorize allocating InputFilter Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-28  8:47   ` Nicolas George
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 12/21] fftools/ffmpeg_filter: keep track of filtergraph input timebase Anton Khirnov
                   ` (10 subsequent siblings)
  20 siblings, 1 reply; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

Move InputFilter.frame_queue to it, which is not accessed outside of
ffmpeg_filter.
---
 fftools/ffmpeg.h        |  2 --
 fftools/ffmpeg_filter.c | 33 ++++++++++++++++++++++++---------
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index e0e923e902..07322fdd79 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -277,8 +277,6 @@ typedef struct InputFilter {
     uint8_t            *name;
     enum AVMediaType    type;   // AVMEDIA_TYPE_SUBTITLE for sub2video
 
-    AVFifo *frame_queue;
-
     // parameters configured for this input
     int format;
 
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index ecabf3f886..6b92bc074e 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -52,6 +52,17 @@ static FilterGraphPriv *fgp_from_fg(FilterGraph *fg)
     return (FilterGraphPriv*)fg;
 }
 
+typedef struct InputFilterPriv {
+    InputFilter ifilter;
+
+    AVFifo *frame_queue;
+} InputFilterPriv;
+
+static InputFilterPriv *ifp_from_ifilter(InputFilter *ifilter)
+{
+    return (InputFilterPriv*)ifilter;
+}
+
 // FIXME: YUV420P etc. are actually supported with full color range,
 // yet the latter information isn't available here.
 static const enum AVPixelFormat *get_compliance_normal_pix_fmts(const AVCodec *codec, const enum AVPixelFormat default_formats[])
@@ -205,14 +216,15 @@ static OutputFilter *ofilter_alloc(FilterGraph *fg)
 
 static InputFilter *ifilter_alloc(FilterGraph *fg)
 {
-    InputFilter *ifilter;
+    InputFilterPriv *ifp = allocate_array_elem(&fg->inputs, sizeof(*ifp),
+                                               &fg->nb_inputs);
+    InputFilter *ifilter = &ifp->ifilter;
 
-    ifilter         = ALLOC_ARRAY_ELEM(fg->inputs, fg->nb_inputs);
     ifilter->graph  = fg;
     ifilter->format = -1;
 
-    ifilter->frame_queue = av_fifo_alloc2(8, sizeof(AVFrame*), AV_FIFO_FLAG_AUTO_GROW);
-    if (!ifilter->frame_queue)
+    ifp->frame_queue = av_fifo_alloc2(8, sizeof(AVFrame*), AV_FIFO_FLAG_AUTO_GROW);
+    if (!ifp->frame_queue)
         report_and_exit(AVERROR(ENOMEM));
 
     return ifilter;
@@ -230,13 +242,14 @@ void fg_free(FilterGraph **pfg)
     avfilter_graph_free(&fg->graph);
     for (int j = 0; j < fg->nb_inputs; j++) {
         InputFilter *ifilter = fg->inputs[j];
+        InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
         struct InputStream *ist = ifilter->ist;
 
-        if (ifilter->frame_queue) {
+        if (ifp->frame_queue) {
             AVFrame *frame;
-            while (av_fifo_read(ifilter->frame_queue, &frame, 1) >= 0)
+            while (av_fifo_read(ifp->frame_queue, &frame, 1) >= 0)
                 av_frame_free(&frame);
-            av_fifo_freep2(&ifilter->frame_queue);
+            av_fifo_freep2(&ifp->frame_queue);
         }
         av_freep(&ifilter->displaymatrix);
         if (ist->sub2video.sub_queue) {
@@ -1300,8 +1313,9 @@ int configure_filtergraph(FilterGraph *fg)
     }
 
     for (i = 0; i < fg->nb_inputs; i++) {
+        InputFilterPriv *ifp = ifp_from_ifilter(fg->inputs[i]);
         AVFrame *tmp;
-        while (av_fifo_read(fg->inputs[i]->frame_queue, &tmp, 1) >= 0) {
+        while (av_fifo_read(ifp->frame_queue, &tmp, 1) >= 0) {
             ret = av_buffersrc_add_frame(fg->inputs[i]->filter, tmp);
             av_frame_free(&tmp);
             if (ret < 0)
@@ -1458,6 +1472,7 @@ int ifilter_send_eof(InputFilter *ifilter, int64_t pts)
 
 int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference)
 {
+    InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
     FilterGraph *fg = ifilter->graph;
     AVFrameSideData *sd;
     int need_reinit, ret;
@@ -1506,7 +1521,7 @@ int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference)
             if (!tmp)
                 return AVERROR(ENOMEM);
 
-            ret = av_fifo_write(ifilter->frame_queue, &tmp, 1);
+            ret = av_fifo_write(ifp->frame_queue, &tmp, 1);
             if (ret < 0)
                 av_frame_free(&tmp);
 
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 12/21] fftools/ffmpeg_filter: keep track of filtergraph input timebase
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (9 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 11/21] fftools/ffmpeg_filter: add InputFilter private data Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-28  8:48   ` Nicolas George
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 13/21] fftools/ffmpeg_filter: use correct timebase for filter EOF timestamp Anton Khirnov
                   ` (9 subsequent siblings)
  20 siblings, 1 reply; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

Will be useful in following commits.
---
 fftools/ffmpeg_filter.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 6b92bc074e..3c6c580093 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -55,6 +55,8 @@ static FilterGraphPriv *fgp_from_fg(FilterGraph *fg)
 typedef struct InputFilterPriv {
     InputFilter ifilter;
 
+    AVRational time_base;
+
     AVFifo *frame_queue;
 } InputFilterPriv;
 
@@ -969,13 +971,13 @@ static int sub2video_prepare(InputStream *ist, InputFilter *ifilter)
 static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
                                         AVFilterInOut *in)
 {
+    InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
+
     AVFilterContext *last_filter;
     const AVFilter *buffer_filt = avfilter_get_by_name("buffer");
     const AVPixFmtDescriptor *desc;
     InputStream *ist = ifilter->ist;
     InputFile     *f = input_files[ist->file_index];
-    AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) :
-                                         ist->st->time_base;
     AVRational fr = ist->framerate;
     AVRational sar;
     AVBPrint args;
@@ -1004,6 +1006,9 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
             goto fail;
     }
 
+    ifp->time_base =  ist->framerate.num ? av_inv_q(ist->framerate) :
+                                           ist->st->time_base;
+
     sar = ifilter->sample_aspect_ratio;
     if(!sar.den)
         sar = (AVRational){0,1};
@@ -1012,7 +1017,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
              "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:"
              "pixel_aspect=%d/%d",
              ifilter->width, ifilter->height, ifilter->format,
-             tb.num, tb.den, sar.num, sar.den);
+             ifp->time_base.num, ifp->time_base.den, sar.num, sar.den);
     if (fr.num && fr.den)
         av_bprintf(&args, ":frame_rate=%d/%d", fr.num, fr.den);
     snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
@@ -1094,6 +1099,7 @@ fail:
 static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
                                         AVFilterInOut *in)
 {
+    InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
     AVFilterContext *last_filter;
     const AVFilter *abuffer_filt = avfilter_get_by_name("abuffer");
     InputStream *ist = ifilter->ist;
@@ -1108,9 +1114,11 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
         return AVERROR(EINVAL);
     }
 
+    ifp->time_base = (AVRational){ 1, ifilter->sample_rate };
+
     av_bprint_init(&args, 0, AV_BPRINT_SIZE_AUTOMATIC);
     av_bprintf(&args, "time_base=%d/%d:sample_rate=%d:sample_fmt=%s",
-             1, ifilter->sample_rate,
+               ifp->time_base.num, ifp->time_base.den,
              ifilter->sample_rate,
              av_get_sample_fmt_name(ifilter->format));
     if (av_channel_layout_check(&ifilter->ch_layout) &&
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 13/21] fftools/ffmpeg_filter: use correct timebase for filter EOF timestamp
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (10 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 12/21] fftools/ffmpeg_filter: keep track of filtergraph input timebase Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 14/21] fftools/ffmpeg: stop using packet pts for decoded audio frame pts Anton Khirnov
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

It does not need to be equal to demuxer timebase.
---
 fftools/ffmpeg.c        | 5 +----
 fftools/ffmpeg.h        | 2 +-
 fftools/ffmpeg_filter.c | 6 +++++-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 453d3763be..eae0093cce 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1320,12 +1320,9 @@ static int transcode_subtitles(InputStream *ist, const AVPacket *pkt,
 static int send_filter_eof(InputStream *ist)
 {
     int i, ret;
-    /* TODO keep pts also in stream time base to avoid converting back */
-    int64_t pts = av_rescale_q_rnd(ist->pts, AV_TIME_BASE_Q, ist->st->time_base,
-                                   AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX);
 
     for (i = 0; i < ist->nb_filters; i++) {
-        ret = ifilter_send_eof(ist->filters[i], pts);
+        ret = ifilter_send_eof(ist->filters[i], ist->pts, AV_TIME_BASE_Q);
         if (ret < 0)
             return ret;
     }
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 07322fdd79..c07a1b86b6 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -788,7 +788,7 @@ int init_complex_filtergraph(FilterGraph *fg);
 void sub2video_update(InputStream *ist, int64_t heartbeat_pts, AVSubtitle *sub);
 
 int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_reference);
-int ifilter_send_eof(InputFilter *ifilter, int64_t pts);
+int ifilter_send_eof(InputFilter *ifilter, int64_t pts, AVRational tb);
 
 int ifilter_parameters_from_codecpar(InputFilter *ifilter, AVCodecParameters *par);
 int ifilter_has_all_input_formats(FilterGraph *fg);
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 3c6c580093..50a97ccf2a 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1452,13 +1452,17 @@ int reap_filters(int flush)
     return 0;
 }
 
-int ifilter_send_eof(InputFilter *ifilter, int64_t pts)
+int ifilter_send_eof(InputFilter *ifilter, int64_t pts, AVRational tb)
 {
+    InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
     int ret;
 
     ifilter->eof = 1;
 
     if (ifilter->filter) {
+        pts = av_rescale_q_rnd(pts, tb, ifp->time_base,
+                               AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX);
+
         ret = av_buffersrc_close(ifilter->filter, pts, AV_BUFFERSRC_FLAG_PUSH);
         if (ret < 0)
             return ret;
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 14/21] fftools/ffmpeg: stop using packet pts for decoded audio frame pts
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (11 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 13/21] fftools/ffmpeg_filter: use correct timebase for filter EOF timestamp Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 15/21] fftools/ffmpeg: set AVFrame.time_base for decoded frames Anton Khirnov
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

If input packets have timestamps, they will be propagated to output
frames by the decoder, so at best this block does not do anything.

There can also be an arbitrary amount of delay between packets sent to
the decoder and decoded frames (e.g. due to decoder's intrinsic delay or
frame threading), so deriving any timestamps from packet properties is
wrong.
---
 fftools/ffmpeg.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index eae0093cce..5913a57d16 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -911,9 +911,6 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
 
     if (decoded_frame->pts != AV_NOPTS_VALUE) {
         decoded_frame_tb   = ist->st->time_base;
-    } else if (pkt && pkt->pts != AV_NOPTS_VALUE) {
-        decoded_frame->pts = pkt->pts;
-        decoded_frame_tb   = pkt->time_base;
     }else {
         decoded_frame->pts = ist->dts;
         decoded_frame_tb   = AV_TIME_BASE_Q;
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 15/21] fftools/ffmpeg: set AVFrame.time_base for decoded frames
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (12 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 14/21] fftools/ffmpeg: stop using packet pts for decoded audio frame pts Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 16/21] fftools/ffmpeg: rework audio-decode timestamp handling Anton Khirnov
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

Makes it easier to keep track of the timebase the frames are in.
---
 fftools/ffmpeg.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 5913a57d16..8829a163e0 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -855,6 +855,8 @@ static int decode(InputStream *ist, AVCodecContext *avctx,
             fd->idx = avctx->frame_num - 1;
         }
 
+        frame->time_base = avctx->pkt_timebase;
+
         *got_frame = 1;
     }
 
@@ -885,7 +887,6 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
     AVFrame *decoded_frame = ist->decoded_frame;
     AVCodecContext *avctx = ist->dec_ctx;
     int ret, err = 0;
-    AVRational decoded_frame_tb;
 
     update_benchmark(NULL);
     ret = decode(ist, avctx, decoded_frame, got_output, pkt);
@@ -909,23 +910,24 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
     ist->next_dts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) /
                      decoded_frame->sample_rate;
 
-    if (decoded_frame->pts != AV_NOPTS_VALUE) {
-        decoded_frame_tb   = ist->st->time_base;
-    }else {
+    if (decoded_frame->pts == AV_NOPTS_VALUE) {
         decoded_frame->pts = ist->dts;
-        decoded_frame_tb   = AV_TIME_BASE_Q;
+        decoded_frame->time_base = AV_TIME_BASE_Q;
     }
     if (pkt && pkt->duration && ist->prev_pkt_pts != AV_NOPTS_VALUE &&
         pkt->pts != AV_NOPTS_VALUE && pkt->pts - ist->prev_pkt_pts > pkt->duration)
         ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE;
     if (pkt)
         ist->prev_pkt_pts = pkt->pts;
-    if (decoded_frame->pts != AV_NOPTS_VALUE)
-        decoded_frame->pts = av_rescale_delta(decoded_frame_tb, decoded_frame->pts,
-                                              (AVRational){1, decoded_frame->sample_rate},
-                                              decoded_frame->nb_samples,
+    if (decoded_frame->pts != AV_NOPTS_VALUE) {
+        AVRational tb_filter = (AVRational){1, decoded_frame->sample_rate};
+        decoded_frame->pts = av_rescale_delta(decoded_frame->time_base, decoded_frame->pts,
+                                              tb_filter, decoded_frame->nb_samples,
                                               &ist->filter_in_rescale_delta_last,
-                                              (AVRational){1, decoded_frame->sample_rate});
+                                              tb_filter);
+        decoded_frame->time_base = tb_filter;
+    }
+
     ist->nb_samples = decoded_frame->nb_samples;
     err = send_frame_to_filters(ist, decoded_frame);
 
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 16/21] fftools/ffmpeg: rework audio-decode timestamp handling
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (13 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 15/21] fftools/ffmpeg: set AVFrame.time_base for decoded frames Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-28 11:42   ` Michael Niedermayer
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 17/21] fftools/ffmpeg: stop using InputStream.pts for generating video timestamps Anton Khirnov
                   ` (5 subsequent siblings)
  20 siblings, 1 reply; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

Stop using InputStream.dts for generating missing timestamps for decoded
frames, because it contains pre-decoding timestamps and there may be
arbitrary amount of delay between input packets and output frames (e.g.
dependent on the thread count when frame threading is used). It is also
in AV_TIME_BASE (i.e. microseconds), which may introduce unnecessary
rounding issues.

New code maintains a timebase that is the inverse of the LCM of all the
samplerates seen so far, and thus can accurately represent every audio
sample. This timebase is used to generate missing timestamps after
decoding.

Changes the result of the following FATE tests
* pcm_dvd-16-5.1-96000
* lavf-smjpeg
* adpcm-ima-smjpeg
In all of these the timestamps now better correspond to actual frame
durations.
---
 fftools/ffmpeg.c                    |  90 +++-
 fftools/ffmpeg.h                    |   8 +-
 fftools/ffmpeg_demux.c              |   6 +-
 tests/ref/fate/adpcm-ima-smjpeg     | 658 ++++++++++++++--------------
 tests/ref/fate/pcm_dvd-16-5.1-96000 |   8 +-
 tests/ref/lavf/smjpeg               |   2 +-
 6 files changed, 415 insertions(+), 357 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 8829a163e0..d074d3e03b 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -881,6 +881,77 @@ static int send_frame_to_filters(InputStream *ist, AVFrame *decoded_frame)
     return ret;
 }
 
+static AVRational audio_samplerate_update(InputStream *ist, const AVFrame *frame)
+{
+    const int prev = ist->last_frame_tb.den;
+    const int sr   = frame->sample_rate;
+
+    AVRational tb_new;
+    int64_t gcd;
+
+    if (frame->sample_rate == ist->last_frame_sample_rate)
+        goto finish;
+
+    gcd  = av_gcd(prev, sr);
+
+    if (prev / gcd >= INT_MAX / sr) {
+        av_log(ist, AV_LOG_WARNING,
+               "Audio timestamps cannot be represented exactly after "
+               "sample rate change: %d -> %d\n", prev, sr);
+        goto finish;
+    }
+    tb_new = (AVRational){ 1, prev / gcd * sr };
+
+    if (ist->last_frame_pts != AV_NOPTS_VALUE)
+        ist->last_frame_pts = av_rescale_q(ist->last_frame_pts,
+                                           ist->last_frame_tb, tb_new);
+    ist->last_frame_duration_est = av_rescale_q(ist->last_frame_duration_est,
+                                                ist->last_frame_tb, tb_new);
+
+    ist->last_frame_tb          = tb_new;
+    ist->last_frame_sample_rate = frame->sample_rate;
+
+finish:
+    return ist->last_frame_tb;
+}
+
+static void audio_ts_process(InputStream *ist, AVFrame *frame)
+{
+    AVRational tb_filter = (AVRational){1, frame->sample_rate};
+    AVRational tb;
+    int64_t pts_pred;
+
+    // on samplerate change, choose a new internal timebase for timestamp
+    // generation that can represent timestamps from all the samplerates
+    // seen so far
+    tb = audio_samplerate_update(ist, frame);
+    pts_pred = ist->last_frame_pts == AV_NOPTS_VALUE ? 0 :
+               ist->last_frame_pts + ist->last_frame_duration_est;
+
+    if (frame->pts == AV_NOPTS_VALUE) {
+        frame->pts = pts_pred;
+        frame->time_base = tb;
+    } else if (ist->last_frame_pts != AV_NOPTS_VALUE &&
+               frame->pts > av_rescale_q_rnd(pts_pred, tb, frame->time_base,
+                                             AV_ROUND_UP)) {
+        // there was a gap in timestamps, reset conversion state
+        ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE;
+    }
+
+    frame->pts = av_rescale_delta(frame->time_base, frame->pts,
+                                  tb, frame->nb_samples,
+                                  &ist->filter_in_rescale_delta_last, tb);
+
+    ist->last_frame_pts          = frame->pts;
+    ist->last_frame_duration_est = av_rescale_q(frame->nb_samples,
+                                                tb_filter, tb);
+
+    // finally convert to filtering timebase
+    frame->pts       = av_rescale_q(frame->pts, tb, tb_filter);
+    frame->duration  = frame->nb_samples;
+    frame->time_base = tb_filter;
+}
+
 static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
                         int *decode_failed)
 {
@@ -910,23 +981,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
     ist->next_dts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) /
                      decoded_frame->sample_rate;
 
-    if (decoded_frame->pts == AV_NOPTS_VALUE) {
-        decoded_frame->pts = ist->dts;
-        decoded_frame->time_base = AV_TIME_BASE_Q;
-    }
-    if (pkt && pkt->duration && ist->prev_pkt_pts != AV_NOPTS_VALUE &&
-        pkt->pts != AV_NOPTS_VALUE && pkt->pts - ist->prev_pkt_pts > pkt->duration)
-        ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE;
-    if (pkt)
-        ist->prev_pkt_pts = pkt->pts;
-    if (decoded_frame->pts != AV_NOPTS_VALUE) {
-        AVRational tb_filter = (AVRational){1, decoded_frame->sample_rate};
-        decoded_frame->pts = av_rescale_delta(decoded_frame->time_base, decoded_frame->pts,
-                                              tb_filter, decoded_frame->nb_samples,
-                                              &ist->filter_in_rescale_delta_last,
-                                              tb_filter);
-        decoded_frame->time_base = tb_filter;
-    }
+    audio_ts_process(ist, decoded_frame);
 
     ist->nb_samples = decoded_frame->nb_samples;
     err = send_frame_to_filters(ist, decoded_frame);
@@ -1076,6 +1131,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_
     // update timestamp history
     ist->last_frame_duration_est = video_duration_estimate(ist, decoded_frame);
     ist->last_frame_pts          = decoded_frame->pts;
+    ist->last_frame_tb           = decoded_frame->time_base;
 
     if (debug_ts) {
         av_log(ist, AV_LOG_INFO,
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index c07a1b86b6..c4abf89b58 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -359,7 +359,6 @@ typedef struct InputStream {
 
     AVRational framerate_guessed;
 
-    int64_t       prev_pkt_pts;
     int64_t       start;     /* time when read started */
     /* predicted dts of the next packet read for this stream or (when there are
      * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
@@ -371,10 +370,13 @@ typedef struct InputStream {
     int64_t       next_pts;
     int64_t       pts;       ///< current pts of the decoded frame  (in AV_TIME_BASE units)
 
-    // pts/estimated duration of the last decoded video frame
-    // in decoder timebase
+    // pts/estimated duration of the last decoded frame
+    // * in decoder timebase for video,
+    // * in last_frame_tb (may change during decoding) for audio
     int64_t last_frame_pts;
     int64_t last_frame_duration_est;
+    AVRational    last_frame_tb;
+    int           last_frame_sample_rate;
 
     int           wrap_correction_done;
 
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 5afb3ff2c8..f8d95d1de6 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -864,7 +864,9 @@ static void add_input_streams(const OptionsContext *o, Demuxer *d)
         }
 
         ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE;
-        ist->prev_pkt_pts = AV_NOPTS_VALUE;
+
+        ist->last_frame_pts = AV_NOPTS_VALUE;
+        ist->last_frame_tb  = (AVRational){ 1, 1 };
 
         ist->dec_ctx = avcodec_alloc_context3(ist->dec);
         if (!ist->dec_ctx)
@@ -905,8 +907,6 @@ static void add_input_streams(const OptionsContext *o, Demuxer *d)
 
             ist->framerate_guessed = av_guess_frame_rate(ic, st, NULL);
 
-            ist->last_frame_pts = AV_NOPTS_VALUE;
-
             break;
         case AVMEDIA_TYPE_AUDIO: {
             int guess_layout_max = INT_MAX;
diff --git a/tests/ref/fate/adpcm-ima-smjpeg b/tests/ref/fate/adpcm-ima-smjpeg
index 723fa2336e..b9cf1f38db 100644
--- a/tests/ref/fate/adpcm-ima-smjpeg
+++ b/tests/ref/fate/adpcm-ima-smjpeg
@@ -8,348 +8,348 @@
 0,       1024,       1024,      512,     1024, 0xed2d3f6b
 0,       1533,       1533,      512,     1024, 0x51f6ccb3
 0,       2040,       2040,      512,     1024, 0x58bd75aa
-0,       2558,       2558,      512,     1024, 0xd857a310
-0,       3070,       3070,      512,     1024, 0xc483a5b8
-0,       3582,       3582,      512,     1024, 0x923ecf67
-0,       4091,       4091,      512,     1024, 0xf87dcd53
+0,       2552,       2552,      512,     1024, 0xd857a310
+0,       3064,       3064,      512,     1024, 0xc483a5b8
+0,       3576,       3576,      512,     1024, 0x923ecf67
+0,       4088,       4088,      512,     1024, 0xf87dcd53
 0,       4598,       4598,      512,     1024, 0xdc32c002
-0,       5116,       5116,      512,     1024, 0xb760def1
-0,       5628,       5628,      512,     1024, 0x6838d2b2
-0,       6140,       6140,      512,     1024, 0xe45aca1e
-0,       6649,       6649,      512,     1024, 0xde1fb955
-0,       7166,       7166,      512,     1024, 0x9e23b949
-0,       7678,       7678,      512,     1024, 0x840cc000
-0,       8190,       8190,      512,     1024, 0x0a29cbfa
-0,       8699,       8699,      512,     1024, 0x9871d4c4
+0,       5110,       5110,      512,     1024, 0xb760def1
+0,       5622,       5622,      512,     1024, 0x6838d2b2
+0,       6134,       6134,      512,     1024, 0xe45aca1e
+0,       6646,       6646,      512,     1024, 0xde1fb955
+0,       7158,       7158,      512,     1024, 0x9e23b949
+0,       7670,       7670,      512,     1024, 0x840cc000
+0,       8182,       8182,      512,     1024, 0x0a29cbfa
+0,       8694,       8694,      512,     1024, 0x9871d4c4
 0,       9206,       9206,      512,     1024, 0xb35dc9f2
-0,       9724,       9724,      512,     1024, 0xf37fda0a
-0,      10236,      10236,      512,     1024, 0xa640f990
-0,      10748,      10748,      512,     1024, 0x516fe6f5
-0,      11257,      11257,      512,     1024, 0xc78bc6a6
-0,      11775,      11775,      512,     1024, 0x700fd6ee
-0,      12287,      12287,      512,     1024, 0x5383d5ad
-0,      12799,      12799,      512,     1024, 0xbe01d091
-0,      13308,      13308,      512,     1024, 0x72dfcfc7
-0,      13815,      13815,      512,     1024, 0xd8fecea9
-0,      14333,      14333,      512,     1024, 0xa464d79b
-0,      14845,      14845,      512,     1024, 0xf394e2cb
-0,      15357,      15357,      512,     1024, 0xa301ec49
-0,      15865,      15865,      512,     1024, 0x5e09d60f
-0,      16383,      16383,      512,     1024, 0xd13edd6f
-0,      16895,      16895,      512,     1024, 0x7423ef39
-0,      17407,      17407,      512,     1024, 0x96e2f083
-0,      17916,      17916,      512,     1024, 0x5ed7dbee
-0,      18423,      18423,      512,     1024, 0x3874f714
-0,      18941,      18941,      512,     1024, 0xa5e6edab
-0,      19453,      19453,      512,     1024, 0x0a04ee3a
-0,      19965,      19965,      512,     1024, 0xadfee6b9
-0,      20474,      20474,      512,     1024, 0xd0bbe6d2
-0,      20992,      20992,      512,     1024, 0x223eebb7
-0,      21504,      21504,      512,     1024, 0x0473e479
-0,      22016,      22016,      512,     1024, 0xdf15e51e
-0,      22525,      22525,      512,     1024, 0xa954e483
-0,      23032,      23032,      512,     1024, 0x6df3ed03
-0,      23549,      23549,      512,     1024, 0x0860e544
-0,      24061,      24061,      512,     1024, 0xc241e8dc
-0,      24573,      24573,      512,     1024, 0xd0e1d6a4
-0,      25082,      25082,      512,     1024, 0xcb2ff988
+0,       9718,       9718,      512,     1024, 0xf37fda0a
+0,      10230,      10230,      512,     1024, 0xa640f990
+0,      10742,      10742,      512,     1024, 0x516fe6f5
+0,      11254,      11254,      512,     1024, 0xc78bc6a6
+0,      11766,      11766,      512,     1024, 0x700fd6ee
+0,      12278,      12278,      512,     1024, 0x5383d5ad
+0,      12790,      12790,      512,     1024, 0xbe01d091
+0,      13302,      13302,      512,     1024, 0x72dfcfc7
+0,      13814,      13814,      512,     1024, 0xd8fecea9
+0,      14326,      14326,      512,     1024, 0xa464d79b
+0,      14838,      14838,      512,     1024, 0xf394e2cb
+0,      15350,      15350,      512,     1024, 0xa301ec49
+0,      15862,      15862,      512,     1024, 0x5e09d60f
+0,      16374,      16374,      512,     1024, 0xd13edd6f
+0,      16886,      16886,      512,     1024, 0x7423ef39
+0,      17398,      17398,      512,     1024, 0x96e2f083
+0,      17910,      17910,      512,     1024, 0x5ed7dbee
+0,      18422,      18422,      512,     1024, 0x3874f714
+0,      18934,      18934,      512,     1024, 0xa5e6edab
+0,      19446,      19446,      512,     1024, 0x0a04ee3a
+0,      19958,      19958,      512,     1024, 0xadfee6b9
+0,      20470,      20470,      512,     1024, 0xd0bbe6d2
+0,      20982,      20982,      512,     1024, 0x223eebb7
+0,      21494,      21494,      512,     1024, 0x0473e479
+0,      22006,      22006,      512,     1024, 0xdf15e51e
+0,      22518,      22518,      512,     1024, 0xa954e483
+0,      23030,      23030,      512,     1024, 0x6df3ed03
+0,      23542,      23542,      512,     1024, 0x0860e544
+0,      24054,      24054,      512,     1024, 0xc241e8dc
+0,      24566,      24566,      512,     1024, 0xd0e1d6a4
+0,      25078,      25078,      512,     1024, 0xcb2ff988
 0,      25590,      25590,      512,     1024, 0x51fae08e
-0,      26107,      26107,      512,     1024, 0xae39f2fc
-0,      26619,      26619,      512,     1024, 0xfd74f07c
-0,      27131,      27131,      512,     1024, 0x1936edc1
-0,      27640,      27640,      512,     1024, 0x95f8deae
-0,      28158,      28158,      512,     1024, 0x93bdf605
-0,      28670,      28670,      512,     1024, 0x7a07dd32
-0,      29182,      29182,      512,     1024, 0x6889fdc1
-0,      29691,      29691,      512,     1024, 0x989bf024
+0,      26102,      26102,      512,     1024, 0xae39f2fc
+0,      26614,      26614,      512,     1024, 0xfd74f07c
+0,      27126,      27126,      512,     1024, 0x1936edc1
+0,      27638,      27638,      512,     1024, 0x95f8deae
+0,      28150,      28150,      512,     1024, 0x93bdf605
+0,      28662,      28662,      512,     1024, 0x7a07dd32
+0,      29174,      29174,      512,     1024, 0x6889fdc1
+0,      29686,      29686,      512,     1024, 0x989bf024
 0,      30198,      30198,      512,     1024, 0xc764ce80
-0,      30716,      30716,      512,     1024, 0x0e62d721
-0,      31228,      31228,      512,     1024, 0x59c2fbe3
-0,      31740,      31740,      512,     1024, 0xf14ee29d
-0,      32249,      32249,      512,     1024, 0x02a0f21b
-0,      32766,      32766,      512,     1024, 0xadb3d361
-0,      33278,      33278,      512,     1024, 0xdcb3d1fc
-0,      33790,      33790,      512,     1024, 0x2924f9dc
-0,      34299,      34299,      512,     1024, 0x7507ebec
+0,      30710,      30710,      512,     1024, 0x0e62d721
+0,      31222,      31222,      512,     1024, 0x59c2fbe3
+0,      31734,      31734,      512,     1024, 0xf14ee29d
+0,      32246,      32246,      512,     1024, 0x02a0f21b
+0,      32758,      32758,      512,     1024, 0xadb3d361
+0,      33270,      33270,      512,     1024, 0xdcb3d1fc
+0,      33782,      33782,      512,     1024, 0x2924f9dc
+0,      34294,      34294,      512,     1024, 0x7507ebec
 0,      34806,      34806,      512,     1024, 0xe009f343
-0,      35324,      35324,      512,     1024, 0x21e9e7ac
-0,      35836,      35836,      512,     1024, 0x845bda9e
-0,      36348,      36348,      512,     1024, 0xb1b3e632
-0,      36857,      36857,      512,     1024, 0x61ccf593
-0,      37375,      37375,      512,     1024, 0x8cdbf603
-0,      37887,      37887,      512,     1024, 0xf8f7e673
-0,      38399,      38399,      512,     1024, 0x55efdd24
-0,      38908,      38908,      512,     1024, 0x4059e8ff
-0,      39415,      39415,      512,     1024, 0xb3afe5be
-0,      39933,      39933,      512,     1024, 0x7236e965
-0,      40445,      40445,      512,     1024, 0xe683db69
-0,      40957,      40957,      512,     1024, 0x29e3d93c
-0,      41466,      41466,      512,     1024, 0x74f2f27f
-0,      41983,      41983,      512,     1024, 0x32cde3ba
-0,      42495,      42495,      512,     1024, 0xe907f171
-0,      43007,      43007,      512,     1024, 0x206ae2a5
-0,      43516,      43516,      512,     1024, 0x6379efa1
-0,      44023,      44023,      512,     1024, 0x0f0fee85
-0,      44541,      44541,      512,     1024, 0x3195e314
-0,      45053,      45053,      512,     1024, 0x4646ead3
-0,      45565,      45565,      512,     1024, 0x5635dcf5
-0,      46074,      46074,      512,     1024, 0xd76fc780
-0,      46592,      46592,      512,     1024, 0x847ff8a5
-0,      47104,      47104,      512,     1024, 0xaca8eda3
-0,      47616,      47616,      512,     1024, 0x9a2de1ea
-0,      48125,      48125,      512,     1024, 0xc92ff23a
-0,      48632,      48632,      512,     1024, 0x0e0ef038
-0,      49149,      49149,      512,     1024, 0xc32cf495
-0,      49661,      49661,      512,     1024, 0x6ab1ec79
-0,      50173,      50173,      512,     1024, 0xe43cd8d6
-0,      50682,      50682,      512,     1024, 0x4ba2deab
+0,      35318,      35318,      512,     1024, 0x21e9e7ac
+0,      35830,      35830,      512,     1024, 0x845bda9e
+0,      36342,      36342,      512,     1024, 0xb1b3e632
+0,      36854,      36854,      512,     1024, 0x61ccf593
+0,      37366,      37366,      512,     1024, 0x8cdbf603
+0,      37878,      37878,      512,     1024, 0xf8f7e673
+0,      38390,      38390,      512,     1024, 0x55efdd24
+0,      38902,      38902,      512,     1024, 0x4059e8ff
+0,      39414,      39414,      512,     1024, 0xb3afe5be
+0,      39926,      39926,      512,     1024, 0x7236e965
+0,      40438,      40438,      512,     1024, 0xe683db69
+0,      40950,      40950,      512,     1024, 0x29e3d93c
+0,      41462,      41462,      512,     1024, 0x74f2f27f
+0,      41974,      41974,      512,     1024, 0x32cde3ba
+0,      42486,      42486,      512,     1024, 0xe907f171
+0,      42998,      42998,      512,     1024, 0x206ae2a5
+0,      43510,      43510,      512,     1024, 0x6379efa1
+0,      44022,      44022,      512,     1024, 0x0f0fee85
+0,      44534,      44534,      512,     1024, 0x3195e314
+0,      45046,      45046,      512,     1024, 0x4646ead3
+0,      45558,      45558,      512,     1024, 0x5635dcf5
+0,      46070,      46070,      512,     1024, 0xd76fc780
+0,      46582,      46582,      512,     1024, 0x847ff8a5
+0,      47094,      47094,      512,     1024, 0xaca8eda3
+0,      47606,      47606,      512,     1024, 0x9a2de1ea
+0,      48118,      48118,      512,     1024, 0xc92ff23a
+0,      48630,      48630,      512,     1024, 0x0e0ef038
+0,      49142,      49142,      512,     1024, 0xc32cf495
+0,      49654,      49654,      512,     1024, 0x6ab1ec79
+0,      50166,      50166,      512,     1024, 0xe43cd8d6
+0,      50678,      50678,      512,     1024, 0x4ba2deab
 0,      51190,      51190,      512,     1024, 0x6d16ea0e
-0,      51707,      51707,      512,     1024, 0xe5b0ee70
-0,      52219,      52219,      512,     1024, 0xcf6cf074
-0,      52731,      52731,      512,     1024, 0x2206e61d
-0,      53240,      53240,      512,     1024, 0xfbb9e7e7
-0,      53758,      53758,      512,     1024, 0x2bc1e115
-0,      54270,      54270,      512,     1024, 0x4ca6e5c5
-0,      54782,      54782,      512,     1024, 0x061cead0
-0,      55291,      55291,      512,     1024, 0x3dc9f950
+0,      51702,      51702,      512,     1024, 0xe5b0ee70
+0,      52214,      52214,      512,     1024, 0xcf6cf074
+0,      52726,      52726,      512,     1024, 0x2206e61d
+0,      53238,      53238,      512,     1024, 0xfbb9e7e7
+0,      53750,      53750,      512,     1024, 0x2bc1e115
+0,      54262,      54262,      512,     1024, 0x4ca6e5c5
+0,      54774,      54774,      512,     1024, 0x061cead0
+0,      55286,      55286,      512,     1024, 0x3dc9f950
 0,      55798,      55798,      512,     1024, 0x9399f10d
-0,      56316,      56316,      512,     1024, 0xa2bff5ae
-0,      56828,      56828,      512,     1024, 0xd21de569
-0,      57340,      57340,      512,     1024, 0x1c45e3be
-0,      57849,      57849,      512,     1024, 0xff5dff1c
-0,      58366,      58366,      512,     1024, 0x992df5d3
-0,      58878,      58878,      512,     1024, 0xafedea2f
-0,      59390,      59390,      512,     1024, 0x6e73d6a8
-0,      59899,      59899,      512,     1024, 0x72dff283
+0,      56310,      56310,      512,     1024, 0xa2bff5ae
+0,      56822,      56822,      512,     1024, 0xd21de569
+0,      57334,      57334,      512,     1024, 0x1c45e3be
+0,      57846,      57846,      512,     1024, 0xff5dff1c
+0,      58358,      58358,      512,     1024, 0x992df5d3
+0,      58870,      58870,      512,     1024, 0xafedea2f
+0,      59382,      59382,      512,     1024, 0x6e73d6a8
+0,      59894,      59894,      512,     1024, 0x72dff283
 0,      60406,      60406,      512,     1024, 0x50b5f1a6
-0,      60924,      60924,      512,     1024, 0xffe1decb
-0,      61436,      61436,      512,     1024, 0x8993ecff
-0,      61948,      61948,      512,     1024, 0x954bd63a
-0,      62457,      62457,      512,     1024, 0x4707f577
-0,      62975,      62975,      512,     1024, 0x7a88f81f
-0,      63487,      63487,      512,     1024, 0xc771f537
-0,      63999,      63999,      512,     1024, 0x7aade6af
-0,      64508,      64508,      512,     1024, 0x8af5ede5
-0,      65015,      65015,      512,     1024, 0x7500f3f1
-0,      65533,      65533,      512,     1024, 0xea36f707
-0,      66045,      66045,      512,     1024, 0x1a26e39a
-0,      66557,      66557,      512,     1024, 0xa04cf00d
-0,      67066,      67066,      512,     1024, 0xc362f182
-0,      67583,      67583,      512,     1024, 0x79c8f82c
-0,      68095,      68095,      512,     1024, 0x6480eee1
-0,      68607,      68607,      512,     1024, 0x7152eaa0
-0,      69116,      69116,      512,     1024, 0x5dfee6a9
-0,      69623,      69623,      512,     1024, 0x0afae660
-0,      70141,      70141,      512,     1024, 0xdc98e9fc
-0,      70653,      70653,      512,     1024, 0x10b7da06
-0,      71165,      71165,      512,     1024, 0x0571e585
-0,      71674,      71674,      512,     1024, 0x18ddf45e
-0,      72192,      72192,      512,     1024, 0x2cbef242
-0,      72704,      72704,      512,     1024, 0xf5380845
-0,      73216,      73216,      512,     1024, 0x34fff45e
-0,      73725,      73725,      512,     1024, 0x6f97e490
-0,      74232,      74232,      512,     1024, 0x77d6f0db
-0,      74750,      74750,      512,     1024, 0xa25ce2db
-0,      75262,      75262,      512,     1024, 0x8260e4e9
-0,      75774,      75774,      512,     1024, 0xc3b2f7d2
-0,      76282,      76282,      512,     1024, 0x82a7edae
+0,      60918,      60918,      512,     1024, 0xffe1decb
+0,      61430,      61430,      512,     1024, 0x8993ecff
+0,      61942,      61942,      512,     1024, 0x954bd63a
+0,      62454,      62454,      512,     1024, 0x4707f577
+0,      62966,      62966,      512,     1024, 0x7a88f81f
+0,      63478,      63478,      512,     1024, 0xc771f537
+0,      63990,      63990,      512,     1024, 0x7aade6af
+0,      64502,      64502,      512,     1024, 0x8af5ede5
+0,      65014,      65014,      512,     1024, 0x7500f3f1
+0,      65526,      65526,      512,     1024, 0xea36f707
+0,      66038,      66038,      512,     1024, 0x1a26e39a
+0,      66550,      66550,      512,     1024, 0xa04cf00d
+0,      67062,      67062,      512,     1024, 0xc362f182
+0,      67574,      67574,      512,     1024, 0x79c8f82c
+0,      68086,      68086,      512,     1024, 0x6480eee1
+0,      68598,      68598,      512,     1024, 0x7152eaa0
+0,      69110,      69110,      512,     1024, 0x5dfee6a9
+0,      69622,      69622,      512,     1024, 0x0afae660
+0,      70134,      70134,      512,     1024, 0xdc98e9fc
+0,      70646,      70646,      512,     1024, 0x10b7da06
+0,      71158,      71158,      512,     1024, 0x0571e585
+0,      71670,      71670,      512,     1024, 0x18ddf45e
+0,      72182,      72182,      512,     1024, 0x2cbef242
+0,      72694,      72694,      512,     1024, 0xf5380845
+0,      73206,      73206,      512,     1024, 0x34fff45e
+0,      73718,      73718,      512,     1024, 0x6f97e490
+0,      74230,      74230,      512,     1024, 0x77d6f0db
+0,      74742,      74742,      512,     1024, 0xa25ce2db
+0,      75254,      75254,      512,     1024, 0x8260e4e9
+0,      75766,      75766,      512,     1024, 0xc3b2f7d2
+0,      76278,      76278,      512,     1024, 0x82a7edae
 0,      76790,      76790,      512,     1024, 0x7d08dd54
-0,      77307,      77307,      512,     1024, 0x9059eda6
-0,      77819,      77819,      512,     1024, 0xbebaec88
-0,      78331,      78331,      512,     1024, 0xd9afd586
-0,      78840,      78840,      512,     1024, 0x0ca3e622
-0,      79358,      79358,      512,     1024, 0x4123e9e6
-0,      79870,      79870,      512,     1024, 0x2ff9f95c
-0,      80382,      80382,      512,     1024, 0x8522e261
-0,      80891,      80891,      512,     1024, 0xe4f8f499
+0,      77302,      77302,      512,     1024, 0x9059eda6
+0,      77814,      77814,      512,     1024, 0xbebaec88
+0,      78326,      78326,      512,     1024, 0xd9afd586
+0,      78838,      78838,      512,     1024, 0x0ca3e622
+0,      79350,      79350,      512,     1024, 0x4123e9e6
+0,      79862,      79862,      512,     1024, 0x2ff9f95c
+0,      80374,      80374,      512,     1024, 0x8522e261
+0,      80886,      80886,      512,     1024, 0xe4f8f499
 0,      81398,      81398,      512,     1024, 0x34f3f2bd
-0,      81916,      81916,      512,     1024, 0x82efe863
-0,      82428,      82428,      512,     1024, 0x9966fcea
-0,      82940,      82940,      512,     1024, 0xe94de3fd
-0,      83449,      83449,      512,     1024, 0x1ce0e27b
-0,      83966,      83966,      512,     1024, 0xd718dcde
-0,      84478,      84478,      512,     1024, 0xd503e724
-0,      84990,      84990,      512,     1024, 0x427ee3b2
-0,      85499,      85499,      512,     1024, 0x4512dcc4
-0,      86007,      86007,      512,     1024, 0xcf31e77c
-0,      86524,      86524,      512,     1024, 0xeb41ea81
-0,      87036,      87036,      512,     1024, 0xfa43e67c
-0,      87548,      87548,      512,     1024, 0x8162f3c9
-0,      88057,      88057,      512,     1024, 0x1b55f6b0
-0,      88575,      88575,      512,     1024, 0x3ebeec44
-0,      89087,      89087,      512,     1024, 0x740fe0c4
-0,      89599,      89599,      512,     1024, 0x8fb4e8b2
-0,      90108,      90108,      512,     1024, 0xe49de6a2
-0,      90615,      90615,      512,     1024, 0xd64febdf
-0,      91133,      91133,      512,     1024, 0x0e74ee08
-0,      91645,      91645,      512,     1024, 0x6c0ddf07
-0,      92157,      92157,      512,     1024, 0x7fb8e3c9
-0,      92666,      92666,      512,     1024, 0x52bfe96c
-0,      93183,      93183,      512,     1024, 0xfc22ee64
-0,      93695,      93695,      512,     1024, 0xe20ae718
-0,      94207,      94207,      512,     1024, 0xa94be395
-0,      94716,      94716,      512,     1024, 0xded306d0
-0,      95223,      95223,      512,     1024, 0x31f7c831
-0,      95741,      95741,      512,     1024, 0x0ffde0a8
-0,      96253,      96253,      512,     1024, 0xc692e3e0
-0,      96765,      96765,      512,     1024, 0x1d8ff7c7
-0,      97274,      97274,      512,     1024, 0x038ee172
-0,      97792,      97792,      512,     1024, 0x9a1eef59
-0,      98304,      98304,      512,     1024, 0x158fe750
-0,      98816,      98816,      512,     1024, 0xac15e42c
-0,      99325,      99325,      512,     1024, 0x6323ed44
-0,      99832,      99832,      512,     1024, 0xd10ce4bb
-0,     100350,     100350,      512,     1024, 0xc1cce296
-0,     100862,     100862,      512,     1024, 0x0782f094
-0,     101374,     101374,      512,     1024, 0xd109de36
-0,     101883,     101883,      512,     1024, 0x175600fb
+0,      81910,      81910,      512,     1024, 0x82efe863
+0,      82422,      82422,      512,     1024, 0x9966fcea
+0,      82934,      82934,      512,     1024, 0xe94de3fd
+0,      83446,      83446,      512,     1024, 0x1ce0e27b
+0,      83958,      83958,      512,     1024, 0xd718dcde
+0,      84470,      84470,      512,     1024, 0xd503e724
+0,      84982,      84982,      512,     1024, 0x427ee3b2
+0,      85494,      85494,      512,     1024, 0x4512dcc4
+0,      86006,      86006,      512,     1024, 0xcf31e77c
+0,      86518,      86518,      512,     1024, 0xeb41ea81
+0,      87030,      87030,      512,     1024, 0xfa43e67c
+0,      87542,      87542,      512,     1024, 0x8162f3c9
+0,      88054,      88054,      512,     1024, 0x1b55f6b0
+0,      88566,      88566,      512,     1024, 0x3ebeec44
+0,      89078,      89078,      512,     1024, 0x740fe0c4
+0,      89590,      89590,      512,     1024, 0x8fb4e8b2
+0,      90102,      90102,      512,     1024, 0xe49de6a2
+0,      90614,      90614,      512,     1024, 0xd64febdf
+0,      91126,      91126,      512,     1024, 0x0e74ee08
+0,      91638,      91638,      512,     1024, 0x6c0ddf07
+0,      92150,      92150,      512,     1024, 0x7fb8e3c9
+0,      92662,      92662,      512,     1024, 0x52bfe96c
+0,      93174,      93174,      512,     1024, 0xfc22ee64
+0,      93686,      93686,      512,     1024, 0xe20ae718
+0,      94198,      94198,      512,     1024, 0xa94be395
+0,      94710,      94710,      512,     1024, 0xded306d0
+0,      95222,      95222,      512,     1024, 0x31f7c831
+0,      95734,      95734,      512,     1024, 0x0ffde0a8
+0,      96246,      96246,      512,     1024, 0xc692e3e0
+0,      96758,      96758,      512,     1024, 0x1d8ff7c7
+0,      97270,      97270,      512,     1024, 0x038ee172
+0,      97782,      97782,      512,     1024, 0x9a1eef59
+0,      98294,      98294,      512,     1024, 0x158fe750
+0,      98806,      98806,      512,     1024, 0xac15e42c
+0,      99318,      99318,      512,     1024, 0x6323ed44
+0,      99830,      99830,      512,     1024, 0xd10ce4bb
+0,     100342,     100342,      512,     1024, 0xc1cce296
+0,     100854,     100854,      512,     1024, 0x0782f094
+0,     101366,     101366,      512,     1024, 0xd109de36
+0,     101878,     101878,      512,     1024, 0x175600fb
 0,     102390,     102390,      512,     1024, 0x95d5e8d9
-0,     102907,     102907,      512,     1024, 0xebb6eee1
-0,     103419,     103419,      512,     1024, 0x187cfadc
-0,     103931,     103931,      512,     1024, 0xce35fa5c
-0,     104440,     104440,      512,     1024, 0x8327eea2
-0,     104958,     104958,      512,     1024, 0x5543f219
-0,     105470,     105470,      512,     1024, 0xaacbe0dc
-0,     105982,     105982,      512,     1024, 0xa538e9fb
-0,     106491,     106491,      512,     1024, 0x4dcbe655
+0,     102902,     102902,      512,     1024, 0xebb6eee1
+0,     103414,     103414,      512,     1024, 0x187cfadc
+0,     103926,     103926,      512,     1024, 0xce35fa5c
+0,     104438,     104438,      512,     1024, 0x8327eea2
+0,     104950,     104950,      512,     1024, 0x5543f219
+0,     105462,     105462,      512,     1024, 0xaacbe0dc
+0,     105974,     105974,      512,     1024, 0xa538e9fb
+0,     106486,     106486,      512,     1024, 0x4dcbe655
 0,     106998,     106998,      512,     1024, 0x86b6d93b
-0,     107516,     107516,      512,     1024, 0x1a06f878
-0,     108028,     108028,      512,     1024, 0xd926e8ef
-0,     108540,     108540,      512,     1024, 0xc624db2f
-0,     109049,     109049,      512,     1024, 0x2153e20d
-0,     109566,     109566,      512,     1024, 0x01dce868
-0,     110078,     110078,      512,     1024, 0xfa5fd3cd
-0,     110590,     110590,      512,     1024, 0x2adef2d5
-0,     111099,     111099,      512,     1024, 0x4f48f8e2
-0,     111607,     111607,      512,     1024, 0x613feeee
-0,     112124,     112124,      512,     1024, 0x3780de8a
-0,     112636,     112636,      512,     1024, 0x2093eb65
-0,     113148,     113148,      512,     1024, 0x54baebbb
-0,     113657,     113657,      512,     1024, 0x8686dd7c
-0,     114175,     114175,      512,     1024, 0x7f8ae80c
-0,     114687,     114687,      512,     1024, 0x7aede972
-0,     115199,     115199,      512,     1024, 0x971bebc0
-0,     115708,     115708,      512,     1024, 0x2dd5fd4b
-0,     116215,     116215,      512,     1024, 0xb1b3e4a3
-0,     116733,     116733,      512,     1024, 0x192defc6
-0,     117245,     117245,      512,     1024, 0x5e46ec44
-0,     117757,     117757,      512,     1024, 0xe6d8e05a
-0,     118266,     118266,      512,     1024, 0x7e2fe2b0
-0,     118783,     118783,      512,     1024, 0x9e3bdf80
-0,     119295,     119295,      512,     1024, 0xa98cd85e
-0,     119807,     119807,      512,     1024, 0x6061e0c4
-0,     120316,     120316,      512,     1024, 0x6112f3fc
-0,     120823,     120823,      512,     1024, 0x99bdfb01
-0,     121341,     121341,      512,     1024, 0x3f5df3ca
-0,     121853,     121853,      512,     1024, 0xf5ebeb05
-0,     122365,     122365,      512,     1024, 0x8498e565
-0,     122874,     122874,      512,     1024, 0x0497f0b7
-0,     123392,     123392,      512,     1024, 0x626ae800
-0,     123904,     123904,      512,     1024, 0xfb71eec4
-0,     124416,     124416,      512,     1024, 0xa86ee739
-0,     124925,     124925,      512,     1024, 0x25c0e050
-0,     125432,     125432,      512,     1024, 0x6027e91e
-0,     125950,     125950,      512,     1024, 0x6772df6e
-0,     126462,     126462,      512,     1024, 0xfefff844
-0,     126974,     126974,      512,     1024, 0x547be862
-0,     127483,     127483,      512,     1024, 0xca84e795
+0,     107510,     107510,      512,     1024, 0x1a06f878
+0,     108022,     108022,      512,     1024, 0xd926e8ef
+0,     108534,     108534,      512,     1024, 0xc624db2f
+0,     109046,     109046,      512,     1024, 0x2153e20d
+0,     109558,     109558,      512,     1024, 0x01dce868
+0,     110070,     110070,      512,     1024, 0xfa5fd3cd
+0,     110582,     110582,      512,     1024, 0x2adef2d5
+0,     111094,     111094,      512,     1024, 0x4f48f8e2
+0,     111606,     111606,      512,     1024, 0x613feeee
+0,     112118,     112118,      512,     1024, 0x3780de8a
+0,     112630,     112630,      512,     1024, 0x2093eb65
+0,     113142,     113142,      512,     1024, 0x54baebbb
+0,     113654,     113654,      512,     1024, 0x8686dd7c
+0,     114166,     114166,      512,     1024, 0x7f8ae80c
+0,     114678,     114678,      512,     1024, 0x7aede972
+0,     115190,     115190,      512,     1024, 0x971bebc0
+0,     115702,     115702,      512,     1024, 0x2dd5fd4b
+0,     116214,     116214,      512,     1024, 0xb1b3e4a3
+0,     116726,     116726,      512,     1024, 0x192defc6
+0,     117238,     117238,      512,     1024, 0x5e46ec44
+0,     117750,     117750,      512,     1024, 0xe6d8e05a
+0,     118262,     118262,      512,     1024, 0x7e2fe2b0
+0,     118774,     118774,      512,     1024, 0x9e3bdf80
+0,     119286,     119286,      512,     1024, 0xa98cd85e
+0,     119798,     119798,      512,     1024, 0x6061e0c4
+0,     120310,     120310,      512,     1024, 0x6112f3fc
+0,     120822,     120822,      512,     1024, 0x99bdfb01
+0,     121334,     121334,      512,     1024, 0x3f5df3ca
+0,     121846,     121846,      512,     1024, 0xf5ebeb05
+0,     122358,     122358,      512,     1024, 0x8498e565
+0,     122870,     122870,      512,     1024, 0x0497f0b7
+0,     123382,     123382,      512,     1024, 0x626ae800
+0,     123894,     123894,      512,     1024, 0xfb71eec4
+0,     124406,     124406,      512,     1024, 0xa86ee739
+0,     124918,     124918,      512,     1024, 0x25c0e050
+0,     125430,     125430,      512,     1024, 0x6027e91e
+0,     125942,     125942,      512,     1024, 0x6772df6e
+0,     126454,     126454,      512,     1024, 0xfefff844
+0,     126966,     126966,      512,     1024, 0x547be862
+0,     127478,     127478,      512,     1024, 0xca84e795
 0,     127990,     127990,      512,     1024, 0xd124db3e
-0,     128507,     128507,      512,     1024, 0xcaf3deb5
-0,     129019,     129019,      512,     1024, 0x487ce92d
-0,     129531,     129531,      512,     1024, 0x117feb95
-0,     130040,     130040,      512,     1024, 0x7b63de3d
-0,     130558,     130558,      512,     1024, 0xa529d8e1
-0,     131070,     131070,      512,     1024, 0x56f6da26
-0,     131582,     131582,      512,     1024, 0xffb8d5af
-0,     132091,     132091,      512,     1024, 0xeecbdc04
+0,     128502,     128502,      512,     1024, 0xcaf3deb5
+0,     129014,     129014,      512,     1024, 0x487ce92d
+0,     129526,     129526,      512,     1024, 0x117feb95
+0,     130038,     130038,      512,     1024, 0x7b63de3d
+0,     130550,     130550,      512,     1024, 0xa529d8e1
+0,     131062,     131062,      512,     1024, 0x56f6da26
+0,     131574,     131574,      512,     1024, 0xffb8d5af
+0,     132086,     132086,      512,     1024, 0xeecbdc04
 0,     132598,     132598,      512,     1024, 0xfc59d2d2
-0,     133116,     133116,      512,     1024, 0xaf7acef7
-0,     133628,     133628,      512,     1024, 0x3f9bf258
-0,     134140,     134140,      512,     1024, 0xcf54e9d6
-0,     134649,     134649,      512,     1024, 0x680cd0aa
-0,     135167,     135167,      512,     1024, 0x3c1bdc1f
-0,     135679,     135679,      512,     1024, 0x8c8ffe22
-0,     136191,     136191,      512,     1024, 0xf415d362
-0,     136699,     136699,      512,     1024, 0x8c8cdaa9
-0,     137207,     137207,      512,     1024, 0x9531e9f1
-0,     137724,     137724,      512,     1024, 0x223ce536
-0,     138236,     138236,      512,     1024, 0xdfbce5f9
-0,     138748,     138748,      512,     1024, 0x20b6ed7d
-0,     139257,     139257,      512,     1024, 0x1a17e109
-0,     139775,     139775,      512,     1024, 0xc672eaea
-0,     140287,     140287,      512,     1024, 0x12a7dc5e
-0,     140799,     140799,      512,     1024, 0x4497f342
-0,     141308,     141308,      512,     1024, 0xdfb5db4b
-0,     141815,     141815,      512,     1024, 0xde48ef6c
-0,     142333,     142333,      512,     1024, 0x1d98e316
-0,     142845,     142845,      512,     1024, 0xbd2ad72f
-0,     143357,     143357,      512,     1024, 0xf1aad776
-0,     143866,     143866,      512,     1024, 0x4db3e3c0
-0,     144383,     144383,      512,     1024, 0x832de0a0
-0,     144895,     144895,      512,     1024, 0xc5f0ef25
-0,     145407,     145407,      512,     1024, 0x419bda6e
-0,     145916,     145916,      512,     1024, 0x5de7f77e
-0,     146424,     146424,      512,     1024, 0x0063ec9a
-0,     146941,     146941,      512,     1024, 0x10c3d470
-0,     147453,     147453,      512,     1024, 0xba66d226
-0,     147965,     147965,      512,     1024, 0xea47ded3
-0,     148474,     148474,      512,     1024, 0x6202d67b
-0,     148992,     148992,      512,     1024, 0x3f80e7cf
-0,     149504,     149504,      512,     1024, 0x4e64eaae
-0,     150016,     150016,      512,     1024, 0x2108e83d
-0,     150525,     150525,      512,     1024, 0x38c3dec1
-0,     151032,     151032,      512,     1024, 0x46d3f77a
-0,     151550,     151550,      512,     1024, 0x4838e787
-0,     152062,     152062,      512,     1024, 0xc71df16d
-0,     152574,     152574,      512,     1024, 0xdbe4ebbd
-0,     153083,     153083,      512,     1024, 0xa156d07b
+0,     133110,     133110,      512,     1024, 0xaf7acef7
+0,     133622,     133622,      512,     1024, 0x3f9bf258
+0,     134134,     134134,      512,     1024, 0xcf54e9d6
+0,     134646,     134646,      512,     1024, 0x680cd0aa
+0,     135158,     135158,      512,     1024, 0x3c1bdc1f
+0,     135670,     135670,      512,     1024, 0x8c8ffe22
+0,     136182,     136182,      512,     1024, 0xf415d362
+0,     136694,     136694,      512,     1024, 0x8c8cdaa9
+0,     137206,     137206,      512,     1024, 0x9531e9f1
+0,     137718,     137718,      512,     1024, 0x223ce536
+0,     138230,     138230,      512,     1024, 0xdfbce5f9
+0,     138742,     138742,      512,     1024, 0x20b6ed7d
+0,     139254,     139254,      512,     1024, 0x1a17e109
+0,     139766,     139766,      512,     1024, 0xc672eaea
+0,     140278,     140278,      512,     1024, 0x12a7dc5e
+0,     140790,     140790,      512,     1024, 0x4497f342
+0,     141302,     141302,      512,     1024, 0xdfb5db4b
+0,     141814,     141814,      512,     1024, 0xde48ef6c
+0,     142326,     142326,      512,     1024, 0x1d98e316
+0,     142838,     142838,      512,     1024, 0xbd2ad72f
+0,     143350,     143350,      512,     1024, 0xf1aad776
+0,     143862,     143862,      512,     1024, 0x4db3e3c0
+0,     144374,     144374,      512,     1024, 0x832de0a0
+0,     144886,     144886,      512,     1024, 0xc5f0ef25
+0,     145398,     145398,      512,     1024, 0x419bda6e
+0,     145910,     145910,      512,     1024, 0x5de7f77e
+0,     146422,     146422,      512,     1024, 0x0063ec9a
+0,     146934,     146934,      512,     1024, 0x10c3d470
+0,     147446,     147446,      512,     1024, 0xba66d226
+0,     147958,     147958,      512,     1024, 0xea47ded3
+0,     148470,     148470,      512,     1024, 0x6202d67b
+0,     148982,     148982,      512,     1024, 0x3f80e7cf
+0,     149494,     149494,      512,     1024, 0x4e64eaae
+0,     150006,     150006,      512,     1024, 0x2108e83d
+0,     150518,     150518,      512,     1024, 0x38c3dec1
+0,     151030,     151030,      512,     1024, 0x46d3f77a
+0,     151542,     151542,      512,     1024, 0x4838e787
+0,     152054,     152054,      512,     1024, 0xc71df16d
+0,     152566,     152566,      512,     1024, 0xdbe4ebbd
+0,     153078,     153078,      512,     1024, 0xa156d07b
 0,     153590,     153590,      512,     1024, 0x34eddc80
-0,     154107,     154107,      512,     1024, 0xe840e87c
-0,     154619,     154619,      512,     1024, 0x6accf8f5
-0,     155131,     155131,      512,     1024, 0xa1dbebb9
-0,     155640,     155640,      512,     1024, 0x6d07d98c
-0,     156158,     156158,      512,     1024, 0x94c7e805
-0,     156670,     156670,      512,     1024, 0x5199e586
-0,     157182,     157182,      512,     1024, 0xe797e1aa
-0,     157691,     157691,      512,     1024, 0xff19eda7
+0,     154102,     154102,      512,     1024, 0xe840e87c
+0,     154614,     154614,      512,     1024, 0x6accf8f5
+0,     155126,     155126,      512,     1024, 0xa1dbebb9
+0,     155638,     155638,      512,     1024, 0x6d07d98c
+0,     156150,     156150,      512,     1024, 0x94c7e805
+0,     156662,     156662,      512,     1024, 0x5199e586
+0,     157174,     157174,      512,     1024, 0xe797e1aa
+0,     157686,     157686,      512,     1024, 0xff19eda7
 0,     158198,     158198,      512,     1024, 0x9cb9d040
-0,     158716,     158716,      512,     1024, 0xaeedd325
-0,     159228,     159228,      512,     1024, 0xf5ade306
-0,     159740,     159740,      512,     1024, 0x54a5e129
-0,     160249,     160249,      512,     1024, 0x6665ddeb
-0,     160767,     160767,      512,     1024, 0x9d18e033
-0,     161279,     161279,      512,     1024, 0x7f23df74
-0,     161791,     161791,      512,     1024, 0x7c34f158
-0,     162300,     162300,      512,     1024, 0x47f6dae2
-0,     162807,     162807,      512,     1024, 0x5ffdd903
-0,     163324,     163324,      512,     1024, 0x8233d108
-0,     163836,     163836,      512,     1024, 0x45c6e20d
-0,     164348,     164348,      512,     1024, 0xae11fa6e
-0,     164857,     164857,      512,     1024, 0xa30defd2
-0,     165375,     165375,      512,     1024, 0xfc1ecccf
-0,     165887,     165887,      512,     1024, 0x920edc94
-0,     166399,     166399,      512,     1024, 0xd7f3dc58
-0,     166908,     166908,      512,     1024, 0x4972d37d
-0,     167415,     167415,      512,     1024, 0xfefef358
-0,     167933,     167933,      512,     1024, 0x3648e473
-0,     168445,     168445,      512,     1024, 0x58dee6c3
-0,     168957,     168957,      512,     1024, 0x9cc6df27
-0,     169466,     169466,      512,     1024, 0x6adfe99c
-0,     169983,     169983,      512,     1024, 0x6a56e11f
-0,     170495,     170495,      512,     1024, 0x4860edf1
-0,     171007,     171007,      512,     1024, 0x9132f10a
-0,     171516,     171516,      512,     1024, 0x3e09d209
-0,     172024,     172024,      512,     1024, 0x4b6bf4d8
-0,     172541,     172541,      512,     1024, 0x0cd5e838
-0,     173053,     173053,      512,     1024, 0x080be078
-0,     173565,     173565,      512,     1024, 0xfdb0e31c
-0,     174074,     174074,      512,     1024, 0xced5e7bd
-0,     174592,     174592,      512,     1024, 0x65b3e435
-0,     175104,     175104,      512,     1024, 0x5b5bfe2e
-0,     175616,     175616,      512,     1024, 0xa8bde3cb
-0,     176125,     176125,      512,     1024, 0xfd0fdefa
-0,     176632,     176632,      512,     1024, 0xbec4ef95
-0,     177150,     177150,      512,     1024, 0x683ad8dd
-0,     177662,     177662,      512,     1024, 0x8eefeb77
-0,     178174,     178174,      512,     1024, 0x84fc5878
-0,     178683,     178683,      512,     1024, 0x9a0ded60
+0,     158710,     158710,      512,     1024, 0xaeedd325
+0,     159222,     159222,      512,     1024, 0xf5ade306
+0,     159734,     159734,      512,     1024, 0x54a5e129
+0,     160246,     160246,      512,     1024, 0x6665ddeb
+0,     160758,     160758,      512,     1024, 0x9d18e033
+0,     161270,     161270,      512,     1024, 0x7f23df74
+0,     161782,     161782,      512,     1024, 0x7c34f158
+0,     162294,     162294,      512,     1024, 0x47f6dae2
+0,     162806,     162806,      512,     1024, 0x5ffdd903
+0,     163318,     163318,      512,     1024, 0x8233d108
+0,     163830,     163830,      512,     1024, 0x45c6e20d
+0,     164342,     164342,      512,     1024, 0xae11fa6e
+0,     164854,     164854,      512,     1024, 0xa30defd2
+0,     165366,     165366,      512,     1024, 0xfc1ecccf
+0,     165878,     165878,      512,     1024, 0x920edc94
+0,     166390,     166390,      512,     1024, 0xd7f3dc58
+0,     166902,     166902,      512,     1024, 0x4972d37d
+0,     167414,     167414,      512,     1024, 0xfefef358
+0,     167926,     167926,      512,     1024, 0x3648e473
+0,     168438,     168438,      512,     1024, 0x58dee6c3
+0,     168950,     168950,      512,     1024, 0x9cc6df27
+0,     169462,     169462,      512,     1024, 0x6adfe99c
+0,     169974,     169974,      512,     1024, 0x6a56e11f
+0,     170486,     170486,      512,     1024, 0x4860edf1
+0,     170998,     170998,      512,     1024, 0x9132f10a
+0,     171510,     171510,      512,     1024, 0x3e09d209
+0,     172022,     172022,      512,     1024, 0x4b6bf4d8
+0,     172534,     172534,      512,     1024, 0x0cd5e838
+0,     173046,     173046,      512,     1024, 0x080be078
+0,     173558,     173558,      512,     1024, 0xfdb0e31c
+0,     174070,     174070,      512,     1024, 0xced5e7bd
+0,     174582,     174582,      512,     1024, 0x65b3e435
+0,     175094,     175094,      512,     1024, 0x5b5bfe2e
+0,     175606,     175606,      512,     1024, 0xa8bde3cb
+0,     176118,     176118,      512,     1024, 0xfd0fdefa
+0,     176630,     176630,      512,     1024, 0xbec4ef95
+0,     177142,     177142,      512,     1024, 0x683ad8dd
+0,     177654,     177654,      512,     1024, 0x8eefeb77
+0,     178166,     178166,      512,     1024, 0x84fc5878
+0,     178678,     178678,      512,     1024, 0x9a0ded60
diff --git a/tests/ref/fate/pcm_dvd-16-5.1-96000 b/tests/ref/fate/pcm_dvd-16-5.1-96000
index 64447a9aa5..68dce2d3a6 100644
--- a/tests/ref/fate/pcm_dvd-16-5.1-96000
+++ b/tests/ref/fate/pcm_dvd-16-5.1-96000
@@ -13,7 +13,7 @@ d8e182dfa46524c28d1f78a4cc1f2719 *tests/data/fate/pcm_dvd-16-5.1-96000.vob
 0,        835,        835,      167,     2004, 0x00000000
 0,       1002,       1002,      167,     2004, 0x00000000
 0,       1169,       1169,      167,     2004, 0x00000000
-0,       1337,       1337,      167,     2004, 0x00000000
+0,       1336,       1336,      167,     2004, 0x00000000
 0,       1503,       1503,      167,     2004, 0x00000000
 0,       1670,       1670,      167,     2004, 0x00000000
 0,       1837,       1837,      167,     2004, 0x00000000
@@ -29,7 +29,7 @@ d8e182dfa46524c28d1f78a4cc1f2719 *tests/data/fate/pcm_dvd-16-5.1-96000.vob
 0,       3507,       3507,      167,     2004, 0x00000000
 0,       3674,       3674,      167,     2004, 0x00000000
 0,       3841,       3841,      167,     2004, 0x00000000
-0,       4009,       4009,      167,     2004, 0x00000000
+0,       4008,       4008,      167,     2004, 0x00000000
 0,       4175,       4175,      167,     2004, 0x00000000
 0,       4342,       4342,      167,     2004, 0x00000000
 0,       4509,       4509,      167,     2004, 0x00000000
@@ -45,7 +45,7 @@ d8e182dfa46524c28d1f78a4cc1f2719 *tests/data/fate/pcm_dvd-16-5.1-96000.vob
 0,       6179,       6179,      167,     2004, 0x00000000
 0,       6346,       6346,      167,     2004, 0x00000000
 0,       6513,       6513,      167,     2004, 0x00000000
-0,       6681,       6681,      166,     1992, 0x00000000
-0,       6847,       6847,      167,     2004, 0x00000000
+0,       6680,       6680,      166,     1992, 0x00000000
+0,       6846,       6846,      167,     2004, 0x00000000
 0,       7014,       7014,      167,     2004, 0x00000000
 0,       7181,       7181,      101,     1212, 0x00000000
diff --git a/tests/ref/lavf/smjpeg b/tests/ref/lavf/smjpeg
index 94172a6b1e..537c0847cb 100644
--- a/tests/ref/lavf/smjpeg
+++ b/tests/ref/lavf/smjpeg
@@ -1,3 +1,3 @@
 3fe90213ac4f5275eb85ad0a4e4bdb44 *tests/data/lavf/lavf.smjpeg
 728642 tests/data/lavf/lavf.smjpeg
-tests/data/lavf/lavf.smjpeg CRC=0x75066147
+tests/data/lavf/lavf.smjpeg CRC=0x54bf6147
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 17/21] fftools/ffmpeg: stop using InputStream.pts for generating video timestamps
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (14 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 16/21] fftools/ffmpeg: rework audio-decode timestamp handling Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 18/21] fftools/ffmpeg_filter: stop using InputStream.pts for filter EOF ts Anton Khirnov
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

This was added in 380db569287ba99d903b7629f209b9adc7fd2723 as a
temporary crutch that is not needed anymore. The only case where this
code can be triggered is the very first frame, for which InputStream.pts
is always equal to 0.
---
 fftools/ffmpeg.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index d074d3e03b..a69aceec9f 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1114,12 +1114,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_
         best_effort_timestamp = ist->cfr_next_pts++;
 
     // no timestamp available - extrapolate from previous frame duration
-    if (best_effort_timestamp == AV_NOPTS_VALUE &&
-        ist->last_frame_pts != AV_NOPTS_VALUE)
-        best_effort_timestamp = ist->last_frame_pts + ist->last_frame_duration_est;
-
     if (best_effort_timestamp == AV_NOPTS_VALUE)
-        best_effort_timestamp = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ist->st->time_base);
+        best_effort_timestamp = ist->last_frame_pts == AV_NOPTS_VALUE ? 0 :
+                                ist->last_frame_pts + ist->last_frame_duration_est;
 
     if(best_effort_timestamp != AV_NOPTS_VALUE) {
         int64_t ts = av_rescale_q(decoded_frame->pts = best_effort_timestamp, ist->st->time_base, AV_TIME_BASE_Q);
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 18/21] fftools/ffmpeg_filter: stop using InputStream.pts for filter EOF ts
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (15 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 17/21] fftools/ffmpeg: stop using InputStream.pts for generating video timestamps Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 19/21] fftools/ffmpeg: drop InputStream.[next_]pts Anton Khirnov
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

Use InputStream.last_frame_pts/duration instead, which is more accurate.
---
 fftools/ffmpeg.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index a69aceec9f..3ffc37729c 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1374,7 +1374,9 @@ static int send_filter_eof(InputStream *ist)
     int i, ret;
 
     for (i = 0; i < ist->nb_filters; i++) {
-        ret = ifilter_send_eof(ist->filters[i], ist->pts, AV_TIME_BASE_Q);
+        int64_t end_pts = ist->last_frame_pts == AV_NOPTS_VALUE ? AV_NOPTS_VALUE :
+                          ist->last_frame_pts + ist->last_frame_duration_est;
+        ret = ifilter_send_eof(ist->filters[i], end_pts, ist->last_frame_tb);
         if (ret < 0)
             return ret;
     }
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 19/21] fftools/ffmpeg: drop InputStream.[next_]pts
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (16 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 18/21] fftools/ffmpeg_filter: stop using InputStream.pts for filter EOF ts Anton Khirnov
@ 2023-04-27 14:25 ` Anton Khirnov
  2023-04-27 14:26 ` [FFmpeg-devel] [PATCH 20/21] fftools/ffmpeg: constify packets passed to decode*() Anton Khirnov
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:25 UTC (permalink / raw)
  To: ffmpeg-devel

They are no longer used for anything.
---
 fftools/ffmpeg.c       | 20 +-------------------
 fftools/ffmpeg.h       |  4 ----
 fftools/ffmpeg_demux.c |  1 -
 3 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 3ffc37729c..83abc4e86e 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -976,8 +976,6 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
 
     /* increment next_dts to use for the case where the input stream does not
        have timestamps or there are multiple frames in the packet */
-    ist->next_pts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) /
-                     decoded_frame->sample_rate;
     ist->next_dts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) /
                      decoded_frame->sample_rate;
 
@@ -1119,10 +1117,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_
                                 ist->last_frame_pts + ist->last_frame_duration_est;
 
     if(best_effort_timestamp != AV_NOPTS_VALUE) {
-        int64_t ts = av_rescale_q(decoded_frame->pts = best_effort_timestamp, ist->st->time_base, AV_TIME_BASE_Q);
-
-        if (ts != AV_NOPTS_VALUE)
-            ist->next_pts = ist->pts = ts;
+        decoded_frame->pts = best_effort_timestamp;
     }
 
     // update timestamp history
@@ -1398,7 +1393,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
     if (!ist->saw_first_ts) {
         ist->first_dts =
         ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
-        ist->pts = 0;
         if (pkt && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) {
             ist->first_dts =
             ist->dts += av_rescale_q(pkt->pts, pkt->time_base, AV_TIME_BASE_Q);
@@ -1408,8 +1402,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
 
     if (ist->next_dts == AV_NOPTS_VALUE)
         ist->next_dts = ist->dts;
-    if (ist->next_pts == AV_NOPTS_VALUE)
-        ist->next_pts = ist->pts;
 
     if (pkt) {
         av_packet_unref(avpkt);
@@ -1420,8 +1412,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
 
     if (pkt && pkt->dts != AV_NOPTS_VALUE) {
         ist->next_dts = ist->dts = av_rescale_q(pkt->dts, pkt->time_base, AV_TIME_BASE_Q);
-        if (par->codec_type != AVMEDIA_TYPE_VIDEO)
-            ist->pts = ist->dts;
     }
 
     // while we have more to decode or while the decoder did output something on EOF
@@ -1431,7 +1421,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
         int got_output = 0;
         int decode_failed = 0;
 
-        ist->pts = ist->next_pts;
         ist->dts = ist->next_dts;
 
         switch (par->codec_type) {
@@ -1461,13 +1450,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
                     ist->next_dts = AV_NOPTS_VALUE;
             }
 
-            if (got_output) {
-                if (duration_pts > 0) {
-                    ist->next_pts += av_rescale_q(duration_pts, ist->st->time_base, AV_TIME_BASE_Q);
-                } else {
-                    ist->next_pts += duration_dts;
-                }
-            }
             av_packet_unref(avpkt);
             break;
         case AVMEDIA_TYPE_SUBTITLE:
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index c4abf89b58..b6389d7f99 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -366,10 +366,6 @@ typedef struct InputStream {
     int64_t first_dts;       ///< dts of the first packet read for this stream (in AV_TIME_BASE units)
     int64_t       dts;       ///< dts of the last packet read for this stream (in AV_TIME_BASE units)
 
-    /* predicted pts of the next decoded frame, in AV_TIME_BASE */
-    int64_t       next_pts;
-    int64_t       pts;       ///< current pts of the decoded frame  (in AV_TIME_BASE units)
-
     // pts/estimated duration of the last decoded frame
     // * in decoder timebase for video,
     // * in last_frame_tb (may change during decoding) for audio
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index f8d95d1de6..26426c7ac1 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -744,7 +744,6 @@ static void add_input_streams(const OptionsContext *o, Demuxer *d)
         st->discard  = AVDISCARD_ALL;
         ist->nb_samples = 0;
         ist->first_dts = AV_NOPTS_VALUE;
-        ist->next_pts  = AV_NOPTS_VALUE;
         ist->next_dts  = AV_NOPTS_VALUE;
 
         ds->min_pts = INT64_MAX;
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 20/21] fftools/ffmpeg: constify packets passed to decode*()
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (17 preceding siblings ...)
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 19/21] fftools/ffmpeg: drop InputStream.[next_]pts Anton Khirnov
@ 2023-04-27 14:26 ` Anton Khirnov
  2023-04-27 14:26 ` [FFmpeg-devel] [PATCH 21/21] fftools/ffmpeg: always use the same path for setting InputStream.[next_]dts Anton Khirnov
  2023-05-01 13:45 ` [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:26 UTC (permalink / raw)
  To: ffmpeg-devel

They are not modified by these functions.
---
 fftools/ffmpeg.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 83abc4e86e..07bd40749d 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -822,7 +822,7 @@ int ifilter_has_all_input_formats(FilterGraph *fg)
 // it again with pkt=NULL. pkt==NULL is treated differently from pkt->size==0
 // (pkt==NULL means get more output, pkt->size==0 is a flush/drain packet)
 static int decode(InputStream *ist, AVCodecContext *avctx,
-                  AVFrame *frame, int *got_frame, AVPacket *pkt)
+                  AVFrame *frame, int *got_frame, const AVPacket *pkt)
 {
     int ret;
 
@@ -952,7 +952,7 @@ static void audio_ts_process(InputStream *ist, AVFrame *frame)
     frame->time_base = tb_filter;
 }
 
-static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
+static int decode_audio(InputStream *ist, const AVPacket *pkt, int *got_output,
                         int *decode_failed)
 {
     AVFrame *decoded_frame = ist->decoded_frame;
@@ -1040,8 +1040,8 @@ static int64_t video_duration_estimate(const InputStream *ist, const AVFrame *fr
     return FFMAX(ist->last_frame_duration_est, 1);
 }
 
-static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_t *duration_pts, int eof,
-                        int *decode_failed)
+static int decode_video(InputStream *ist, const AVPacket *pkt, int *got_output,
+                        int64_t *duration_pts, int eof, int *decode_failed)
 {
     AVFrame *decoded_frame = ist->decoded_frame;
     int ret = 0, err = 0;
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH 21/21] fftools/ffmpeg: always use the same path for setting InputStream.[next_]dts
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (18 preceding siblings ...)
  2023-04-27 14:26 ` [FFmpeg-devel] [PATCH 20/21] fftools/ffmpeg: constify packets passed to decode*() Anton Khirnov
@ 2023-04-27 14:26 ` Anton Khirnov
  2023-05-01 13:45 ` [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
  20 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-27 14:26 UTC (permalink / raw)
  To: ffmpeg-devel

Currently those are set in different ways depending on whether the
stream is decoded or not, using some values from the decoder if it is.
This is wrong, because there may be arbitrary amount of delay between
input packets and output frames (depending e.g. on the thread count when
frame threading is used).

Always use the path that was previously used only for streamcopy. This
should not cause any issues, because these values are now used only for
streamcopy and discontinuity handling.

This change will allow to decouple discontinuity processing from
decoding and move it to ffmpeg_demux. It also makes the code simpler.

Changes output in fate-cover-art-aiff-id3v2-remux and
fate-cover-art-mp3-id3v2-remux, where attached pictures are now written
in the correct order. This happens because InputStream.dts is no longer
reset to AV_NOPTS_VALUE after decoding, so streamcopy actually sees
valid dts values.
---
 fftools/ffmpeg.c                          | 34 ++++-------------------
 tests/ref/fate/cover-art-aiff-id3v2-remux | 34 +++++++++++------------
 tests/ref/fate/cover-art-mp3-id3v2-remux  | 22 +++++++--------
 3 files changed, 33 insertions(+), 57 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 07bd40749d..c72fc6608e 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -974,11 +974,6 @@ static int decode_audio(InputStream *ist, const AVPacket *pkt, int *got_output,
     ist->samples_decoded += decoded_frame->nb_samples;
     ist->frames_decoded++;
 
-    /* increment next_dts to use for the case where the input stream does not
-       have timestamps or there are multiple frames in the packet */
-    ist->next_dts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) /
-                     decoded_frame->sample_rate;
-
     audio_ts_process(ist, decoded_frame);
 
     ist->nb_samples = decoded_frame->nb_samples;
@@ -1393,7 +1388,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
     if (!ist->saw_first_ts) {
         ist->first_dts =
         ist->dts = ist->st->avg_frame_rate.num ? - ist->dec_ctx->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
-        if (pkt && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) {
+        if (pkt && pkt->pts != AV_NOPTS_VALUE) {
             ist->first_dts =
             ist->dts += av_rescale_q(pkt->pts, pkt->time_base, AV_TIME_BASE_Q);
         }
@@ -1416,13 +1411,10 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
 
     // while we have more to decode or while the decoder did output something on EOF
     while (ist->decoding_needed) {
-        int64_t duration_dts = 0;
         int64_t duration_pts = 0;
         int got_output = 0;
         int decode_failed = 0;
 
-        ist->dts = ist->next_dts;
-
         switch (par->codec_type) {
         case AVMEDIA_TYPE_AUDIO:
             ret = decode_audio    (ist, repeating ? NULL : avpkt, &got_output,
@@ -1432,23 +1424,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
         case AVMEDIA_TYPE_VIDEO:
             ret = decode_video    (ist, repeating ? NULL : avpkt, &got_output, &duration_pts, !pkt,
                                    &decode_failed);
-            if (!repeating || !pkt || got_output) {
-                if (pkt && pkt->duration) {
-                    duration_dts = av_rescale_q(pkt->duration, pkt->time_base, AV_TIME_BASE_Q);
-                } else if(ist->dec_ctx->framerate.num != 0 && ist->dec_ctx->framerate.den != 0) {
-                    int ticks = ist->last_pkt_repeat_pict >= 0 ?
-                                ist->last_pkt_repeat_pict + 1  :
-                                ist->dec_ctx->ticks_per_frame;
-                    duration_dts = ((int64_t)AV_TIME_BASE *
-                                    ist->dec_ctx->framerate.den * ticks) /
-                                    ist->dec_ctx->framerate.num / ist->dec_ctx->ticks_per_frame;
-                }
-
-                if(ist->dts != AV_NOPTS_VALUE && duration_dts) {
-                    ist->next_dts += duration_dts;
-                }else
-                    ist->next_dts = AV_NOPTS_VALUE;
-            }
 
             av_packet_unref(avpkt);
             break;
@@ -1512,8 +1487,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
         }
     }
 
-    /* handle stream copy */
-    if (!ist->decoding_needed && pkt) {
+    if (pkt) {
         ist->dts = ist->next_dts;
         switch (par->codec_type) {
         case AVMEDIA_TYPE_AUDIO:
@@ -1543,7 +1517,9 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
             }
             break;
         }
-    } else if (!ist->decoding_needed)
+    }
+
+    if (!pkt && !ist->decoding_needed)
         eof_reached = 1;
 
     duration_exceeded = 0;
diff --git a/tests/ref/fate/cover-art-aiff-id3v2-remux b/tests/ref/fate/cover-art-aiff-id3v2-remux
index 3ca2855eb8..a59ba37c65 100644
--- a/tests/ref/fate/cover-art-aiff-id3v2-remux
+++ b/tests/ref/fate/cover-art-aiff-id3v2-remux
@@ -1,4 +1,4 @@
-d4a9481090a8bab1a3f072a8108a1d6a *tests/data/fate/cover-art-aiff-id3v2-remux.aiff
+330ad2bf538e91a31752b38024461df1 *tests/data/fate/cover-art-aiff-id3v2-remux.aiff
 608914 tests/data/fate/cover-art-aiff-id3v2-remux.aiff
 #tb 0: 1/44100
 #media_type 0: audio
@@ -12,24 +12,24 @@ d4a9481090a8bab1a3f072a8108a1d6a *tests/data/fate/cover-art-aiff-id3v2-remux.aif
 #sar 1: 1/1
 #tb 2: 1/90000
 #media_type 2: video
-#codec_id 2: mjpeg
+#codec_id 2: png
 #dimensions 2: 350x350
 #sar 2: 1/1
 #tb 3: 1/90000
 #media_type 3: video
-#codec_id 3: png
+#codec_id 3: bmp
 #dimensions 3: 350x350
-#sar 3: 1/1
+#sar 3: 0/1
 #tb 4: 1/90000
 #media_type 4: video
-#codec_id 4: bmp
+#codec_id 4: mjpeg
 #dimensions 4: 350x350
-#sar 4: 0/1
+#sar 4: 1/1
 0,          0,          0,     1024,     4096, 0xdac4695d
 1,          0,          0,        0,    19650, 0xd5662610
-2,          0,          0,        0,    19650, 0xd5662610
-3,          0,          0,        0,   184497, 0xc33f8d44
-4,          0,          0,        0,   368254, 0xfa7f4bd8
+2,          0,          0,        0,   184497, 0xc33f8d44
+3,          0,          0,        0,   368254, 0xfa7f4bd8
+4,          0,          0,        0,    19650, 0xd5662610
 0,       1024,       1024,     1024,     4096, 0xad05c909
 0,       2048,       2048,     1024,     4096, 0x97e3b8f8
 0,       3072,       3072,     1024,     4096, 0xb08180fa
@@ -47,25 +47,25 @@ TAG:comment=Other
 [/STREAM]
 [STREAM]
 index=2
-codec_name=mjpeg
-DISPOSITION:attached_pic=1
-TAG:title=fourth
-TAG:comment=Composer
-[/STREAM]
-[STREAM]
-index=3
 codec_name=png
 DISPOSITION:attached_pic=1
 TAG:title=second
 TAG:comment=Illustration
 [/STREAM]
 [STREAM]
-index=4
+index=3
 codec_name=bmp
 DISPOSITION:attached_pic=1
 TAG:title=third
 TAG:comment=Conductor
 [/STREAM]
+[STREAM]
+index=4
+codec_name=mjpeg
+DISPOSITION:attached_pic=1
+TAG:title=fourth
+TAG:comment=Composer
+[/STREAM]
 [FORMAT]
 TAG:artist=Мельница
 TAG:RATING=0
diff --git a/tests/ref/fate/cover-art-mp3-id3v2-remux b/tests/ref/fate/cover-art-mp3-id3v2-remux
index 906a646799..52b7e72a56 100644
--- a/tests/ref/fate/cover-art-mp3-id3v2-remux
+++ b/tests/ref/fate/cover-art-mp3-id3v2-remux
@@ -1,4 +1,4 @@
-c1b55a9a92226cd72d3f53ccd830d127 *tests/data/fate/cover-art-mp3-id3v2-remux.mp3
+94946f0efd5f9bb0061ac1fbff7d731f *tests/data/fate/cover-art-mp3-id3v2-remux.mp3
 399346 tests/data/fate/cover-art-mp3-id3v2-remux.mp3
 #tb 0: 1/14112000
 #media_type 0: audio
@@ -7,22 +7,22 @@ c1b55a9a92226cd72d3f53ccd830d127 *tests/data/fate/cover-art-mp3-id3v2-remux.mp3
 #channel_layout_name 0: stereo
 #tb 1: 1/90000
 #media_type 1: video
-#codec_id 1: mjpeg
+#codec_id 1: bmp
 #dimensions 1: 263x263
-#sar 1: 96/96
+#sar 1: 0/1
 #tb 2: 1/90000
 #media_type 2: video
-#codec_id 2: bmp
+#codec_id 2: mjpeg
 #dimensions 2: 263x263
-#sar 2: 0/1
+#sar 2: 96/96
 #tb 3: 1/90000
 #media_type 3: video
 #codec_id 3: png
 #dimensions 3: 263x263
 #sar 3: 1/1
 0,    -353590,    -353590,   368640,      417, 0x15848290, S=1,       10
-1,          0,          0,        0,    15760, 0x71d5c418
-2,          0,          0,        0,   208350, 0x291b44d1
+1,          0,          0,        0,   208350, 0x291b44d1
+2,          0,          0,        0,    15760, 0x71d5c418
 3,          0,          0,        0,   165671, 0x7c1c8070
 0,      15050,      15050,   368640,      418, 0x46f684a4
 0,     383690,     383690,   368640,      418, 0x46f684a4
@@ -36,15 +36,15 @@ TAG:encoder=Lavf
 [/STREAM]
 [STREAM]
 index=1
-codec_name=mjpeg
+codec_name=bmp
 DISPOSITION:attached_pic=1
-TAG:comment=Other
+TAG:comment=Band/Orchestra
 [/STREAM]
 [STREAM]
 index=2
-codec_name=bmp
+codec_name=mjpeg
 DISPOSITION:attached_pic=1
-TAG:comment=Band/Orchestra
+TAG:comment=Other
 [/STREAM]
 [STREAM]
 index=3
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data Anton Khirnov
@ 2023-04-28  8:45   ` Nicolas George
  2023-04-28 12:01     ` James Almer
  0 siblings, 1 reply; 38+ messages in thread
From: Nicolas George @ 2023-04-28  8:45 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 388 bytes --]

Anton Khirnov (12023-04-27):
> Start by moving OutputStream.filtered_frame to it, which really belongs
> to the filtergraph rather than the output stream.

Then just move them to OutputStream. This is just code noise for no
practical benefit, since ffmpeg is not a library and does not have to
deal with ABI stability or types declared in private headers.

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 09/21] fftools/ffmpeg_filter: make graph_desc private
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 09/21] fftools/ffmpeg_filter: make graph_desc private Anton Khirnov
@ 2023-04-28  8:46   ` Nicolas George
  0 siblings, 0 replies; 38+ messages in thread
From: Nicolas George @ 2023-04-28  8:46 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 281 bytes --]

Anton Khirnov (12023-04-27):
> It is not used outside of ffmpeg_filter.
> ---
>  fftools/ffmpeg.h        |  1 -
>  fftools/ffmpeg_filter.c | 22 ++++++++++++++--------
>  2 files changed, 14 insertions(+), 9 deletions(-)

Completely useless change.

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 11/21] fftools/ffmpeg_filter: add InputFilter private data
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 11/21] fftools/ffmpeg_filter: add InputFilter private data Anton Khirnov
@ 2023-04-28  8:47   ` Nicolas George
  0 siblings, 0 replies; 38+ messages in thread
From: Nicolas George @ 2023-04-28  8:47 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 360 bytes --]

Anton Khirnov (12023-04-27):
> Move InputFilter.frame_queue to it, which is not accessed outside of
> ffmpeg_filter.
> ---
>  fftools/ffmpeg.h        |  2 --
>  fftools/ffmpeg_filter.c | 33 ++++++++++++++++++++++++---------
>  2 files changed, 24 insertions(+), 11 deletions(-)

Same as FilterGraph: compleely useless change.

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 12/21] fftools/ffmpeg_filter: keep track of filtergraph input timebase
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 12/21] fftools/ffmpeg_filter: keep track of filtergraph input timebase Anton Khirnov
@ 2023-04-28  8:48   ` Nicolas George
  0 siblings, 0 replies; 38+ messages in thread
From: Nicolas George @ 2023-04-28  8:48 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 643 bytes --]

Anton Khirnov (12023-04-27):
> Will be useful in following commits.
> ---
>  fftools/ffmpeg_filter.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
> index 6b92bc074e..3c6c580093 100644
> --- a/fftools/ffmpeg_filter.c
> +++ b/fftools/ffmpeg_filter.c
> @@ -55,6 +55,8 @@ static FilterGraphPriv *fgp_from_fg(FilterGraph *fg)
>  typedef struct InputFilterPriv {
>      InputFilter ifilter;
>  
> +    AVRational time_base;
> +
>      AVFifo *frame_queue;
>  } InputFilterPriv;

Just put it in InputFilter.

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 16/21] fftools/ffmpeg: rework audio-decode timestamp handling
  2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 16/21] fftools/ffmpeg: rework audio-decode timestamp handling Anton Khirnov
@ 2023-04-28 11:42   ` Michael Niedermayer
  2023-04-28 13:11     ` Anton Khirnov
  0 siblings, 1 reply; 38+ messages in thread
From: Michael Niedermayer @ 2023-04-28 11:42 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 1424 bytes --]

On Thu, Apr 27, 2023 at 04:25:56PM +0200, Anton Khirnov wrote:
> Stop using InputStream.dts for generating missing timestamps for decoded
> frames, because it contains pre-decoding timestamps and there may be
> arbitrary amount of delay between input packets and output frames (e.g.
> dependent on the thread count when frame threading is used). It is also
> in AV_TIME_BASE (i.e. microseconds), which may introduce unnecessary
> rounding issues.
> 

> New code maintains a timebase that is the inverse of the LCM of all the
> samplerates seen so far, and thus can accurately represent every audio

if the LCM fits in int32

This can hit some pathologic cases though
consider a 192khz stream that starts with a damaged packet thats read as 11.197 khz
lcm of 192000 and 11197 > 2^31 so the whole stream will then be stuck with 11.197khz
that seems like a bad choice
the code should favor standard sample rates as well as the higher sample rate if
the lcm is not representable

also if lets say there are 48khz and 48.001khz where again lcm doesnt work 
then a multiple of 48khz may be a better choice than either itself

also what happens if the audio timestamps are known more precissely than
the audio sample rate ?

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data
  2023-04-28  8:45   ` Nicolas George
@ 2023-04-28 12:01     ` James Almer
  2023-04-28 13:52       ` Nicolas George
  0 siblings, 1 reply; 38+ messages in thread
From: James Almer @ 2023-04-28 12:01 UTC (permalink / raw)
  To: ffmpeg-devel

On 4/28/2023 5:45 AM, Nicolas George wrote:
> Anton Khirnov (12023-04-27):
>> Start by moving OutputStream.filtered_frame to it, which really belongs
>> to the filtergraph rather than the output stream.
> 
> Then just move them to OutputStream. This is just code noise for no
> practical benefit, since ffmpeg is not a library and does not have to
> deal with ABI stability or types declared in private headers.

The longtime goal of this work is to have completely standalone modules 
within the CLI and each of them threaded. So while ffmpeg may not be a 
library, clearly defining what fields should be accessed from "the 
outside" and which shouldn't would have the same effect and benefits as 
if it was one, particularly ensuring no future accidental usage of 
fields that should not be touched. The decoder side for example has no 
need to touch a frame the filtering side is using internally, and more 
so if it could result in races.

There's also the fact Anton is maintaining this code and this helps him 
keep track of the nature of each field, plus the fact this same change 
has been done before elsewhere, so if you're going to argue you don't 
like it because in your opinion it's unnecessary, then that's not enough 
grounds to block it.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 16/21] fftools/ffmpeg: rework audio-decode timestamp handling
  2023-04-28 11:42   ` Michael Niedermayer
@ 2023-04-28 13:11     ` Anton Khirnov
  2023-04-28 19:24       ` Michael Niedermayer
  0 siblings, 1 reply; 38+ messages in thread
From: Anton Khirnov @ 2023-04-28 13:11 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Quoting Michael Niedermayer (2023-04-28 13:42:17)
> On Thu, Apr 27, 2023 at 04:25:56PM +0200, Anton Khirnov wrote:
> > Stop using InputStream.dts for generating missing timestamps for decoded
> > frames, because it contains pre-decoding timestamps and there may be
> > arbitrary amount of delay between input packets and output frames (e.g.
> > dependent on the thread count when frame threading is used). It is also
> > in AV_TIME_BASE (i.e. microseconds), which may introduce unnecessary
> > rounding issues.
> > 
> 
> > New code maintains a timebase that is the inverse of the LCM of all the
> > samplerates seen so far, and thus can accurately represent every audio
> 
> if the LCM fits in int32
> 
> This can hit some pathologic cases though
> consider a 192khz stream that starts with a damaged packet thats read as 11.197 khz
> lcm of 192000 and 11197 > 2^31 so the whole stream will then be stuck with 11.197khz
> that seems like a bad choice
> the code should favor standard sample rates as well as the higher sample rate if
> the lcm is not representable
> 
> also if lets say there are 48khz and 48.001khz where again lcm doesnt work 
> then a multiple of 48khz may be a better choice than either itself

Thank you, there are good points. I'm wondering if just picking the LCM
of all common samplerates (28224000 = lcm(192000, 44100)) wouldn't be
sufficient for all these pathological cases. Or do you have a better
general algorithm in mind? Maybe fall back on AV_TIME_BASE instead?

> also what happens if the audio timestamps are known more precissely than
> the audio sample rate ?

I'm not sure that is very relevant in real-world uses cases, but I've
added this snippet which should address this:

// keep the frame timebase if it is strictly better than
// the samplerate-defined one
if (frame->time_base.num == 1 && frame->time_base.den > tb_new.den &&
    !(frame->time_base.den % tb_new.den))
    tb_new = frame->time_base;

-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data
  2023-04-28 12:01     ` James Almer
@ 2023-04-28 13:52       ` Nicolas George
  2023-04-29  8:46         ` Nicolas George
  0 siblings, 1 reply; 38+ messages in thread
From: Nicolas George @ 2023-04-28 13:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 2217 bytes --]

James Almer (12023-04-28):
> The longtime goal of this work is to have completely standalone modules
> within the CLI and each of them threaded. So while ffmpeg may not be a
> library, clearly defining what fields should be accessed from "the outside"
> and which shouldn't would have the same effect and benefits as if it was
> one, particularly ensuring no future accidental usage of fields that should
> not be touched. The decoder side for example has no need to touch a frame
> the filtering side is using internally, and more so if it could result in
> races.
> 
> There's also the fact Anton is maintaining this code and this helps him keep
> track of the nature of each field, plus the fact this same change has been
> done before elsewhere, so if you're going to argue you don't like it because
> in your opinion it's unnecessary, then that's not enough grounds to block
> it.

(As Anton repeatedly said he does not accept the usefulness of the role
of maintainer, invoking that last argument feels a little like trying to
have it both ways. But since I do acknowledge the usefulness of
maintainers, I do accept it.)

Thanks. This is slightly more convincing than what was explained until
now. But there are ways of clearly stating which fields are internal and
which fields are ok for outside access without littering the code with
casts, because fgp_from_fg() and co. are exactly that.

And during the work of turning all into threads, opportunities to split
the structure in more logical ways with less code noise will almost
certainly present themselves.

Anyway, I find it sad that in the recent years FFmpeg has more and more
followed “good practices” not because, being good, they bring actual
benefit to the code but just because they're “good practices”. We are
not underskilled Java developers following the rules from the textbook
without understanding their purpose; we are FFmpeg, we try new and
original ways of writing code to make it more efficient and more
elegant. FilterGraphPriv is neither efficient nor elegant.

But if I failed to convince you or others with this mail, I will not
fight this anymore.

Regards,

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 16/21] fftools/ffmpeg: rework audio-decode timestamp handling
  2023-04-28 13:11     ` Anton Khirnov
@ 2023-04-28 19:24       ` Michael Niedermayer
  2023-04-29  7:32         ` [FFmpeg-devel] [PATCH] " Anton Khirnov
  0 siblings, 1 reply; 38+ messages in thread
From: Michael Niedermayer @ 2023-04-28 19:24 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 2107 bytes --]

On Fri, Apr 28, 2023 at 03:11:16PM +0200, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2023-04-28 13:42:17)
> > On Thu, Apr 27, 2023 at 04:25:56PM +0200, Anton Khirnov wrote:
> > > Stop using InputStream.dts for generating missing timestamps for decoded
> > > frames, because it contains pre-decoding timestamps and there may be
> > > arbitrary amount of delay between input packets and output frames (e.g.
> > > dependent on the thread count when frame threading is used). It is also
> > > in AV_TIME_BASE (i.e. microseconds), which may introduce unnecessary
> > > rounding issues.
> > > 
> > 
> > > New code maintains a timebase that is the inverse of the LCM of all the
> > > samplerates seen so far, and thus can accurately represent every audio
> > 
> > if the LCM fits in int32
> > 
> > This can hit some pathologic cases though
> > consider a 192khz stream that starts with a damaged packet thats read as 11.197 khz
> > lcm of 192000 and 11197 > 2^31 so the whole stream will then be stuck with 11.197khz
> > that seems like a bad choice
> > the code should favor standard sample rates as well as the higher sample rate if
> > the lcm is not representable
> > 
> > also if lets say there are 48khz and 48.001khz where again lcm doesnt work 
> > then a multiple of 48khz may be a better choice than either itself
> 
> Thank you, there are good points. I'm wondering if just picking the LCM
> of all common samplerates (28224000 = lcm(192000, 44100)) wouldn't be
> sufficient for all these pathological cases. Or do you have a better
> general algorithm in mind? Maybe fall back on AV_TIME_BASE instead?

28224000 is an option, so is AV_TIME_BASE. Neither contain 90khz though 
which is the mpeg-ps/ts "timebase". But i have the feeling if we keep adding
things then we will hit 32bit soon. 
28224000 is better for exactly representing timestamps, AV_TIME_BASE may be
easier for debuging.

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [FFmpeg-devel] [PATCH] fftools/ffmpeg: rework audio-decode timestamp handling
  2023-04-28 19:24       ` Michael Niedermayer
@ 2023-04-29  7:32         ` Anton Khirnov
  0 siblings, 0 replies; 38+ messages in thread
From: Anton Khirnov @ 2023-04-29  7:32 UTC (permalink / raw)
  To: ffmpeg-devel

Stop using InputStream.dts for generating missing timestamps for decoded
frames, because it contains pre-decoding timestamps and there may be
arbitrary amount of delay between input packets and output frames (e.g.
dependent on the thread count when frame threading is used). It is also
in AV_TIME_BASE (i.e. microseconds), which may introduce unnecessary
rounding issues.

New code maintains a timebase that is the inverse of the LCM of all the
samplerates seen so far, and thus can accurately represent every audio
sample. This timebase is used to generate missing timestamps after
decoding.

Changes the result of the following FATE tests
* pcm_dvd-16-5.1-96000
* lavf-smjpeg
* adpcm-ima-smjpeg
In all of these the timestamps now better correspond to actual frame
durations.
---
The branch can also be downloaded as 'ffmpeg_audio_ts' in my tree.
---
 fftools/ffmpeg.c                    |  98 ++++-
 fftools/ffmpeg.h                    |   8 +-
 fftools/ffmpeg_demux.c              |   6 +-
 tests/ref/fate/adpcm-ima-smjpeg     | 658 ++++++++++++++--------------
 tests/ref/fate/pcm_dvd-16-5.1-96000 |   8 +-
 tests/ref/lavf/smjpeg               |   2 +-
 6 files changed, 423 insertions(+), 357 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 8829a163e0..8dcc70e879 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -881,6 +881,85 @@ static int send_frame_to_filters(InputStream *ist, AVFrame *decoded_frame)
     return ret;
 }
 
+static AVRational audio_samplerate_update(InputStream *ist, const AVFrame *frame)
+{
+    const int prev = ist->last_frame_tb.den;
+    const int sr   = frame->sample_rate;
+
+    AVRational tb_new;
+    int64_t gcd;
+
+    if (frame->sample_rate == ist->last_frame_sample_rate)
+        goto finish;
+
+    gcd  = av_gcd(prev, sr);
+
+    if (prev / gcd >= INT_MAX / sr) {
+        av_log(ist, AV_LOG_WARNING,
+               "Audio timestamps cannot be represented exactly after "
+               "sample rate change: %d -> %d\n", prev, sr);
+
+        // LCM of 192000, 44100, allows to represent all common samplerates
+        tb_new = (AVRational){ 1, 28224000 };
+    } else
+        tb_new = (AVRational){ 1, prev / gcd * sr };
+
+    // keep the frame timebase if it is strictly better than
+    // the samplerate-defined one
+    if (frame->time_base.num == 1 && frame->time_base.den > tb_new.den &&
+        !(frame->time_base.den % tb_new.den))
+        tb_new = frame->time_base;
+
+    if (ist->last_frame_pts != AV_NOPTS_VALUE)
+        ist->last_frame_pts = av_rescale_q(ist->last_frame_pts,
+                                           ist->last_frame_tb, tb_new);
+    ist->last_frame_duration_est = av_rescale_q(ist->last_frame_duration_est,
+                                                ist->last_frame_tb, tb_new);
+
+    ist->last_frame_tb          = tb_new;
+    ist->last_frame_sample_rate = frame->sample_rate;
+
+finish:
+    return ist->last_frame_tb;
+}
+
+static void audio_ts_process(InputStream *ist, AVFrame *frame)
+{
+    AVRational tb_filter = (AVRational){1, frame->sample_rate};
+    AVRational tb;
+    int64_t pts_pred;
+
+    // on samplerate change, choose a new internal timebase for timestamp
+    // generation that can represent timestamps from all the samplerates
+    // seen so far
+    tb = audio_samplerate_update(ist, frame);
+    pts_pred = ist->last_frame_pts == AV_NOPTS_VALUE ? 0 :
+               ist->last_frame_pts + ist->last_frame_duration_est;
+
+    if (frame->pts == AV_NOPTS_VALUE) {
+        frame->pts = pts_pred;
+        frame->time_base = tb;
+    } else if (ist->last_frame_pts != AV_NOPTS_VALUE &&
+               frame->pts > av_rescale_q_rnd(pts_pred, tb, frame->time_base,
+                                             AV_ROUND_UP)) {
+        // there was a gap in timestamps, reset conversion state
+        ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE;
+    }
+
+    frame->pts = av_rescale_delta(frame->time_base, frame->pts,
+                                  tb, frame->nb_samples,
+                                  &ist->filter_in_rescale_delta_last, tb);
+
+    ist->last_frame_pts          = frame->pts;
+    ist->last_frame_duration_est = av_rescale_q(frame->nb_samples,
+                                                tb_filter, tb);
+
+    // finally convert to filtering timebase
+    frame->pts       = av_rescale_q(frame->pts, tb, tb_filter);
+    frame->duration  = frame->nb_samples;
+    frame->time_base = tb_filter;
+}
+
 static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
                         int *decode_failed)
 {
@@ -910,23 +989,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
     ist->next_dts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) /
                      decoded_frame->sample_rate;
 
-    if (decoded_frame->pts == AV_NOPTS_VALUE) {
-        decoded_frame->pts = ist->dts;
-        decoded_frame->time_base = AV_TIME_BASE_Q;
-    }
-    if (pkt && pkt->duration && ist->prev_pkt_pts != AV_NOPTS_VALUE &&
-        pkt->pts != AV_NOPTS_VALUE && pkt->pts - ist->prev_pkt_pts > pkt->duration)
-        ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE;
-    if (pkt)
-        ist->prev_pkt_pts = pkt->pts;
-    if (decoded_frame->pts != AV_NOPTS_VALUE) {
-        AVRational tb_filter = (AVRational){1, decoded_frame->sample_rate};
-        decoded_frame->pts = av_rescale_delta(decoded_frame->time_base, decoded_frame->pts,
-                                              tb_filter, decoded_frame->nb_samples,
-                                              &ist->filter_in_rescale_delta_last,
-                                              tb_filter);
-        decoded_frame->time_base = tb_filter;
-    }
+    audio_ts_process(ist, decoded_frame);
 
     ist->nb_samples = decoded_frame->nb_samples;
     err = send_frame_to_filters(ist, decoded_frame);
@@ -1076,6 +1139,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_
     // update timestamp history
     ist->last_frame_duration_est = video_duration_estimate(ist, decoded_frame);
     ist->last_frame_pts          = decoded_frame->pts;
+    ist->last_frame_tb           = decoded_frame->time_base;
 
     if (debug_ts) {
         av_log(ist, AV_LOG_INFO,
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index c07a1b86b6..c4abf89b58 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -359,7 +359,6 @@ typedef struct InputStream {
 
     AVRational framerate_guessed;
 
-    int64_t       prev_pkt_pts;
     int64_t       start;     /* time when read started */
     /* predicted dts of the next packet read for this stream or (when there are
      * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
@@ -371,10 +370,13 @@ typedef struct InputStream {
     int64_t       next_pts;
     int64_t       pts;       ///< current pts of the decoded frame  (in AV_TIME_BASE units)
 
-    // pts/estimated duration of the last decoded video frame
-    // in decoder timebase
+    // pts/estimated duration of the last decoded frame
+    // * in decoder timebase for video,
+    // * in last_frame_tb (may change during decoding) for audio
     int64_t last_frame_pts;
     int64_t last_frame_duration_est;
+    AVRational    last_frame_tb;
+    int           last_frame_sample_rate;
 
     int           wrap_correction_done;
 
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 5afb3ff2c8..f8d95d1de6 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -864,7 +864,9 @@ static void add_input_streams(const OptionsContext *o, Demuxer *d)
         }
 
         ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE;
-        ist->prev_pkt_pts = AV_NOPTS_VALUE;
+
+        ist->last_frame_pts = AV_NOPTS_VALUE;
+        ist->last_frame_tb  = (AVRational){ 1, 1 };
 
         ist->dec_ctx = avcodec_alloc_context3(ist->dec);
         if (!ist->dec_ctx)
@@ -905,8 +907,6 @@ static void add_input_streams(const OptionsContext *o, Demuxer *d)
 
             ist->framerate_guessed = av_guess_frame_rate(ic, st, NULL);
 
-            ist->last_frame_pts = AV_NOPTS_VALUE;
-
             break;
         case AVMEDIA_TYPE_AUDIO: {
             int guess_layout_max = INT_MAX;
diff --git a/tests/ref/fate/adpcm-ima-smjpeg b/tests/ref/fate/adpcm-ima-smjpeg
index 723fa2336e..b9cf1f38db 100644
--- a/tests/ref/fate/adpcm-ima-smjpeg
+++ b/tests/ref/fate/adpcm-ima-smjpeg
@@ -8,348 +8,348 @@
 0,       1024,       1024,      512,     1024, 0xed2d3f6b
 0,       1533,       1533,      512,     1024, 0x51f6ccb3
 0,       2040,       2040,      512,     1024, 0x58bd75aa
-0,       2558,       2558,      512,     1024, 0xd857a310
-0,       3070,       3070,      512,     1024, 0xc483a5b8
-0,       3582,       3582,      512,     1024, 0x923ecf67
-0,       4091,       4091,      512,     1024, 0xf87dcd53
+0,       2552,       2552,      512,     1024, 0xd857a310
+0,       3064,       3064,      512,     1024, 0xc483a5b8
+0,       3576,       3576,      512,     1024, 0x923ecf67
+0,       4088,       4088,      512,     1024, 0xf87dcd53
 0,       4598,       4598,      512,     1024, 0xdc32c002
-0,       5116,       5116,      512,     1024, 0xb760def1
-0,       5628,       5628,      512,     1024, 0x6838d2b2
-0,       6140,       6140,      512,     1024, 0xe45aca1e
-0,       6649,       6649,      512,     1024, 0xde1fb955
-0,       7166,       7166,      512,     1024, 0x9e23b949
-0,       7678,       7678,      512,     1024, 0x840cc000
-0,       8190,       8190,      512,     1024, 0x0a29cbfa
-0,       8699,       8699,      512,     1024, 0x9871d4c4
+0,       5110,       5110,      512,     1024, 0xb760def1
+0,       5622,       5622,      512,     1024, 0x6838d2b2
+0,       6134,       6134,      512,     1024, 0xe45aca1e
+0,       6646,       6646,      512,     1024, 0xde1fb955
+0,       7158,       7158,      512,     1024, 0x9e23b949
+0,       7670,       7670,      512,     1024, 0x840cc000
+0,       8182,       8182,      512,     1024, 0x0a29cbfa
+0,       8694,       8694,      512,     1024, 0x9871d4c4
 0,       9206,       9206,      512,     1024, 0xb35dc9f2
-0,       9724,       9724,      512,     1024, 0xf37fda0a
-0,      10236,      10236,      512,     1024, 0xa640f990
-0,      10748,      10748,      512,     1024, 0x516fe6f5
-0,      11257,      11257,      512,     1024, 0xc78bc6a6
-0,      11775,      11775,      512,     1024, 0x700fd6ee
-0,      12287,      12287,      512,     1024, 0x5383d5ad
-0,      12799,      12799,      512,     1024, 0xbe01d091
-0,      13308,      13308,      512,     1024, 0x72dfcfc7
-0,      13815,      13815,      512,     1024, 0xd8fecea9
-0,      14333,      14333,      512,     1024, 0xa464d79b
-0,      14845,      14845,      512,     1024, 0xf394e2cb
-0,      15357,      15357,      512,     1024, 0xa301ec49
-0,      15865,      15865,      512,     1024, 0x5e09d60f
-0,      16383,      16383,      512,     1024, 0xd13edd6f
-0,      16895,      16895,      512,     1024, 0x7423ef39
-0,      17407,      17407,      512,     1024, 0x96e2f083
-0,      17916,      17916,      512,     1024, 0x5ed7dbee
-0,      18423,      18423,      512,     1024, 0x3874f714
-0,      18941,      18941,      512,     1024, 0xa5e6edab
-0,      19453,      19453,      512,     1024, 0x0a04ee3a
-0,      19965,      19965,      512,     1024, 0xadfee6b9
-0,      20474,      20474,      512,     1024, 0xd0bbe6d2
-0,      20992,      20992,      512,     1024, 0x223eebb7
-0,      21504,      21504,      512,     1024, 0x0473e479
-0,      22016,      22016,      512,     1024, 0xdf15e51e
-0,      22525,      22525,      512,     1024, 0xa954e483
-0,      23032,      23032,      512,     1024, 0x6df3ed03
-0,      23549,      23549,      512,     1024, 0x0860e544
-0,      24061,      24061,      512,     1024, 0xc241e8dc
-0,      24573,      24573,      512,     1024, 0xd0e1d6a4
-0,      25082,      25082,      512,     1024, 0xcb2ff988
+0,       9718,       9718,      512,     1024, 0xf37fda0a
+0,      10230,      10230,      512,     1024, 0xa640f990
+0,      10742,      10742,      512,     1024, 0x516fe6f5
+0,      11254,      11254,      512,     1024, 0xc78bc6a6
+0,      11766,      11766,      512,     1024, 0x700fd6ee
+0,      12278,      12278,      512,     1024, 0x5383d5ad
+0,      12790,      12790,      512,     1024, 0xbe01d091
+0,      13302,      13302,      512,     1024, 0x72dfcfc7
+0,      13814,      13814,      512,     1024, 0xd8fecea9
+0,      14326,      14326,      512,     1024, 0xa464d79b
+0,      14838,      14838,      512,     1024, 0xf394e2cb
+0,      15350,      15350,      512,     1024, 0xa301ec49
+0,      15862,      15862,      512,     1024, 0x5e09d60f
+0,      16374,      16374,      512,     1024, 0xd13edd6f
+0,      16886,      16886,      512,     1024, 0x7423ef39
+0,      17398,      17398,      512,     1024, 0x96e2f083
+0,      17910,      17910,      512,     1024, 0x5ed7dbee
+0,      18422,      18422,      512,     1024, 0x3874f714
+0,      18934,      18934,      512,     1024, 0xa5e6edab
+0,      19446,      19446,      512,     1024, 0x0a04ee3a
+0,      19958,      19958,      512,     1024, 0xadfee6b9
+0,      20470,      20470,      512,     1024, 0xd0bbe6d2
+0,      20982,      20982,      512,     1024, 0x223eebb7
+0,      21494,      21494,      512,     1024, 0x0473e479
+0,      22006,      22006,      512,     1024, 0xdf15e51e
+0,      22518,      22518,      512,     1024, 0xa954e483
+0,      23030,      23030,      512,     1024, 0x6df3ed03
+0,      23542,      23542,      512,     1024, 0x0860e544
+0,      24054,      24054,      512,     1024, 0xc241e8dc
+0,      24566,      24566,      512,     1024, 0xd0e1d6a4
+0,      25078,      25078,      512,     1024, 0xcb2ff988
 0,      25590,      25590,      512,     1024, 0x51fae08e
-0,      26107,      26107,      512,     1024, 0xae39f2fc
-0,      26619,      26619,      512,     1024, 0xfd74f07c
-0,      27131,      27131,      512,     1024, 0x1936edc1
-0,      27640,      27640,      512,     1024, 0x95f8deae
-0,      28158,      28158,      512,     1024, 0x93bdf605
-0,      28670,      28670,      512,     1024, 0x7a07dd32
-0,      29182,      29182,      512,     1024, 0x6889fdc1
-0,      29691,      29691,      512,     1024, 0x989bf024
+0,      26102,      26102,      512,     1024, 0xae39f2fc
+0,      26614,      26614,      512,     1024, 0xfd74f07c
+0,      27126,      27126,      512,     1024, 0x1936edc1
+0,      27638,      27638,      512,     1024, 0x95f8deae
+0,      28150,      28150,      512,     1024, 0x93bdf605
+0,      28662,      28662,      512,     1024, 0x7a07dd32
+0,      29174,      29174,      512,     1024, 0x6889fdc1
+0,      29686,      29686,      512,     1024, 0x989bf024
 0,      30198,      30198,      512,     1024, 0xc764ce80
-0,      30716,      30716,      512,     1024, 0x0e62d721
-0,      31228,      31228,      512,     1024, 0x59c2fbe3
-0,      31740,      31740,      512,     1024, 0xf14ee29d
-0,      32249,      32249,      512,     1024, 0x02a0f21b
-0,      32766,      32766,      512,     1024, 0xadb3d361
-0,      33278,      33278,      512,     1024, 0xdcb3d1fc
-0,      33790,      33790,      512,     1024, 0x2924f9dc
-0,      34299,      34299,      512,     1024, 0x7507ebec
+0,      30710,      30710,      512,     1024, 0x0e62d721
+0,      31222,      31222,      512,     1024, 0x59c2fbe3
+0,      31734,      31734,      512,     1024, 0xf14ee29d
+0,      32246,      32246,      512,     1024, 0x02a0f21b
+0,      32758,      32758,      512,     1024, 0xadb3d361
+0,      33270,      33270,      512,     1024, 0xdcb3d1fc
+0,      33782,      33782,      512,     1024, 0x2924f9dc
+0,      34294,      34294,      512,     1024, 0x7507ebec
 0,      34806,      34806,      512,     1024, 0xe009f343
-0,      35324,      35324,      512,     1024, 0x21e9e7ac
-0,      35836,      35836,      512,     1024, 0x845bda9e
-0,      36348,      36348,      512,     1024, 0xb1b3e632
-0,      36857,      36857,      512,     1024, 0x61ccf593
-0,      37375,      37375,      512,     1024, 0x8cdbf603
-0,      37887,      37887,      512,     1024, 0xf8f7e673
-0,      38399,      38399,      512,     1024, 0x55efdd24
-0,      38908,      38908,      512,     1024, 0x4059e8ff
-0,      39415,      39415,      512,     1024, 0xb3afe5be
-0,      39933,      39933,      512,     1024, 0x7236e965
-0,      40445,      40445,      512,     1024, 0xe683db69
-0,      40957,      40957,      512,     1024, 0x29e3d93c
-0,      41466,      41466,      512,     1024, 0x74f2f27f
-0,      41983,      41983,      512,     1024, 0x32cde3ba
-0,      42495,      42495,      512,     1024, 0xe907f171
-0,      43007,      43007,      512,     1024, 0x206ae2a5
-0,      43516,      43516,      512,     1024, 0x6379efa1
-0,      44023,      44023,      512,     1024, 0x0f0fee85
-0,      44541,      44541,      512,     1024, 0x3195e314
-0,      45053,      45053,      512,     1024, 0x4646ead3
-0,      45565,      45565,      512,     1024, 0x5635dcf5
-0,      46074,      46074,      512,     1024, 0xd76fc780
-0,      46592,      46592,      512,     1024, 0x847ff8a5
-0,      47104,      47104,      512,     1024, 0xaca8eda3
-0,      47616,      47616,      512,     1024, 0x9a2de1ea
-0,      48125,      48125,      512,     1024, 0xc92ff23a
-0,      48632,      48632,      512,     1024, 0x0e0ef038
-0,      49149,      49149,      512,     1024, 0xc32cf495
-0,      49661,      49661,      512,     1024, 0x6ab1ec79
-0,      50173,      50173,      512,     1024, 0xe43cd8d6
-0,      50682,      50682,      512,     1024, 0x4ba2deab
+0,      35318,      35318,      512,     1024, 0x21e9e7ac
+0,      35830,      35830,      512,     1024, 0x845bda9e
+0,      36342,      36342,      512,     1024, 0xb1b3e632
+0,      36854,      36854,      512,     1024, 0x61ccf593
+0,      37366,      37366,      512,     1024, 0x8cdbf603
+0,      37878,      37878,      512,     1024, 0xf8f7e673
+0,      38390,      38390,      512,     1024, 0x55efdd24
+0,      38902,      38902,      512,     1024, 0x4059e8ff
+0,      39414,      39414,      512,     1024, 0xb3afe5be
+0,      39926,      39926,      512,     1024, 0x7236e965
+0,      40438,      40438,      512,     1024, 0xe683db69
+0,      40950,      40950,      512,     1024, 0x29e3d93c
+0,      41462,      41462,      512,     1024, 0x74f2f27f
+0,      41974,      41974,      512,     1024, 0x32cde3ba
+0,      42486,      42486,      512,     1024, 0xe907f171
+0,      42998,      42998,      512,     1024, 0x206ae2a5
+0,      43510,      43510,      512,     1024, 0x6379efa1
+0,      44022,      44022,      512,     1024, 0x0f0fee85
+0,      44534,      44534,      512,     1024, 0x3195e314
+0,      45046,      45046,      512,     1024, 0x4646ead3
+0,      45558,      45558,      512,     1024, 0x5635dcf5
+0,      46070,      46070,      512,     1024, 0xd76fc780
+0,      46582,      46582,      512,     1024, 0x847ff8a5
+0,      47094,      47094,      512,     1024, 0xaca8eda3
+0,      47606,      47606,      512,     1024, 0x9a2de1ea
+0,      48118,      48118,      512,     1024, 0xc92ff23a
+0,      48630,      48630,      512,     1024, 0x0e0ef038
+0,      49142,      49142,      512,     1024, 0xc32cf495
+0,      49654,      49654,      512,     1024, 0x6ab1ec79
+0,      50166,      50166,      512,     1024, 0xe43cd8d6
+0,      50678,      50678,      512,     1024, 0x4ba2deab
 0,      51190,      51190,      512,     1024, 0x6d16ea0e
-0,      51707,      51707,      512,     1024, 0xe5b0ee70
-0,      52219,      52219,      512,     1024, 0xcf6cf074
-0,      52731,      52731,      512,     1024, 0x2206e61d
-0,      53240,      53240,      512,     1024, 0xfbb9e7e7
-0,      53758,      53758,      512,     1024, 0x2bc1e115
-0,      54270,      54270,      512,     1024, 0x4ca6e5c5
-0,      54782,      54782,      512,     1024, 0x061cead0
-0,      55291,      55291,      512,     1024, 0x3dc9f950
+0,      51702,      51702,      512,     1024, 0xe5b0ee70
+0,      52214,      52214,      512,     1024, 0xcf6cf074
+0,      52726,      52726,      512,     1024, 0x2206e61d
+0,      53238,      53238,      512,     1024, 0xfbb9e7e7
+0,      53750,      53750,      512,     1024, 0x2bc1e115
+0,      54262,      54262,      512,     1024, 0x4ca6e5c5
+0,      54774,      54774,      512,     1024, 0x061cead0
+0,      55286,      55286,      512,     1024, 0x3dc9f950
 0,      55798,      55798,      512,     1024, 0x9399f10d
-0,      56316,      56316,      512,     1024, 0xa2bff5ae
-0,      56828,      56828,      512,     1024, 0xd21de569
-0,      57340,      57340,      512,     1024, 0x1c45e3be
-0,      57849,      57849,      512,     1024, 0xff5dff1c
-0,      58366,      58366,      512,     1024, 0x992df5d3
-0,      58878,      58878,      512,     1024, 0xafedea2f
-0,      59390,      59390,      512,     1024, 0x6e73d6a8
-0,      59899,      59899,      512,     1024, 0x72dff283
+0,      56310,      56310,      512,     1024, 0xa2bff5ae
+0,      56822,      56822,      512,     1024, 0xd21de569
+0,      57334,      57334,      512,     1024, 0x1c45e3be
+0,      57846,      57846,      512,     1024, 0xff5dff1c
+0,      58358,      58358,      512,     1024, 0x992df5d3
+0,      58870,      58870,      512,     1024, 0xafedea2f
+0,      59382,      59382,      512,     1024, 0x6e73d6a8
+0,      59894,      59894,      512,     1024, 0x72dff283
 0,      60406,      60406,      512,     1024, 0x50b5f1a6
-0,      60924,      60924,      512,     1024, 0xffe1decb
-0,      61436,      61436,      512,     1024, 0x8993ecff
-0,      61948,      61948,      512,     1024, 0x954bd63a
-0,      62457,      62457,      512,     1024, 0x4707f577
-0,      62975,      62975,      512,     1024, 0x7a88f81f
-0,      63487,      63487,      512,     1024, 0xc771f537
-0,      63999,      63999,      512,     1024, 0x7aade6af
-0,      64508,      64508,      512,     1024, 0x8af5ede5
-0,      65015,      65015,      512,     1024, 0x7500f3f1
-0,      65533,      65533,      512,     1024, 0xea36f707
-0,      66045,      66045,      512,     1024, 0x1a26e39a
-0,      66557,      66557,      512,     1024, 0xa04cf00d
-0,      67066,      67066,      512,     1024, 0xc362f182
-0,      67583,      67583,      512,     1024, 0x79c8f82c
-0,      68095,      68095,      512,     1024, 0x6480eee1
-0,      68607,      68607,      512,     1024, 0x7152eaa0
-0,      69116,      69116,      512,     1024, 0x5dfee6a9
-0,      69623,      69623,      512,     1024, 0x0afae660
-0,      70141,      70141,      512,     1024, 0xdc98e9fc
-0,      70653,      70653,      512,     1024, 0x10b7da06
-0,      71165,      71165,      512,     1024, 0x0571e585
-0,      71674,      71674,      512,     1024, 0x18ddf45e
-0,      72192,      72192,      512,     1024, 0x2cbef242
-0,      72704,      72704,      512,     1024, 0xf5380845
-0,      73216,      73216,      512,     1024, 0x34fff45e
-0,      73725,      73725,      512,     1024, 0x6f97e490
-0,      74232,      74232,      512,     1024, 0x77d6f0db
-0,      74750,      74750,      512,     1024, 0xa25ce2db
-0,      75262,      75262,      512,     1024, 0x8260e4e9
-0,      75774,      75774,      512,     1024, 0xc3b2f7d2
-0,      76282,      76282,      512,     1024, 0x82a7edae
+0,      60918,      60918,      512,     1024, 0xffe1decb
+0,      61430,      61430,      512,     1024, 0x8993ecff
+0,      61942,      61942,      512,     1024, 0x954bd63a
+0,      62454,      62454,      512,     1024, 0x4707f577
+0,      62966,      62966,      512,     1024, 0x7a88f81f
+0,      63478,      63478,      512,     1024, 0xc771f537
+0,      63990,      63990,      512,     1024, 0x7aade6af
+0,      64502,      64502,      512,     1024, 0x8af5ede5
+0,      65014,      65014,      512,     1024, 0x7500f3f1
+0,      65526,      65526,      512,     1024, 0xea36f707
+0,      66038,      66038,      512,     1024, 0x1a26e39a
+0,      66550,      66550,      512,     1024, 0xa04cf00d
+0,      67062,      67062,      512,     1024, 0xc362f182
+0,      67574,      67574,      512,     1024, 0x79c8f82c
+0,      68086,      68086,      512,     1024, 0x6480eee1
+0,      68598,      68598,      512,     1024, 0x7152eaa0
+0,      69110,      69110,      512,     1024, 0x5dfee6a9
+0,      69622,      69622,      512,     1024, 0x0afae660
+0,      70134,      70134,      512,     1024, 0xdc98e9fc
+0,      70646,      70646,      512,     1024, 0x10b7da06
+0,      71158,      71158,      512,     1024, 0x0571e585
+0,      71670,      71670,      512,     1024, 0x18ddf45e
+0,      72182,      72182,      512,     1024, 0x2cbef242
+0,      72694,      72694,      512,     1024, 0xf5380845
+0,      73206,      73206,      512,     1024, 0x34fff45e
+0,      73718,      73718,      512,     1024, 0x6f97e490
+0,      74230,      74230,      512,     1024, 0x77d6f0db
+0,      74742,      74742,      512,     1024, 0xa25ce2db
+0,      75254,      75254,      512,     1024, 0x8260e4e9
+0,      75766,      75766,      512,     1024, 0xc3b2f7d2
+0,      76278,      76278,      512,     1024, 0x82a7edae
 0,      76790,      76790,      512,     1024, 0x7d08dd54
-0,      77307,      77307,      512,     1024, 0x9059eda6
-0,      77819,      77819,      512,     1024, 0xbebaec88
-0,      78331,      78331,      512,     1024, 0xd9afd586
-0,      78840,      78840,      512,     1024, 0x0ca3e622
-0,      79358,      79358,      512,     1024, 0x4123e9e6
-0,      79870,      79870,      512,     1024, 0x2ff9f95c
-0,      80382,      80382,      512,     1024, 0x8522e261
-0,      80891,      80891,      512,     1024, 0xe4f8f499
+0,      77302,      77302,      512,     1024, 0x9059eda6
+0,      77814,      77814,      512,     1024, 0xbebaec88
+0,      78326,      78326,      512,     1024, 0xd9afd586
+0,      78838,      78838,      512,     1024, 0x0ca3e622
+0,      79350,      79350,      512,     1024, 0x4123e9e6
+0,      79862,      79862,      512,     1024, 0x2ff9f95c
+0,      80374,      80374,      512,     1024, 0x8522e261
+0,      80886,      80886,      512,     1024, 0xe4f8f499
 0,      81398,      81398,      512,     1024, 0x34f3f2bd
-0,      81916,      81916,      512,     1024, 0x82efe863
-0,      82428,      82428,      512,     1024, 0x9966fcea
-0,      82940,      82940,      512,     1024, 0xe94de3fd
-0,      83449,      83449,      512,     1024, 0x1ce0e27b
-0,      83966,      83966,      512,     1024, 0xd718dcde
-0,      84478,      84478,      512,     1024, 0xd503e724
-0,      84990,      84990,      512,     1024, 0x427ee3b2
-0,      85499,      85499,      512,     1024, 0x4512dcc4
-0,      86007,      86007,      512,     1024, 0xcf31e77c
-0,      86524,      86524,      512,     1024, 0xeb41ea81
-0,      87036,      87036,      512,     1024, 0xfa43e67c
-0,      87548,      87548,      512,     1024, 0x8162f3c9
-0,      88057,      88057,      512,     1024, 0x1b55f6b0
-0,      88575,      88575,      512,     1024, 0x3ebeec44
-0,      89087,      89087,      512,     1024, 0x740fe0c4
-0,      89599,      89599,      512,     1024, 0x8fb4e8b2
-0,      90108,      90108,      512,     1024, 0xe49de6a2
-0,      90615,      90615,      512,     1024, 0xd64febdf
-0,      91133,      91133,      512,     1024, 0x0e74ee08
-0,      91645,      91645,      512,     1024, 0x6c0ddf07
-0,      92157,      92157,      512,     1024, 0x7fb8e3c9
-0,      92666,      92666,      512,     1024, 0x52bfe96c
-0,      93183,      93183,      512,     1024, 0xfc22ee64
-0,      93695,      93695,      512,     1024, 0xe20ae718
-0,      94207,      94207,      512,     1024, 0xa94be395
-0,      94716,      94716,      512,     1024, 0xded306d0
-0,      95223,      95223,      512,     1024, 0x31f7c831
-0,      95741,      95741,      512,     1024, 0x0ffde0a8
-0,      96253,      96253,      512,     1024, 0xc692e3e0
-0,      96765,      96765,      512,     1024, 0x1d8ff7c7
-0,      97274,      97274,      512,     1024, 0x038ee172
-0,      97792,      97792,      512,     1024, 0x9a1eef59
-0,      98304,      98304,      512,     1024, 0x158fe750
-0,      98816,      98816,      512,     1024, 0xac15e42c
-0,      99325,      99325,      512,     1024, 0x6323ed44
-0,      99832,      99832,      512,     1024, 0xd10ce4bb
-0,     100350,     100350,      512,     1024, 0xc1cce296
-0,     100862,     100862,      512,     1024, 0x0782f094
-0,     101374,     101374,      512,     1024, 0xd109de36
-0,     101883,     101883,      512,     1024, 0x175600fb
+0,      81910,      81910,      512,     1024, 0x82efe863
+0,      82422,      82422,      512,     1024, 0x9966fcea
+0,      82934,      82934,      512,     1024, 0xe94de3fd
+0,      83446,      83446,      512,     1024, 0x1ce0e27b
+0,      83958,      83958,      512,     1024, 0xd718dcde
+0,      84470,      84470,      512,     1024, 0xd503e724
+0,      84982,      84982,      512,     1024, 0x427ee3b2
+0,      85494,      85494,      512,     1024, 0x4512dcc4
+0,      86006,      86006,      512,     1024, 0xcf31e77c
+0,      86518,      86518,      512,     1024, 0xeb41ea81
+0,      87030,      87030,      512,     1024, 0xfa43e67c
+0,      87542,      87542,      512,     1024, 0x8162f3c9
+0,      88054,      88054,      512,     1024, 0x1b55f6b0
+0,      88566,      88566,      512,     1024, 0x3ebeec44
+0,      89078,      89078,      512,     1024, 0x740fe0c4
+0,      89590,      89590,      512,     1024, 0x8fb4e8b2
+0,      90102,      90102,      512,     1024, 0xe49de6a2
+0,      90614,      90614,      512,     1024, 0xd64febdf
+0,      91126,      91126,      512,     1024, 0x0e74ee08
+0,      91638,      91638,      512,     1024, 0x6c0ddf07
+0,      92150,      92150,      512,     1024, 0x7fb8e3c9
+0,      92662,      92662,      512,     1024, 0x52bfe96c
+0,      93174,      93174,      512,     1024, 0xfc22ee64
+0,      93686,      93686,      512,     1024, 0xe20ae718
+0,      94198,      94198,      512,     1024, 0xa94be395
+0,      94710,      94710,      512,     1024, 0xded306d0
+0,      95222,      95222,      512,     1024, 0x31f7c831
+0,      95734,      95734,      512,     1024, 0x0ffde0a8
+0,      96246,      96246,      512,     1024, 0xc692e3e0
+0,      96758,      96758,      512,     1024, 0x1d8ff7c7
+0,      97270,      97270,      512,     1024, 0x038ee172
+0,      97782,      97782,      512,     1024, 0x9a1eef59
+0,      98294,      98294,      512,     1024, 0x158fe750
+0,      98806,      98806,      512,     1024, 0xac15e42c
+0,      99318,      99318,      512,     1024, 0x6323ed44
+0,      99830,      99830,      512,     1024, 0xd10ce4bb
+0,     100342,     100342,      512,     1024, 0xc1cce296
+0,     100854,     100854,      512,     1024, 0x0782f094
+0,     101366,     101366,      512,     1024, 0xd109de36
+0,     101878,     101878,      512,     1024, 0x175600fb
 0,     102390,     102390,      512,     1024, 0x95d5e8d9
-0,     102907,     102907,      512,     1024, 0xebb6eee1
-0,     103419,     103419,      512,     1024, 0x187cfadc
-0,     103931,     103931,      512,     1024, 0xce35fa5c
-0,     104440,     104440,      512,     1024, 0x8327eea2
-0,     104958,     104958,      512,     1024, 0x5543f219
-0,     105470,     105470,      512,     1024, 0xaacbe0dc
-0,     105982,     105982,      512,     1024, 0xa538e9fb
-0,     106491,     106491,      512,     1024, 0x4dcbe655
+0,     102902,     102902,      512,     1024, 0xebb6eee1
+0,     103414,     103414,      512,     1024, 0x187cfadc
+0,     103926,     103926,      512,     1024, 0xce35fa5c
+0,     104438,     104438,      512,     1024, 0x8327eea2
+0,     104950,     104950,      512,     1024, 0x5543f219
+0,     105462,     105462,      512,     1024, 0xaacbe0dc
+0,     105974,     105974,      512,     1024, 0xa538e9fb
+0,     106486,     106486,      512,     1024, 0x4dcbe655
 0,     106998,     106998,      512,     1024, 0x86b6d93b
-0,     107516,     107516,      512,     1024, 0x1a06f878
-0,     108028,     108028,      512,     1024, 0xd926e8ef
-0,     108540,     108540,      512,     1024, 0xc624db2f
-0,     109049,     109049,      512,     1024, 0x2153e20d
-0,     109566,     109566,      512,     1024, 0x01dce868
-0,     110078,     110078,      512,     1024, 0xfa5fd3cd
-0,     110590,     110590,      512,     1024, 0x2adef2d5
-0,     111099,     111099,      512,     1024, 0x4f48f8e2
-0,     111607,     111607,      512,     1024, 0x613feeee
-0,     112124,     112124,      512,     1024, 0x3780de8a
-0,     112636,     112636,      512,     1024, 0x2093eb65
-0,     113148,     113148,      512,     1024, 0x54baebbb
-0,     113657,     113657,      512,     1024, 0x8686dd7c
-0,     114175,     114175,      512,     1024, 0x7f8ae80c
-0,     114687,     114687,      512,     1024, 0x7aede972
-0,     115199,     115199,      512,     1024, 0x971bebc0
-0,     115708,     115708,      512,     1024, 0x2dd5fd4b
-0,     116215,     116215,      512,     1024, 0xb1b3e4a3
-0,     116733,     116733,      512,     1024, 0x192defc6
-0,     117245,     117245,      512,     1024, 0x5e46ec44
-0,     117757,     117757,      512,     1024, 0xe6d8e05a
-0,     118266,     118266,      512,     1024, 0x7e2fe2b0
-0,     118783,     118783,      512,     1024, 0x9e3bdf80
-0,     119295,     119295,      512,     1024, 0xa98cd85e
-0,     119807,     119807,      512,     1024, 0x6061e0c4
-0,     120316,     120316,      512,     1024, 0x6112f3fc
-0,     120823,     120823,      512,     1024, 0x99bdfb01
-0,     121341,     121341,      512,     1024, 0x3f5df3ca
-0,     121853,     121853,      512,     1024, 0xf5ebeb05
-0,     122365,     122365,      512,     1024, 0x8498e565
-0,     122874,     122874,      512,     1024, 0x0497f0b7
-0,     123392,     123392,      512,     1024, 0x626ae800
-0,     123904,     123904,      512,     1024, 0xfb71eec4
-0,     124416,     124416,      512,     1024, 0xa86ee739
-0,     124925,     124925,      512,     1024, 0x25c0e050
-0,     125432,     125432,      512,     1024, 0x6027e91e
-0,     125950,     125950,      512,     1024, 0x6772df6e
-0,     126462,     126462,      512,     1024, 0xfefff844
-0,     126974,     126974,      512,     1024, 0x547be862
-0,     127483,     127483,      512,     1024, 0xca84e795
+0,     107510,     107510,      512,     1024, 0x1a06f878
+0,     108022,     108022,      512,     1024, 0xd926e8ef
+0,     108534,     108534,      512,     1024, 0xc624db2f
+0,     109046,     109046,      512,     1024, 0x2153e20d
+0,     109558,     109558,      512,     1024, 0x01dce868
+0,     110070,     110070,      512,     1024, 0xfa5fd3cd
+0,     110582,     110582,      512,     1024, 0x2adef2d5
+0,     111094,     111094,      512,     1024, 0x4f48f8e2
+0,     111606,     111606,      512,     1024, 0x613feeee
+0,     112118,     112118,      512,     1024, 0x3780de8a
+0,     112630,     112630,      512,     1024, 0x2093eb65
+0,     113142,     113142,      512,     1024, 0x54baebbb
+0,     113654,     113654,      512,     1024, 0x8686dd7c
+0,     114166,     114166,      512,     1024, 0x7f8ae80c
+0,     114678,     114678,      512,     1024, 0x7aede972
+0,     115190,     115190,      512,     1024, 0x971bebc0
+0,     115702,     115702,      512,     1024, 0x2dd5fd4b
+0,     116214,     116214,      512,     1024, 0xb1b3e4a3
+0,     116726,     116726,      512,     1024, 0x192defc6
+0,     117238,     117238,      512,     1024, 0x5e46ec44
+0,     117750,     117750,      512,     1024, 0xe6d8e05a
+0,     118262,     118262,      512,     1024, 0x7e2fe2b0
+0,     118774,     118774,      512,     1024, 0x9e3bdf80
+0,     119286,     119286,      512,     1024, 0xa98cd85e
+0,     119798,     119798,      512,     1024, 0x6061e0c4
+0,     120310,     120310,      512,     1024, 0x6112f3fc
+0,     120822,     120822,      512,     1024, 0x99bdfb01
+0,     121334,     121334,      512,     1024, 0x3f5df3ca
+0,     121846,     121846,      512,     1024, 0xf5ebeb05
+0,     122358,     122358,      512,     1024, 0x8498e565
+0,     122870,     122870,      512,     1024, 0x0497f0b7
+0,     123382,     123382,      512,     1024, 0x626ae800
+0,     123894,     123894,      512,     1024, 0xfb71eec4
+0,     124406,     124406,      512,     1024, 0xa86ee739
+0,     124918,     124918,      512,     1024, 0x25c0e050
+0,     125430,     125430,      512,     1024, 0x6027e91e
+0,     125942,     125942,      512,     1024, 0x6772df6e
+0,     126454,     126454,      512,     1024, 0xfefff844
+0,     126966,     126966,      512,     1024, 0x547be862
+0,     127478,     127478,      512,     1024, 0xca84e795
 0,     127990,     127990,      512,     1024, 0xd124db3e
-0,     128507,     128507,      512,     1024, 0xcaf3deb5
-0,     129019,     129019,      512,     1024, 0x487ce92d
-0,     129531,     129531,      512,     1024, 0x117feb95
-0,     130040,     130040,      512,     1024, 0x7b63de3d
-0,     130558,     130558,      512,     1024, 0xa529d8e1
-0,     131070,     131070,      512,     1024, 0x56f6da26
-0,     131582,     131582,      512,     1024, 0xffb8d5af
-0,     132091,     132091,      512,     1024, 0xeecbdc04
+0,     128502,     128502,      512,     1024, 0xcaf3deb5
+0,     129014,     129014,      512,     1024, 0x487ce92d
+0,     129526,     129526,      512,     1024, 0x117feb95
+0,     130038,     130038,      512,     1024, 0x7b63de3d
+0,     130550,     130550,      512,     1024, 0xa529d8e1
+0,     131062,     131062,      512,     1024, 0x56f6da26
+0,     131574,     131574,      512,     1024, 0xffb8d5af
+0,     132086,     132086,      512,     1024, 0xeecbdc04
 0,     132598,     132598,      512,     1024, 0xfc59d2d2
-0,     133116,     133116,      512,     1024, 0xaf7acef7
-0,     133628,     133628,      512,     1024, 0x3f9bf258
-0,     134140,     134140,      512,     1024, 0xcf54e9d6
-0,     134649,     134649,      512,     1024, 0x680cd0aa
-0,     135167,     135167,      512,     1024, 0x3c1bdc1f
-0,     135679,     135679,      512,     1024, 0x8c8ffe22
-0,     136191,     136191,      512,     1024, 0xf415d362
-0,     136699,     136699,      512,     1024, 0x8c8cdaa9
-0,     137207,     137207,      512,     1024, 0x9531e9f1
-0,     137724,     137724,      512,     1024, 0x223ce536
-0,     138236,     138236,      512,     1024, 0xdfbce5f9
-0,     138748,     138748,      512,     1024, 0x20b6ed7d
-0,     139257,     139257,      512,     1024, 0x1a17e109
-0,     139775,     139775,      512,     1024, 0xc672eaea
-0,     140287,     140287,      512,     1024, 0x12a7dc5e
-0,     140799,     140799,      512,     1024, 0x4497f342
-0,     141308,     141308,      512,     1024, 0xdfb5db4b
-0,     141815,     141815,      512,     1024, 0xde48ef6c
-0,     142333,     142333,      512,     1024, 0x1d98e316
-0,     142845,     142845,      512,     1024, 0xbd2ad72f
-0,     143357,     143357,      512,     1024, 0xf1aad776
-0,     143866,     143866,      512,     1024, 0x4db3e3c0
-0,     144383,     144383,      512,     1024, 0x832de0a0
-0,     144895,     144895,      512,     1024, 0xc5f0ef25
-0,     145407,     145407,      512,     1024, 0x419bda6e
-0,     145916,     145916,      512,     1024, 0x5de7f77e
-0,     146424,     146424,      512,     1024, 0x0063ec9a
-0,     146941,     146941,      512,     1024, 0x10c3d470
-0,     147453,     147453,      512,     1024, 0xba66d226
-0,     147965,     147965,      512,     1024, 0xea47ded3
-0,     148474,     148474,      512,     1024, 0x6202d67b
-0,     148992,     148992,      512,     1024, 0x3f80e7cf
-0,     149504,     149504,      512,     1024, 0x4e64eaae
-0,     150016,     150016,      512,     1024, 0x2108e83d
-0,     150525,     150525,      512,     1024, 0x38c3dec1
-0,     151032,     151032,      512,     1024, 0x46d3f77a
-0,     151550,     151550,      512,     1024, 0x4838e787
-0,     152062,     152062,      512,     1024, 0xc71df16d
-0,     152574,     152574,      512,     1024, 0xdbe4ebbd
-0,     153083,     153083,      512,     1024, 0xa156d07b
+0,     133110,     133110,      512,     1024, 0xaf7acef7
+0,     133622,     133622,      512,     1024, 0x3f9bf258
+0,     134134,     134134,      512,     1024, 0xcf54e9d6
+0,     134646,     134646,      512,     1024, 0x680cd0aa
+0,     135158,     135158,      512,     1024, 0x3c1bdc1f
+0,     135670,     135670,      512,     1024, 0x8c8ffe22
+0,     136182,     136182,      512,     1024, 0xf415d362
+0,     136694,     136694,      512,     1024, 0x8c8cdaa9
+0,     137206,     137206,      512,     1024, 0x9531e9f1
+0,     137718,     137718,      512,     1024, 0x223ce536
+0,     138230,     138230,      512,     1024, 0xdfbce5f9
+0,     138742,     138742,      512,     1024, 0x20b6ed7d
+0,     139254,     139254,      512,     1024, 0x1a17e109
+0,     139766,     139766,      512,     1024, 0xc672eaea
+0,     140278,     140278,      512,     1024, 0x12a7dc5e
+0,     140790,     140790,      512,     1024, 0x4497f342
+0,     141302,     141302,      512,     1024, 0xdfb5db4b
+0,     141814,     141814,      512,     1024, 0xde48ef6c
+0,     142326,     142326,      512,     1024, 0x1d98e316
+0,     142838,     142838,      512,     1024, 0xbd2ad72f
+0,     143350,     143350,      512,     1024, 0xf1aad776
+0,     143862,     143862,      512,     1024, 0x4db3e3c0
+0,     144374,     144374,      512,     1024, 0x832de0a0
+0,     144886,     144886,      512,     1024, 0xc5f0ef25
+0,     145398,     145398,      512,     1024, 0x419bda6e
+0,     145910,     145910,      512,     1024, 0x5de7f77e
+0,     146422,     146422,      512,     1024, 0x0063ec9a
+0,     146934,     146934,      512,     1024, 0x10c3d470
+0,     147446,     147446,      512,     1024, 0xba66d226
+0,     147958,     147958,      512,     1024, 0xea47ded3
+0,     148470,     148470,      512,     1024, 0x6202d67b
+0,     148982,     148982,      512,     1024, 0x3f80e7cf
+0,     149494,     149494,      512,     1024, 0x4e64eaae
+0,     150006,     150006,      512,     1024, 0x2108e83d
+0,     150518,     150518,      512,     1024, 0x38c3dec1
+0,     151030,     151030,      512,     1024, 0x46d3f77a
+0,     151542,     151542,      512,     1024, 0x4838e787
+0,     152054,     152054,      512,     1024, 0xc71df16d
+0,     152566,     152566,      512,     1024, 0xdbe4ebbd
+0,     153078,     153078,      512,     1024, 0xa156d07b
 0,     153590,     153590,      512,     1024, 0x34eddc80
-0,     154107,     154107,      512,     1024, 0xe840e87c
-0,     154619,     154619,      512,     1024, 0x6accf8f5
-0,     155131,     155131,      512,     1024, 0xa1dbebb9
-0,     155640,     155640,      512,     1024, 0x6d07d98c
-0,     156158,     156158,      512,     1024, 0x94c7e805
-0,     156670,     156670,      512,     1024, 0x5199e586
-0,     157182,     157182,      512,     1024, 0xe797e1aa
-0,     157691,     157691,      512,     1024, 0xff19eda7
+0,     154102,     154102,      512,     1024, 0xe840e87c
+0,     154614,     154614,      512,     1024, 0x6accf8f5
+0,     155126,     155126,      512,     1024, 0xa1dbebb9
+0,     155638,     155638,      512,     1024, 0x6d07d98c
+0,     156150,     156150,      512,     1024, 0x94c7e805
+0,     156662,     156662,      512,     1024, 0x5199e586
+0,     157174,     157174,      512,     1024, 0xe797e1aa
+0,     157686,     157686,      512,     1024, 0xff19eda7
 0,     158198,     158198,      512,     1024, 0x9cb9d040
-0,     158716,     158716,      512,     1024, 0xaeedd325
-0,     159228,     159228,      512,     1024, 0xf5ade306
-0,     159740,     159740,      512,     1024, 0x54a5e129
-0,     160249,     160249,      512,     1024, 0x6665ddeb
-0,     160767,     160767,      512,     1024, 0x9d18e033
-0,     161279,     161279,      512,     1024, 0x7f23df74
-0,     161791,     161791,      512,     1024, 0x7c34f158
-0,     162300,     162300,      512,     1024, 0x47f6dae2
-0,     162807,     162807,      512,     1024, 0x5ffdd903
-0,     163324,     163324,      512,     1024, 0x8233d108
-0,     163836,     163836,      512,     1024, 0x45c6e20d
-0,     164348,     164348,      512,     1024, 0xae11fa6e
-0,     164857,     164857,      512,     1024, 0xa30defd2
-0,     165375,     165375,      512,     1024, 0xfc1ecccf
-0,     165887,     165887,      512,     1024, 0x920edc94
-0,     166399,     166399,      512,     1024, 0xd7f3dc58
-0,     166908,     166908,      512,     1024, 0x4972d37d
-0,     167415,     167415,      512,     1024, 0xfefef358
-0,     167933,     167933,      512,     1024, 0x3648e473
-0,     168445,     168445,      512,     1024, 0x58dee6c3
-0,     168957,     168957,      512,     1024, 0x9cc6df27
-0,     169466,     169466,      512,     1024, 0x6adfe99c
-0,     169983,     169983,      512,     1024, 0x6a56e11f
-0,     170495,     170495,      512,     1024, 0x4860edf1
-0,     171007,     171007,      512,     1024, 0x9132f10a
-0,     171516,     171516,      512,     1024, 0x3e09d209
-0,     172024,     172024,      512,     1024, 0x4b6bf4d8
-0,     172541,     172541,      512,     1024, 0x0cd5e838
-0,     173053,     173053,      512,     1024, 0x080be078
-0,     173565,     173565,      512,     1024, 0xfdb0e31c
-0,     174074,     174074,      512,     1024, 0xced5e7bd
-0,     174592,     174592,      512,     1024, 0x65b3e435
-0,     175104,     175104,      512,     1024, 0x5b5bfe2e
-0,     175616,     175616,      512,     1024, 0xa8bde3cb
-0,     176125,     176125,      512,     1024, 0xfd0fdefa
-0,     176632,     176632,      512,     1024, 0xbec4ef95
-0,     177150,     177150,      512,     1024, 0x683ad8dd
-0,     177662,     177662,      512,     1024, 0x8eefeb77
-0,     178174,     178174,      512,     1024, 0x84fc5878
-0,     178683,     178683,      512,     1024, 0x9a0ded60
+0,     158710,     158710,      512,     1024, 0xaeedd325
+0,     159222,     159222,      512,     1024, 0xf5ade306
+0,     159734,     159734,      512,     1024, 0x54a5e129
+0,     160246,     160246,      512,     1024, 0x6665ddeb
+0,     160758,     160758,      512,     1024, 0x9d18e033
+0,     161270,     161270,      512,     1024, 0x7f23df74
+0,     161782,     161782,      512,     1024, 0x7c34f158
+0,     162294,     162294,      512,     1024, 0x47f6dae2
+0,     162806,     162806,      512,     1024, 0x5ffdd903
+0,     163318,     163318,      512,     1024, 0x8233d108
+0,     163830,     163830,      512,     1024, 0x45c6e20d
+0,     164342,     164342,      512,     1024, 0xae11fa6e
+0,     164854,     164854,      512,     1024, 0xa30defd2
+0,     165366,     165366,      512,     1024, 0xfc1ecccf
+0,     165878,     165878,      512,     1024, 0x920edc94
+0,     166390,     166390,      512,     1024, 0xd7f3dc58
+0,     166902,     166902,      512,     1024, 0x4972d37d
+0,     167414,     167414,      512,     1024, 0xfefef358
+0,     167926,     167926,      512,     1024, 0x3648e473
+0,     168438,     168438,      512,     1024, 0x58dee6c3
+0,     168950,     168950,      512,     1024, 0x9cc6df27
+0,     169462,     169462,      512,     1024, 0x6adfe99c
+0,     169974,     169974,      512,     1024, 0x6a56e11f
+0,     170486,     170486,      512,     1024, 0x4860edf1
+0,     170998,     170998,      512,     1024, 0x9132f10a
+0,     171510,     171510,      512,     1024, 0x3e09d209
+0,     172022,     172022,      512,     1024, 0x4b6bf4d8
+0,     172534,     172534,      512,     1024, 0x0cd5e838
+0,     173046,     173046,      512,     1024, 0x080be078
+0,     173558,     173558,      512,     1024, 0xfdb0e31c
+0,     174070,     174070,      512,     1024, 0xced5e7bd
+0,     174582,     174582,      512,     1024, 0x65b3e435
+0,     175094,     175094,      512,     1024, 0x5b5bfe2e
+0,     175606,     175606,      512,     1024, 0xa8bde3cb
+0,     176118,     176118,      512,     1024, 0xfd0fdefa
+0,     176630,     176630,      512,     1024, 0xbec4ef95
+0,     177142,     177142,      512,     1024, 0x683ad8dd
+0,     177654,     177654,      512,     1024, 0x8eefeb77
+0,     178166,     178166,      512,     1024, 0x84fc5878
+0,     178678,     178678,      512,     1024, 0x9a0ded60
diff --git a/tests/ref/fate/pcm_dvd-16-5.1-96000 b/tests/ref/fate/pcm_dvd-16-5.1-96000
index 64447a9aa5..68dce2d3a6 100644
--- a/tests/ref/fate/pcm_dvd-16-5.1-96000
+++ b/tests/ref/fate/pcm_dvd-16-5.1-96000
@@ -13,7 +13,7 @@ d8e182dfa46524c28d1f78a4cc1f2719 *tests/data/fate/pcm_dvd-16-5.1-96000.vob
 0,        835,        835,      167,     2004, 0x00000000
 0,       1002,       1002,      167,     2004, 0x00000000
 0,       1169,       1169,      167,     2004, 0x00000000
-0,       1337,       1337,      167,     2004, 0x00000000
+0,       1336,       1336,      167,     2004, 0x00000000
 0,       1503,       1503,      167,     2004, 0x00000000
 0,       1670,       1670,      167,     2004, 0x00000000
 0,       1837,       1837,      167,     2004, 0x00000000
@@ -29,7 +29,7 @@ d8e182dfa46524c28d1f78a4cc1f2719 *tests/data/fate/pcm_dvd-16-5.1-96000.vob
 0,       3507,       3507,      167,     2004, 0x00000000
 0,       3674,       3674,      167,     2004, 0x00000000
 0,       3841,       3841,      167,     2004, 0x00000000
-0,       4009,       4009,      167,     2004, 0x00000000
+0,       4008,       4008,      167,     2004, 0x00000000
 0,       4175,       4175,      167,     2004, 0x00000000
 0,       4342,       4342,      167,     2004, 0x00000000
 0,       4509,       4509,      167,     2004, 0x00000000
@@ -45,7 +45,7 @@ d8e182dfa46524c28d1f78a4cc1f2719 *tests/data/fate/pcm_dvd-16-5.1-96000.vob
 0,       6179,       6179,      167,     2004, 0x00000000
 0,       6346,       6346,      167,     2004, 0x00000000
 0,       6513,       6513,      167,     2004, 0x00000000
-0,       6681,       6681,      166,     1992, 0x00000000
-0,       6847,       6847,      167,     2004, 0x00000000
+0,       6680,       6680,      166,     1992, 0x00000000
+0,       6846,       6846,      167,     2004, 0x00000000
 0,       7014,       7014,      167,     2004, 0x00000000
 0,       7181,       7181,      101,     1212, 0x00000000
diff --git a/tests/ref/lavf/smjpeg b/tests/ref/lavf/smjpeg
index 94172a6b1e..537c0847cb 100644
--- a/tests/ref/lavf/smjpeg
+++ b/tests/ref/lavf/smjpeg
@@ -1,3 +1,3 @@
 3fe90213ac4f5275eb85ad0a4e4bdb44 *tests/data/lavf/lavf.smjpeg
 728642 tests/data/lavf/lavf.smjpeg
-tests/data/lavf/lavf.smjpeg CRC=0x75066147
+tests/data/lavf/lavf.smjpeg CRC=0x54bf6147
-- 
2.39.2

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data
  2023-04-28 13:52       ` Nicolas George
@ 2023-04-29  8:46         ` Nicolas George
  2023-04-29  9:07           ` Anton Khirnov
  0 siblings, 1 reply; 38+ messages in thread
From: Nicolas George @ 2023-04-29  8:46 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 752 bytes --]

Nicolas George (12023-04-28):
> And during the work of turning all into threads, opportunities to split
> the structure in more logical ways with less code noise will almost
> certainly present themselves.

I had intended to not reply further on this, but I just had a severe
case of esprit de l'ecalier, so I just add this:

For example, it is entirely possible that a lot of these “private”
fields could become local variables and functions parameters in the
threads. That would be elegant and efficient.

But now we will never know, because they will all be stuffed in a
private context, according to “good practices”, and that will spare the
effort of checking what their exact scope is.

Regards,

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data
  2023-04-29  8:46         ` Nicolas George
@ 2023-04-29  9:07           ` Anton Khirnov
  2023-04-29  9:13             ` Nicolas George
  0 siblings, 1 reply; 38+ messages in thread
From: Anton Khirnov @ 2023-04-29  9:07 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Quoting Nicolas George (2023-04-29 10:46:31)
> Nicolas George (12023-04-28):
> > And during the work of turning all into threads, opportunities to split
> > the structure in more logical ways with less code noise will almost
> > certainly present themselves.
> 
> I had intended to not reply further on this, but I just had a severe
> case of esprit de l'ecalier, so I just add this:
> 
> For example, it is entirely possible that a lot of these “private”
> fields could become local variables and functions parameters in the
> threads. That would be elegant and efficient.
> 
> But now we will never know, because they will all be stuffed in a
> private context, according to “good practices”, and that will spare the
> effort of checking what their exact scope is.

That does not follow at all - just because something was moved once does
not mean it cannot be moved again if a better place is found later.

This change is an incremental improvement, I am not claiming it is the
best possible shape this code could ever have. In my experience, it is
much better to have a series of actually performed incremental
improvements, than to bikeshed endlessly about what the perfect final
endstate should be and never get anything done.

-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data
  2023-04-29  9:07           ` Anton Khirnov
@ 2023-04-29  9:13             ` Nicolas George
  2023-04-29 12:08               ` James Almer
  0 siblings, 1 reply; 38+ messages in thread
From: Nicolas George @ 2023-04-29  9:13 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 341 bytes --]

Anton Khirnov (12023-04-29):
> That does not follow at all - just because something was moved once does
> not mean it cannot be moved again if a better place is found later.

Good, then you should have no objection to replacing your private
structure with a “/* these fields are private to… */” comment.

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data
  2023-04-29  9:13             ` Nicolas George
@ 2023-04-29 12:08               ` James Almer
  2023-04-29 16:55                 ` Nicolas George
  0 siblings, 1 reply; 38+ messages in thread
From: James Almer @ 2023-04-29 12:08 UTC (permalink / raw)
  To: ffmpeg-devel

On 4/29/2023 6:13 AM, Nicolas George wrote:
> Anton Khirnov (12023-04-29):
>> That does not follow at all - just because something was moved once does
>> not mean it cannot be moved again if a better place is found later.
> 
> Good, then you should have no objection to replacing your private
> structure with a “/* these fields are private to… */” comment.

History has shown that these notifications have had no effect on users, 
and even on this same project's developers. A good example was 
ffserver.c, which accessed an unholy amount of lavf private fields (both 
exposed in public headers and even internal ones), and first_dts from 
AVStream, which was not only accessed by prominent library users (One of 
which refuses to do things right and forces distros to use a patch to 
expose said field on their ffmpeg packages for the sake of supporting 
their application, thus making a pure recompilation from our tree no 
longer a drop-in solution on anyone's system), but also by ffmpeg.c, 
with no developer noticing it to prevent such code being pushed.

So no, i don't support a simple "please, don't touch the shinny and 
enticing object in the table" notifications. If in the future this 
approach here is replaced, it needs to be by something better/cleaner 
that also keeps things local.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data
  2023-04-29 12:08               ` James Almer
@ 2023-04-29 16:55                 ` Nicolas George
  0 siblings, 0 replies; 38+ messages in thread
From: Nicolas George @ 2023-04-29 16:55 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 1839 bytes --]

James Almer (12023-04-29):
> History has shown that these notifications have had no effect on users, and
> even on this same project's developers. A good example was ffserver.c, which
> accessed an unholy amount of lavf private fields (both exposed in public
> headers and even internal ones), and first_dts from AVStream, which was not
> only accessed by prominent library users (One of which refuses to do things
> right and forces distros to use a patch to expose said field on their ffmpeg
> packages for the sake of supporting their application, thus making a pure
> recompilation from our tree no longer a drop-in solution on anyone's
> system), but also by ffmpeg.c, with no developer noticing it to prevent such
> code being pushed.

Since we are discussing types for the fftools, not librairies, what
people outside the project might do is not an issue

As for abuse of fields private to a part of the code by another part of
the code, I think you are somewhat rewriting history here.

The reason the fftools used to access private fields of the libraries is
not that developers neglected the rules against using them, it is that
no such rule existed when the code was written, they came later.

But if you really think we need to enforce the rule, then there still
are better solutions than using a separate structure and littering the
code with casts.

For example we can apply __attribute__((unavailable)) to the private
fields except in the part of the code where they are allowed.

(The attribute might not be supported on all compilers, but it is plenty
enough that it is supported on the compilers used by the FATE instances
that test submitted patches and the compilers used by some of us.)

This is a MUCH better solution than what is proposed here.

Regards,

-- 
  Nicolas George

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold
  2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
                   ` (19 preceding siblings ...)
  2023-04-27 14:26 ` [FFmpeg-devel] [PATCH 21/21] fftools/ffmpeg: always use the same path for setting InputStream.[next_]dts Anton Khirnov
@ 2023-05-01 13:45 ` Anton Khirnov
  2023-05-01 13:46   ` Paul B Mahol
  20 siblings, 1 reply; 38+ messages in thread
From: Anton Khirnov @ 2023-05-01 13:45 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

If nobody has further comments, I'm planning to push the set tomorrow.

-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold
  2023-05-01 13:45 ` [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
@ 2023-05-01 13:46   ` Paul B Mahol
  0 siblings, 0 replies; 38+ messages in thread
From: Paul B Mahol @ 2023-05-01 13:46 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Approved
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2023-05-01 13:47 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27 14:25 [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 02/21] fftools/ffmpeg: reduce access to OutputStream.enc_ctx Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 03/21] fftools/ffmpeg: drop OutputStream.pict_type Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 04/21] fftools/ffmpeg: drop OutputStream.error Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 05/21] fftools/ffmpeg: move OutputStream.packets_encoded to Encoder Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 06/21] fftools/ffmpeg: drop undocumented runtime debug-setting Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 07/21] fftools/ffmpeg_filter: make ifilter_parameters_from_frame() static Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_filter: add filtergraph private data Anton Khirnov
2023-04-28  8:45   ` Nicolas George
2023-04-28 12:01     ` James Almer
2023-04-28 13:52       ` Nicolas George
2023-04-29  8:46         ` Nicolas George
2023-04-29  9:07           ` Anton Khirnov
2023-04-29  9:13             ` Nicolas George
2023-04-29 12:08               ` James Almer
2023-04-29 16:55                 ` Nicolas George
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 09/21] fftools/ffmpeg_filter: make graph_desc private Anton Khirnov
2023-04-28  8:46   ` Nicolas George
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 10/21] fftools/ffmpeg_filter: factorize allocating InputFilter Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 11/21] fftools/ffmpeg_filter: add InputFilter private data Anton Khirnov
2023-04-28  8:47   ` Nicolas George
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 12/21] fftools/ffmpeg_filter: keep track of filtergraph input timebase Anton Khirnov
2023-04-28  8:48   ` Nicolas George
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 13/21] fftools/ffmpeg_filter: use correct timebase for filter EOF timestamp Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 14/21] fftools/ffmpeg: stop using packet pts for decoded audio frame pts Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 15/21] fftools/ffmpeg: set AVFrame.time_base for decoded frames Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 16/21] fftools/ffmpeg: rework audio-decode timestamp handling Anton Khirnov
2023-04-28 11:42   ` Michael Niedermayer
2023-04-28 13:11     ` Anton Khirnov
2023-04-28 19:24       ` Michael Niedermayer
2023-04-29  7:32         ` [FFmpeg-devel] [PATCH] " Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 17/21] fftools/ffmpeg: stop using InputStream.pts for generating video timestamps Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 18/21] fftools/ffmpeg_filter: stop using InputStream.pts for filter EOF ts Anton Khirnov
2023-04-27 14:25 ` [FFmpeg-devel] [PATCH 19/21] fftools/ffmpeg: drop InputStream.[next_]pts Anton Khirnov
2023-04-27 14:26 ` [FFmpeg-devel] [PATCH 20/21] fftools/ffmpeg: constify packets passed to decode*() Anton Khirnov
2023-04-27 14:26 ` [FFmpeg-devel] [PATCH 21/21] fftools/ffmpeg: always use the same path for setting InputStream.[next_]dts Anton Khirnov
2023-05-01 13:45 ` [FFmpeg-devel] [PATCH 01/21] fftools/ffmpeg: deprecate -adrift_threshold Anton Khirnov
2023-05-01 13:46   ` Paul B Mahol

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git