PR #26156 opened by Marvin Scholz (ePirat)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26156
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26156.patch

# Summary of changes

Validate several values in flvdec more strictly to prevent float cast overflows

Also fix two regressions from when multitrack support was introduced in 
e2a8ece352bf and add two FATE tests to cover these cases better in the future.

These fixes were assisted by AI, especially the FATE test samples were 
generated with an AI generated script as the ones the ffmpeg muxer generated
did not trigger these specific cases. (The script is attached)

<!--
If this PR requires new FATE test samples, attach them to the PR and
list their target paths below (relative to the fate-suite root).


-->

```fate-samples
flv/concat.flv
flv/concat-multitrack.flv
```



>From ab62dafece634369980e86b0005d5678d68d449d Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Fri, 23 Oct 2026 16:15:48 +0000
Subject: [PATCH 1/8] avformat/flvdec: validate colorInfo values in
 amf_parse_object

Validate colorPrimaries, transferCharacteristics, matrixCoefficients,
maxFall, maxCLL, and hdrMdcv mastering display values against their
Enhanced RTMP v2 specification ranges before assigning them to prevent
float-cast-overflow undefined behavior on out-of-range AMF numbers.

Signed-off-by: Marvin Scholz <[email protected]>
---
 libavformat/flvdec.c | 39 ++++++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index a4d8610d2c1..994fc1c2551 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -776,38 +776,47 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
         }
 
         if (amf_type == AMF_DATA_TYPE_NUMBER && flv->meta_color_info_flag == 
FLV_COLOR_INFO_FLAG_PARSING) {
+#define FLV_SET_VALIDATED(dst, val, min, max)                                  
           \
+    do {                                                                       
           \
+        if ((val) >= (min) && (val) <= (max))                                  
           \
+            (dst) = (val);                                                     
           \
+        else                                                                   
           \
+            av_log(s, AV_LOG_WARNING, "Ignoring out of range value (%g) for 
%s\n",        \
+                   (double)(val), key);                                        
           \
+    } while (0)
             FLVMetaVideoColor *meta_video_color = &flv->meta_color_info;
             if (!strcmp(key, "colorPrimaries")) {
-                meta_video_color->primaries = num_val;
+                FLV_SET_VALIDATED(meta_video_color->primaries, num_val, 0, 
AVCOL_PRI_NB - 1);
             } else if (!strcmp(key, "transferCharacteristics")) {
-                meta_video_color->trc = num_val;
+                FLV_SET_VALIDATED(meta_video_color->trc, num_val, 0, 
AVCOL_TRC_NB - 1);
             } else if (!strcmp(key, "matrixCoefficients")) {
-                meta_video_color->matrix_coefficients = num_val;
+                FLV_SET_VALIDATED(meta_video_color->matrix_coefficients, 
num_val, 0, AVCOL_SPC_NB - 1);
             } else if (!strcmp(key, "maxFall")) {
-                meta_video_color->max_fall = num_val;
+                FLV_SET_VALIDATED(meta_video_color->max_fall, num_val, 0.0001, 
10000);
             } else if (!strcmp(key, "maxCLL")) {
-                meta_video_color->max_cll = num_val;
+                FLV_SET_VALIDATED(meta_video_color->max_cll, num_val, 0.0001, 
10000);
             } else if (!strcmp(key, "redX")) {
-                meta_video_color->mastering_meta.r_x = num_val;
+                FLV_SET_VALIDATED(meta_video_color->mastering_meta.r_x, 
num_val, 0.0001, 0.7400);
             } else if (!strcmp(key, "redY")) {
-                meta_video_color->mastering_meta.r_y = num_val;
+                FLV_SET_VALIDATED(meta_video_color->mastering_meta.r_y, 
num_val, 0.0001, 0.8400);
             } else if (!strcmp(key, "greenX")) {
-                meta_video_color->mastering_meta.g_x = num_val;
+                FLV_SET_VALIDATED(meta_video_color->mastering_meta.g_x, 
num_val, 0.0001, 0.7400);
             } else if (!strcmp(key, "greenY")) {
-                meta_video_color->mastering_meta.g_y = num_val;
+                FLV_SET_VALIDATED(meta_video_color->mastering_meta.g_y, 
num_val, 0.0001, 0.8400);
             } else if (!strcmp(key, "blueX")) {
-                meta_video_color->mastering_meta.b_x = num_val;
+                FLV_SET_VALIDATED(meta_video_color->mastering_meta.b_x, 
num_val, 0.0001, 0.7400);
             } else if (!strcmp(key, "blueY")) {
-                meta_video_color->mastering_meta.b_y = num_val;
+                FLV_SET_VALIDATED(meta_video_color->mastering_meta.b_y, 
num_val, 0.0001, 0.8400);
             } else if (!strcmp(key, "whitePointX")) {
-                meta_video_color->mastering_meta.white_x = num_val;
+                FLV_SET_VALIDATED(meta_video_color->mastering_meta.white_x, 
num_val, 0.0001, 0.7400);
             } else if (!strcmp(key, "whitePointY")) {
-                meta_video_color->mastering_meta.white_y = num_val;
+                FLV_SET_VALIDATED(meta_video_color->mastering_meta.white_y, 
num_val, 0.0001, 0.8400);
             } else if (!strcmp(key, "maxLuminance")) {
-                meta_video_color->mastering_meta.max_luminance = num_val;
+                
FLV_SET_VALIDATED(meta_video_color->mastering_meta.max_luminance, num_val, 5, 
10000);
             } else if (!strcmp(key, "minLuminance")) {
-                meta_video_color->mastering_meta.min_luminance = num_val;
+                
FLV_SET_VALIDATED(meta_video_color->mastering_meta.min_luminance, num_val, 
0.0001, 5);
             }
+#undef FLV_SET_VALIDATED
         }
 
         if (amf_type == AMF_DATA_TYPE_OBJECT && s->nb_streams == 1 &&
-- 
2.54.0


>From 32c6c3d182b2f610810b85b99b4a2c13a8316779 Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Fri, 23 Oct 2026 17:06:21 +0000
Subject: [PATCH 2/8] avformat/flvdec: fix bounds check in
 parse_keyframes_index

Bound keyframe index values to >= INT32_MIN and < (double)INT64_MAX in
parse_keyframes_index() to prevent float-cast-overflow at 0x1p63 and
signed integer overflow during keyframe index validation.

The loop parses both times and filepositions: times are 32-bit signed
integers, while filepositions are 64-bit integers that can only be
positive, so [INT32_MIN, INT64_MAX] covers the valid range of both.

Signed-off-by: Marvin Scholz <[email protected]>
---
 libavformat/flvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 994fc1c2551..7a24892e476 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -579,7 +579,7 @@ static int parse_keyframes_index(AVFormatContext *s, 
AVIOContext *ioc, int64_t m
             if (avio_r8(ioc) != AMF_DATA_TYPE_NUMBER)
                 goto invalid;
             d = av_int2double(avio_rb64(ioc)) * factor;
-            if (isnan(d) || d < INT64_MIN || d > INT64_MAX)
+            if (isnan(d) || d < INT32_MIN || d >= (double)INT64_MAX)
                 goto invalid;
             if (avio_feof(ioc))
                 goto invalid;
-- 
2.54.0


>From 3c7f285587dc5ad453e1b6b2e0c73c6b03ffee4d Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Fri, 23 Oct 2026 17:24:07 +0000
Subject: [PATCH 3/8] avformat/flvdec: validate trusted metadata values in
 amf_parse_object

Prevent float-cast-overflow and signed left-shift undefined behavior
when parsing videocodecid, audiocodecid, audiosamplerate,
audiosamplesize, stereo, width, and height with trust_metadata enabled.

Signed-off-by: Marvin Scholz <[email protected]>
---
 libavformat/flvdec.c | 46 ++++++++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 21 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 7a24892e476..67b81988e65 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -712,6 +712,14 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
     }
 
     if (key) {
+#define FLV_SET_VALIDATED(dst, val, min, max)                                  
           \
+    do {                                                                       
           \
+        if ((val) >= (min) && (val) <= (max))                                  
           \
+            (dst) = (val);                                                     
           \
+        else                                                                   
           \
+            av_log(s, AV_LOG_WARNING, "Ignoring out of range value (%g) for 
%s\n",        \
+                   (double)(val), key);                                        
           \
+    } while (0)
         apar = astream ? astream->codecpar : NULL;
         vpar = vstream ? vstream->codecpar : NULL;
 
@@ -734,24 +742,28 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
                         vstream->avg_frame_rate = flv->framerate;
                 } else if (flv->trust_metadata) {
                     if (!strcmp(key, "videocodecid") && vpar) {
-                        int ret = flv_set_video_codec(s, vstream, num_val, 0);
-                        if (ret < 0)
-                            return ret;
+                        if (0 <= num_val && num_val <= UINT32_MAX) {
+                            int ret = flv_set_video_codec(s, vstream, num_val, 
0);
+                            if (ret < 0)
+                                return ret;
+                        }
                     } else if (!strcmp(key, "audiocodecid") && apar) {
-                        int id = ((int)num_val) << FLV_AUDIO_CODECID_OFFSET;
-                        int ret = flv_set_audio_codec(s, astream, apar, id);
-                        if (ret < 0)
-                            return ret;
+                        if (0 <= num_val && num_val <= (INT_MAX >> 
FLV_AUDIO_CODECID_OFFSET)) {
+                            int id = ((int)num_val) << 
FLV_AUDIO_CODECID_OFFSET;
+                            int ret = flv_set_audio_codec(s, astream, apar, 
id);
+                            if (ret < 0)
+                                return ret;
+                        }
                     } else if (!strcmp(key, "audiosamplerate") && apar) {
-                        apar->sample_rate = num_val;
+                        FLV_SET_VALIDATED(apar->sample_rate, num_val, 0, 
INT_MAX);
                     } else if (!strcmp(key, "audiosamplesize") && apar) {
-                        apar->bits_per_coded_sample = num_val;
+                        FLV_SET_VALIDATED(apar->bits_per_coded_sample, 
num_val, 0, INT_MAX);
                     } else if (!strcmp(key, "stereo") && apar) {
-                        av_channel_layout_default(&apar->ch_layout, num_val + 
1);
+                        av_channel_layout_default(&apar->ch_layout, (num_val > 
0) + 1);
                     } else if (!strcmp(key, "width") && vpar) {
-                        vpar->width = num_val;
+                        FLV_SET_VALIDATED(vpar->width, num_val, 0, INT_MAX);
                     } else if (!strcmp(key, "height") && vpar) {
-                        vpar->height = num_val;
+                        FLV_SET_VALIDATED(vpar->height, num_val, 0, INT_MAX);
                     } else if (!strcmp(key, "datastream")) {
                         AVStream *st = create_stream(s, AVMEDIA_TYPE_SUBTITLE, 
0);
                         if (!st)
@@ -776,14 +788,6 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
         }
 
         if (amf_type == AMF_DATA_TYPE_NUMBER && flv->meta_color_info_flag == 
FLV_COLOR_INFO_FLAG_PARSING) {
-#define FLV_SET_VALIDATED(dst, val, min, max)                                  
           \
-    do {                                                                       
           \
-        if ((val) >= (min) && (val) <= (max))                                  
           \
-            (dst) = (val);                                                     
           \
-        else                                                                   
           \
-            av_log(s, AV_LOG_WARNING, "Ignoring out of range value (%g) for 
%s\n",        \
-                   (double)(val), key);                                        
           \
-    } while (0)
             FLVMetaVideoColor *meta_video_color = &flv->meta_color_info;
             if (!strcmp(key, "colorPrimaries")) {
                 FLV_SET_VALIDATED(meta_video_color->primaries, num_val, 0, 
AVCOL_PRI_NB - 1);
@@ -816,8 +820,8 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
*astream,
             } else if (!strcmp(key, "minLuminance")) {
                 
FLV_SET_VALIDATED(meta_video_color->mastering_meta.min_luminance, num_val, 
0.0001, 5);
             }
-#undef FLV_SET_VALIDATED
         }
+#undef FLV_SET_VALIDATED
 
         if (amf_type == AMF_DATA_TYPE_OBJECT && s->nb_streams == 1 &&
            ((!apar && !strcmp(key, "audiocodecid")) ||
-- 
2.54.0


>From 731594f75f1f299346d6531896ee40db1d5c45ca Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Fri, 23 Oct 2026 19:43:51 +0000
Subject: [PATCH 4/8] avformat/flvdec: fix last_ts update in flv_read_packet

Since e2a8ece352bf, packets are moved into the internal packet buffer
via ff_buffer_packet(s, pkt) before reaching leave, resetting pkt->dts
to AV_NOPTS_VALUE. Use dts instead so flv->last_ts is not overwritten
with AV_NOPTS_VALUE.

Signed-off-by: Marvin Scholz <[email protected]>
---
 libavformat/flvdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 67b81988e65..a4c07702876 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -1973,8 +1973,8 @@ leave:
         }
     }
 
-    if (ret >= 0)
-        flv->last_ts = pkt->dts;
+    if (ret >= 0 && dts != AV_NOPTS_VALUE)
+        flv->last_ts = dts;
 
     return ret ? ret : res;
 }
-- 
2.54.0


>From ca8b8d43f4a86674867e3c6d8fa5285bf6fe8bee Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Fri, 23 Oct 2026 19:54:31 +0000
Subject: [PATCH 5/8] avformat/flvdec: apply time_offset once per tag in
 flv_read_packet

Since e2a8ece352bf, flv->time_offset was added to dts inside the
multitrack loop, adding it once per track instead of once per FLV tag.
Move the addition before the loop.

Signed-off-by: Marvin Scholz <[email protected]>
---
 libavformat/flvdec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index a4c07702876..f3be66d16f1 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -1578,6 +1578,10 @@ skip:
         goto leave;
     }
 
+    if (flv->time_pos <= pos) {
+        dts += flv->time_offset;
+    }
+
     for (;;) {
         int track_size = size;
         if (size < 0) {
@@ -1619,10 +1623,6 @@ skip:
         }
         av_log(s, AV_LOG_TRACE, "%d %X %d \n", stream_type, flags, 
st->discard);
 
-        if (flv->time_pos <= pos) {
-            dts += flv->time_offset;
-        }
-
         if ((s->pb->seekable & AVIO_SEEKABLE_NORMAL) &&
             ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY ||
              stream_type == FLV_STREAM_TYPE_AUDIO))
-- 
2.54.0


>From e91f7b5262ba255cd55972833461a09b8fb57338 Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Fri, 23 Oct 2026 21:04:21 +0000
Subject: [PATCH 6/8] avformat/flvdec: fix data offset handling in
 flv_read_header

The DataOffset field of the FLV header is specified as UI32, so store it
in a uint32_t instead of an int, which turned offsets of 2^31 and above
into negative values.

Signed-off-by: Marvin Scholz <[email protected]>
---
 libavformat/flvdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index f3be66d16f1..3e647d1298c 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -934,7 +934,7 @@ static int flv_read_header(AVFormatContext *s)
     FFFormatContext *const si = ffformatcontext(s);
     int flags;
     FLVContext *flv = s->priv_data;
-    int offset;
+    uint32_t offset;
     int pre_tag_size = 0;
 
     /* Actual FLV data at 0xe40000 in KUX file */
-- 
2.54.0


>From 6d8a4a55bb515a7fa5cbc5f191e3f54e14d51ffb Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Tue, 17 Nov 2026 23:42:18 +0000
Subject: [PATCH 7/8] tests/fate/demux: add test for concatenated FLV

Tests that the packets after the second FLV header get timestamps that
continue after the ones of the first part, which was broken until the
last_ts update in flv_read_packet got fixed.

The sample was written by a script. It consists of two copies of an
FLV with three legacy PCM audio tags of one sample each, as it is only
meant for demuxing. The final PreviousTagSize of the first copy is left
out, as the demuxer only notices the second header while resyncing
after a tag size mismatch.

Signed-off-by: Marvin Scholz <[email protected]>
---
 tests/fate/demux.mak            | 3 +++
 tests/ref/fate/flv-concat-demux | 8 ++++++++
 2 files changed, 11 insertions(+)
 create mode 100644 tests/ref/fate/flv-concat-demux

diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index 58db704a0b3..f4e01a4a802 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -54,6 +54,9 @@ fate-fits-demux: CMD = framecrc -i 
$(TARGET_PATH)/tests/data/fits-multi.fits -c:
 FATE_FFPROBE_DEMUX-$(call DEMDEC, FLV, H264 AAC, H264_PARSER) += fate-flv-demux
 fate-flv-demux: CMD = ffprobe_demux 
$(TARGET_SAMPLES)/flv/Enigma_Principles_of_Lust-part.flv
 
+FATE_FFPROBE_DEMUX-$(call DEMDEC, FLV, PCM_S16LE) += fate-flv-concat-demux
+fate-flv-concat-demux: CMD = ffprobe_demux $(TARGET_SAMPLES)/flv/concat.flv
+
 FATE_SAMPLES_DEMUX-$(call FRAMECRC, GIF,, GIF_PARSER) += fate-gif-demux
 fate-gif-demux: CMD = framecrc -i 
$(TARGET_SAMPLES)/gif/Newtons_cradle_animation_book_2.gif -c:v copy
 
diff --git a/tests/ref/fate/flv-concat-demux b/tests/ref/fate/flv-concat-demux
new file mode 100644
index 00000000000..f95b3fabf20
--- /dev/null
+++ b/tests/ref/fate/flv-concat-demux
@@ -0,0 +1,8 @@
+packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=N/A|duration_time=N/A|size=2|pos=13|flags=K__|data_hash=CRC32:41d912ff
+packet|codec_type=audio|stream_index=0|pts=20|pts_time=0.020000|dts=20|dts_time=0.020000|duration=N/A|duration_time=N/A|size=2|pos=31|flags=K__|data_hash=CRC32:41d912ff
+packet|codec_type=audio|stream_index=0|pts=40|pts_time=0.040000|dts=40|dts_time=0.040000|duration=N/A|duration_time=N/A|size=2|pos=49|flags=K__|data_hash=CRC32:41d912ff
+packet|codec_type=audio|stream_index=0|pts=21|pts_time=0.021000|dts=21|dts_time=0.021000|duration=N/A|duration_time=N/A|size=2|pos=76|flags=K__|data_hash=CRC32:41d912ff
+packet|codec_type=audio|stream_index=0|pts=41|pts_time=0.041000|dts=41|dts_time=0.041000|duration=N/A|duration_time=N/A|size=2|pos=94|flags=K__|data_hash=CRC32:41d912ff
+packet|codec_type=audio|stream_index=0|pts=61|pts_time=0.061000|dts=61|dts_time=0.061000|duration=N/A|duration_time=N/A|size=2|pos=112|flags=K__|data_hash=CRC32:41d912ff
+stream|index=0|codec_name=pcm_s16le|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[0][0][0][0]|codec_tag=0x0000|sample_fmt=s16|sample_rate=44100|channels=1|channel_layout=mono|bits_per_sample=16|initial_padding=0|seek_preroll=0|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/1000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=705600|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=6|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multilayer=0
+format|filename=concat.flv|nb_streams=1|nb_programs=0|nb_stream_groups=0|format_name=flv|start_time=0.000000|duration=0.040000|size=130|bit_rate=26000|probe_score=100
-- 
2.54.0


>From f796f0f1d733bef69ff3fb22ff0cd67bc3183641 Mon Sep 17 00:00:00 2001
From: Marvin Scholz <[email protected]>
Date: Tue, 17 Nov 2026 23:44:45 +0000
Subject: [PATCH 8/8] tests/fate/demux: add test for concatenated multitrack
 FLV

Tests that the time offset of a concatenated FLV is applied once per
tag when a tag carries several tracks, instead of once per track.

As the FLV muxer writes every packet into a tag of its own, the sample
was written by a script. It consists of two copies of an FLV with two
Opus tracks, each copy having:

- a sequence start tag (OpusHead) for each track
- three coded frames tags of the multitrack type ManyTracks, carrying
  a packet for each of the two tracks

The Opus packets are a bare TOC byte, as the sample is only meant for
demuxing. The final PreviousTagSize of the first copy is left out so
that the demuxer resyncs and notices the second header.

Signed-off-by: Marvin Scholz <[email protected]>
---
 tests/fate/demux.mak                       |  3 +++
 tests/ref/fate/flv-concat-multitrack-demux | 15 +++++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 tests/ref/fate/flv-concat-multitrack-demux

diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index f4e01a4a802..6d549cabb9a 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -57,6 +57,9 @@ fate-flv-demux: CMD = ffprobe_demux 
$(TARGET_SAMPLES)/flv/Enigma_Principles_of_L
 FATE_FFPROBE_DEMUX-$(call DEMDEC, FLV, PCM_S16LE) += fate-flv-concat-demux
 fate-flv-concat-demux: CMD = ffprobe_demux $(TARGET_SAMPLES)/flv/concat.flv
 
+FATE_FFPROBE_DEMUX-$(call DEMDEC, FLV, OPUS) += 
fate-flv-concat-multitrack-demux
+fate-flv-concat-multitrack-demux: CMD = ffprobe_demux 
$(TARGET_SAMPLES)/flv/concat-multitrack.flv
+
 FATE_SAMPLES_DEMUX-$(call FRAMECRC, GIF,, GIF_PARSER) += fate-gif-demux
 fate-gif-demux: CMD = framecrc -i 
$(TARGET_SAMPLES)/gif/Newtons_cradle_animation_book_2.gif -c:v copy
 
diff --git a/tests/ref/fate/flv-concat-multitrack-demux 
b/tests/ref/fate/flv-concat-multitrack-demux
new file mode 100644
index 00000000000..82d0907211a
--- /dev/null
+++ b/tests/ref/fate/flv-concat-multitrack-demux
@@ -0,0 +1,15 @@
+packet|codec_type=audio|stream_index=0|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=N/A|duration_time=N/A|size=1|pos=95|flags=K__|data_hash=CRC32:616495a3
+packet|codec_type=audio|stream_index=1|pts=0|pts_time=0.000000|dts=0|dts_time=0.000000|duration=N/A|duration_time=N/A|size=1|pos=95|flags=K__|data_hash=CRC32:616495a3
+packet|codec_type=audio|stream_index=0|pts=20|pts_time=0.020000|dts=20|dts_time=0.020000|duration=N/A|duration_time=N/A|size=1|pos=126|flags=K__|data_hash=CRC32:616495a3
+packet|codec_type=audio|stream_index=1|pts=20|pts_time=0.020000|dts=20|dts_time=0.020000|duration=N/A|duration_time=N/A|size=1|pos=126|flags=K__|data_hash=CRC32:616495a3
+packet|codec_type=audio|stream_index=0|pts=40|pts_time=0.040000|dts=40|dts_time=0.040000|duration=N/A|duration_time=N/A|size=1|pos=157|flags=K__|data_hash=CRC32:616495a3
+packet|codec_type=audio|stream_index=1|pts=40|pts_time=0.040000|dts=40|dts_time=0.040000|duration=N/A|duration_time=N/A|size=1|pos=157|flags=K__|data_hash=CRC32:616495a3
+packet|codec_type=audio|stream_index=0|pts=21|pts_time=0.021000|dts=21|dts_time=0.021000|duration=N/A|duration_time=N/A|size=1|pos=279|flags=K__|data_hash=CRC32:616495a3|side_datum/new_extradata:side_data_type=New
 Extradata
+packet|codec_type=audio|stream_index=1|pts=21|pts_time=0.021000|dts=21|dts_time=0.021000|duration=N/A|duration_time=N/A|size=1|pos=279|flags=K__|data_hash=CRC32:616495a3|side_datum/new_extradata:side_data_type=New
 Extradata
+packet|codec_type=audio|stream_index=0|pts=41|pts_time=0.041000|dts=41|dts_time=0.041000|duration=N/A|duration_time=N/A|size=1|pos=310|flags=K__|data_hash=CRC32:616495a3
+packet|codec_type=audio|stream_index=1|pts=41|pts_time=0.041000|dts=41|dts_time=0.041000|duration=N/A|duration_time=N/A|size=1|pos=310|flags=K__|data_hash=CRC32:616495a3
+packet|codec_type=audio|stream_index=0|pts=61|pts_time=0.061000|dts=61|dts_time=0.061000|duration=N/A|duration_time=N/A|size=1|pos=341|flags=K__|data_hash=CRC32:616495a3
+packet|codec_type=audio|stream_index=1|pts=61|pts_time=0.061000|dts=61|dts_time=0.061000|duration=N/A|duration_time=N/A|size=1|pos=341|flags=K__|data_hash=CRC32:616495a3
+stream|index=0|codec_name=opus|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[0][0][0][0]|codec_tag=0x0000|mime_codec_string=opus|sample_fmt=fltp|sample_rate=48000|channels=1|channel_layout=mono|bits_per_sample=0|initial_padding=0|seek_preroll=0|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/1000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=6|extradata_size=19|extradata_hash=CRC32:016adf29|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multi
 layer=0
+stream|index=1|codec_name=opus|profile=unknown|level=-99|codec_type=audio|codec_tag_string=[0][0][0][0]|codec_tag=0x0000|mime_codec_string=opus|sample_fmt=fltp|sample_rate=48000|channels=1|channel_layout=mono|bits_per_sample=0|initial_padding=0|seek_preroll=0|id=N/A|r_frame_rate=0/0|avg_frame_rate=0/0|time_base=1/1000|start_pts=0|start_time=0.000000|duration_ts=N/A|duration=N/A|bit_rate=N/A|max_bit_rate=N/A|bits_per_raw_sample=N/A|nb_frames=N/A|nb_read_frames=N/A|nb_read_packets=6|extradata_size=19|extradata_hash=CRC32:016adf29|disposition:default=0|disposition:dub=0|disposition:original=0|disposition:comment=0|disposition:lyrics=0|disposition:karaoke=0|disposition:forced=0|disposition:hearing_impaired=0|disposition:visual_impaired=0|disposition:clean_effects=0|disposition:attached_pic=0|disposition:timed_thumbnails=0|disposition:non_diegetic=0|disposition:captions=0|disposition:descriptions=0|disposition:metadata=0|disposition:dependent=0|disposition:still_image=0|disposition:multi
 layer=0
+format|filename=concat-multitrack.flv|nb_streams=2|nb_programs=0|nb_stream_groups=0|format_name=flv|start_time=0.000000|duration=0.040000|size=372|bit_rate=74400|probe_score=100
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to