diff --git a/libavformat/demux.c b/libavformat/demux.c
index 2e1d0ed66d..299e693606 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -1186,7 +1186,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
     FFStream *const sti = ffstream(st);
     const uint8_t *data = pkt->data;
     int size = pkt->size;
-    int ret = 0, got_output = flush;
+    int ret = 0, got_output = flush, pkt_side_data_consumed = 0;
 
     if (!size && !flush && sti->parser->flags & PARSER_FLAG_COMPLETE_FRAMES) {
         // preserve 0-size sync packets
@@ -1231,10 +1231,21 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
         }
 
         if (pkt->side_data) {
-            out_pkt->side_data       = pkt->side_data;
-            out_pkt->side_data_elems = pkt->side_data_elems;
-            pkt->side_data          = NULL;
-            pkt->side_data_elems    = 0;
+            /* for the first iteration, side_data are simply moved to output.
+             * in case of additional iterations, they are duplicated each time. */
+            if (!pkt_side_data_consumed) {
+                pkt_side_data_consumed = 1;
+                out_pkt->side_data       = pkt->side_data;
+                out_pkt->side_data_elems = pkt->side_data_elems;
+            } else for (int i = 0; i < pkt->side_data_elems; i++) {
+                const AVPacketSideData *const src_sd = &pkt->side_data[i];
+                uint8_t *dst_data = av_packet_new_side_data(out_pkt, src_sd->type, src_sd->size);
+                if (!dst_data) {
+                    ret = AVERROR(ENOMEM);
+                    goto fail;
+                }
+                memcpy(dst_data, src_sd->data, src_sd->size);
+            }
         }
 
         /* set the duration */
@@ -1286,6 +1297,10 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
     }
 
 fail:
+    if (pkt_side_data_consumed) {
+        pkt->side_data          = NULL;
+        pkt->side_data_elems    = 0;
+    }
     if (ret < 0)
         av_packet_unref(out_pkt);
     av_packet_unref(pkt);
diff --git a/tests/ref/fate/concat-demuxer-simple2-lavf-ts b/tests/ref/fate/concat-demuxer-simple2-lavf-ts
index 548cab01c6..ee49e331f3 100644
--- a/tests/ref/fate/concat-demuxer-simple2-lavf-ts
+++ b/tests/ref/fate/concat-demuxer-simple2-lavf-ts
@@ -7,19 +7,19 @@ video|1|18982|0.210911|15382|0.170911|3600|0.040000|13092|84788|___|MPEGTS Strea
 video|1|22582|0.250911|18982|0.210911|3600|0.040000|12755|98700|___|MPEGTS Stream ID|224
 video|1|26182|0.290911|22582|0.250911|3600|0.040000|12023|111860|___|MPEGTS Stream ID|224
 audio|0|0|0.000000|0|0.000000|2351|0.026122|208|152844|K__|MPEGTS Stream ID|192
-audio|0|2351|0.026122|2351|0.026122|2351|0.026122|209|N/A|K__
-audio|0|4702|0.052244|4702|0.052244|2351|0.026122|209|N/A|K__
-audio|0|7053|0.078367|7053|0.078367|2351|0.026122|209|N/A|K__
-audio|0|9404|0.104489|9404|0.104489|2351|0.026122|209|N/A|K__
-audio|0|11755|0.130611|11755|0.130611|2351|0.026122|209|N/A|K__
-audio|0|14106|0.156733|14106|0.156733|2351|0.026122|209|N/A|K__
-audio|0|16457|0.182856|16457|0.182856|2351|0.026122|209|N/A|K__
-audio|0|18808|0.208978|18808|0.208978|2351|0.026122|209|N/A|K__
-audio|0|21159|0.235100|21159|0.235100|2351|0.026122|209|N/A|K__
-audio|0|23510|0.261222|23510|0.261222|2351|0.026122|209|N/A|K__
-audio|0|25861|0.287344|25861|0.287344|2351|0.026122|209|N/A|K__
-audio|0|28212|0.313467|28212|0.313467|2351|0.026122|209|N/A|K__
-audio|0|30563|0.339589|30563|0.339589|2351|0.026122|209|N/A|K__
+audio|0|2351|0.026122|2351|0.026122|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|4702|0.052244|4702|0.052244|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|7053|0.078367|7053|0.078367|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|9404|0.104489|9404|0.104489|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|11755|0.130611|11755|0.130611|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|14106|0.156733|14106|0.156733|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|16457|0.182856|16457|0.182856|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|18808|0.208978|18808|0.208978|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|21159|0.235100|21159|0.235100|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|23510|0.261222|23510|0.261222|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|25861|0.287344|25861|0.287344|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|28212|0.313467|28212|0.313467|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|30563|0.339589|30563|0.339589|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
 video|1|29782|0.330911|26182|0.290911|3600|0.040000|14098|124268|___|MPEGTS Stream ID|224
 video|1|33382|0.370911|29782|0.330911|3600|0.040000|13329|139120|___|MPEGTS Stream ID|224
 video|1|36982|0.410911|33382|0.370911|3600|0.040000|12135|155852|___|MPEGTS Stream ID|224
@@ -31,35 +31,35 @@ video|1|54982|0.610911|51382|0.570911|3600|0.040000|13449|240640|___|MPEGTS Stre
 video|1|58582|0.650911|54982|0.610911|3600|0.040000|12398|254552|___|MPEGTS Stream ID|224
 video|1|62182|0.690911|58582|0.650911|3600|0.040000|13455|267336|___|MPEGTS Stream ID|224
 audio|0|32915|0.365722|32915|0.365722|2351|0.026122|209|308508|K__|MPEGTS Stream ID|192
-audio|0|35266|0.391844|35266|0.391844|2351|0.026122|209|N/A|K__
-audio|0|37617|0.417967|37617|0.417967|2351|0.026122|209|N/A|K__
-audio|0|39968|0.444089|39968|0.444089|2351|0.026122|209|N/A|K__
-audio|0|42319|0.470211|42319|0.470211|2351|0.026122|209|N/A|K__
-audio|0|44670|0.496333|44670|0.496333|2351|0.026122|209|N/A|K__
-audio|0|47021|0.522456|47021|0.522456|2351|0.026122|209|N/A|K__
-audio|0|49372|0.548578|49372|0.548578|2351|0.026122|209|N/A|K__
-audio|0|51723|0.574700|51723|0.574700|2351|0.026122|209|N/A|K__
-audio|0|54074|0.600822|54074|0.600822|2351|0.026122|209|N/A|K__
-audio|0|56425|0.626944|56425|0.626944|2351|0.026122|209|N/A|K__
-audio|0|58776|0.653067|58776|0.653067|2351|0.026122|209|N/A|K__
-audio|0|61127|0.679189|61127|0.679189|2351|0.026122|209|N/A|K__
-audio|0|63478|0.705311|63478|0.705311|2351|0.026122|209|N/A|K__
+audio|0|35266|0.391844|35266|0.391844|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|37617|0.417967|37617|0.417967|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|39968|0.444089|39968|0.444089|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|42319|0.470211|42319|0.470211|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|44670|0.496333|44670|0.496333|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|47021|0.522456|47021|0.522456|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|49372|0.548578|49372|0.548578|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|51723|0.574700|51723|0.574700|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|54074|0.600822|54074|0.600822|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|56425|0.626944|56425|0.626944|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|58776|0.653067|58776|0.653067|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|61127|0.679189|61127|0.679189|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|63478|0.705311|63478|0.705311|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
 video|1|65782|0.730911|62182|0.690911|3600|0.040000|13836|281624|___|MPEGTS Stream ID|224
 video|1|69382|0.770911|65782|0.730911|3600|0.040000|12163|295912|___|MPEGTS Stream ID|224
 video|1|72982|0.810911|69382|0.770911|3600|0.040000|12692|311516|___|MPEGTS Stream ID|224
 video|1|76582|0.850911|72982|0.810911|3600|0.040000|10824|325052|___|MPEGTS Stream ID|224
 video|1|80182|0.890911|76582|0.850911|3600|0.040000|11286|336144|___|MPEGTS Stream ID|224
 audio|0|65829|0.731433|65829|0.731433|2351|0.026122|209|386716|K__|MPEGTS Stream ID|192
-audio|0|68180|0.757556|68180|0.757556|2351|0.026122|209|N/A|K__
-audio|0|70531|0.783678|70531|0.783678|2351|0.026122|209|N/A|K__
-audio|0|72882|0.809800|72882|0.809800|2351|0.026122|209|N/A|K__
-audio|0|75233|0.835922|75233|0.835922|2351|0.026122|209|N/A|K__
-audio|0|77584|0.862044|77584|0.862044|2351|0.026122|209|N/A|K__
-audio|0|79935|0.888167|79935|0.888167|2351|0.026122|209|N/A|K__
-audio|0|82286|0.914289|82286|0.914289|2351|0.026122|209|N/A|K__
-audio|0|84637|0.940411|84637|0.940411|2351|0.026122|209|N/A|K__
-audio|0|86988|0.966533|86988|0.966533|2351|0.026122|209|N/A|K__
-audio|0|89339|0.992656|89339|0.992656|2351|0.026122|209|N/A|K__
+audio|0|68180|0.757556|68180|0.757556|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|70531|0.783678|70531|0.783678|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|72882|0.809800|72882|0.809800|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|75233|0.835922|75233|0.835922|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|77584|0.862044|77584|0.862044|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|79935|0.888167|79935|0.888167|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|82286|0.914289|82286|0.914289|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|84637|0.940411|84637|0.940411|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|86988|0.966533|86988|0.966533|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|89339|0.992656|89339|0.992656|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
 video|1|83782|0.930911|80182|0.890911|3600|0.040000|12678|347800|___|MPEGTS Stream ID|224
 video|1|87382|0.970911|83782|0.930911|3600|0.040000|24711|361336|K__
 video|1|91964|1.021822|88364|0.981822|3600|0.040000|24801|564|K__|MPEGTS Stream ID|224
@@ -71,19 +71,19 @@ video|1|109964|1.221822|106364|1.181822|3600|0.040000|13092|84788|___|MPEGTS Str
 video|1|113564|1.261822|109964|1.221822|3600|0.040000|12755|98700|___|MPEGTS Stream ID|224
 video|1|117164|1.301822|113564|1.261822|3600|0.040000|12023|111860|___|MPEGTS Stream ID|224
 audio|0|90982|1.010911|90982|1.010911|2351|0.026122|208|152844|K__|MPEGTS Stream ID|192
-audio|0|93333|1.037033|93333|1.037033|2351|0.026122|209|N/A|K__
-audio|0|95684|1.063156|95684|1.063156|2351|0.026122|209|N/A|K__
-audio|0|98035|1.089278|98035|1.089278|2351|0.026122|209|N/A|K__
-audio|0|100386|1.115400|100386|1.115400|2351|0.026122|209|N/A|K__
-audio|0|102737|1.141522|102737|1.141522|2351|0.026122|209|N/A|K__
-audio|0|105088|1.167644|105088|1.167644|2351|0.026122|209|N/A|K__
-audio|0|107439|1.193767|107439|1.193767|2351|0.026122|209|N/A|K__
-audio|0|109790|1.219889|109790|1.219889|2351|0.026122|209|N/A|K__
-audio|0|112141|1.246011|112141|1.246011|2351|0.026122|209|N/A|K__
-audio|0|114492|1.272133|114492|1.272133|2351|0.026122|209|N/A|K__
-audio|0|116843|1.298256|116843|1.298256|2351|0.026122|209|N/A|K__
-audio|0|119194|1.324378|119194|1.324378|2351|0.026122|209|N/A|K__
-audio|0|121545|1.350500|121545|1.350500|2351|0.026122|209|N/A|K__
+audio|0|93333|1.037033|93333|1.037033|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|95684|1.063156|95684|1.063156|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|98035|1.089278|98035|1.089278|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|100386|1.115400|100386|1.115400|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|102737|1.141522|102737|1.141522|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|105088|1.167644|105088|1.167644|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|107439|1.193767|107439|1.193767|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|109790|1.219889|109790|1.219889|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|112141|1.246011|112141|1.246011|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|114492|1.272133|114492|1.272133|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|116843|1.298256|116843|1.298256|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|119194|1.324378|119194|1.324378|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|121545|1.350500|121545|1.350500|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
 video|1|120764|1.341822|117164|1.301822|3600|0.040000|14098|124268|___|MPEGTS Stream ID|224
 video|1|124364|1.381822|120764|1.341822|3600|0.040000|13329|139120|___|MPEGTS Stream ID|224
 video|1|127964|1.421822|124364|1.381822|3600|0.040000|12135|155852|___|MPEGTS Stream ID|224
@@ -95,51 +95,51 @@ video|1|145964|1.621822|142364|1.581822|3600|0.040000|13449|240640|___|MPEGTS St
 video|1|149564|1.661822|145964|1.621822|3600|0.040000|12398|254552|___|MPEGTS Stream ID|224
 video|1|153164|1.701822|149564|1.661822|3600|0.040000|13455|267336|___|MPEGTS Stream ID|224
 audio|0|123897|1.376633|123897|1.376633|2351|0.026122|209|308508|K__|MPEGTS Stream ID|192
-audio|0|126248|1.402756|126248|1.402756|2351|0.026122|209|N/A|K__
-audio|0|128599|1.428878|128599|1.428878|2351|0.026122|209|N/A|K__
-audio|0|130950|1.455000|130950|1.455000|2351|0.026122|209|N/A|K__
-audio|0|133301|1.481122|133301|1.481122|2351|0.026122|209|N/A|K__
-audio|0|135652|1.507244|135652|1.507244|2351|0.026122|209|N/A|K__
-audio|0|138003|1.533367|138003|1.533367|2351|0.026122|209|N/A|K__
-audio|0|140354|1.559489|140354|1.559489|2351|0.026122|209|N/A|K__
-audio|0|142705|1.585611|142705|1.585611|2351|0.026122|209|N/A|K__
-audio|0|145056|1.611733|145056|1.611733|2351|0.026122|209|N/A|K__
-audio|0|147407|1.637856|147407|1.637856|2351|0.026122|209|N/A|K__
-audio|0|149758|1.663978|149758|1.663978|2351|0.026122|209|N/A|K__
-audio|0|152109|1.690100|152109|1.690100|2351|0.026122|209|N/A|K__
-audio|0|154460|1.716222|154460|1.716222|2351|0.026122|209|N/A|K__
+audio|0|126248|1.402756|126248|1.402756|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|128599|1.428878|128599|1.428878|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|130950|1.455000|130950|1.455000|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|133301|1.481122|133301|1.481122|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|135652|1.507244|135652|1.507244|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|138003|1.533367|138003|1.533367|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|140354|1.559489|140354|1.559489|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|142705|1.585611|142705|1.585611|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|145056|1.611733|145056|1.611733|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|147407|1.637856|147407|1.637856|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|149758|1.663978|149758|1.663978|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|152109|1.690100|152109|1.690100|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|154460|1.716222|154460|1.716222|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
 video|1|156764|1.741822|153164|1.701822|3600|0.040000|13836|281624|___|MPEGTS Stream ID|224
 video|1|160364|1.781822|156764|1.741822|3600|0.040000|12163|295912|___|MPEGTS Stream ID|224
 video|1|163964|1.821822|160364|1.781822|3600|0.040000|12692|311516|___|MPEGTS Stream ID|224
 video|1|167564|1.861822|163964|1.821822|3600|0.040000|10824|325052|___|MPEGTS Stream ID|224
 video|1|171164|1.901822|167564|1.861822|3600|0.040000|11286|336144|___|MPEGTS Stream ID|224
 audio|0|156811|1.742344|156811|1.742344|2351|0.026122|209|386716|K__|MPEGTS Stream ID|192
-audio|0|159162|1.768467|159162|1.768467|2351|0.026122|209|N/A|K__
-audio|0|161513|1.794589|161513|1.794589|2351|0.026122|209|N/A|K__
-audio|0|163864|1.820711|163864|1.820711|2351|0.026122|209|N/A|K__
-audio|0|166215|1.846833|166215|1.846833|2351|0.026122|209|N/A|K__
-audio|0|168566|1.872956|168566|1.872956|2351|0.026122|209|N/A|K__
-audio|0|170917|1.899078|170917|1.899078|2351|0.026122|209|N/A|K__
-audio|0|173268|1.925200|173268|1.925200|2351|0.026122|209|N/A|K__
-audio|0|175619|1.951322|175619|1.951322|2351|0.026122|209|N/A|K__
-audio|0|177970|1.977444|177970|1.977444|2351|0.026122|209|N/A|K__
-audio|0|180321|2.003567|180321|2.003567|2351|0.026122|209|N/A|K__
+audio|0|159162|1.768467|159162|1.768467|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|161513|1.794589|161513|1.794589|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|163864|1.820711|163864|1.820711|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|166215|1.846833|166215|1.846833|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|168566|1.872956|168566|1.872956|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|170917|1.899078|170917|1.899078|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|173268|1.925200|173268|1.925200|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|175619|1.951322|175619|1.951322|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|177970|1.977444|177970|1.977444|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|180321|2.003567|180321|2.003567|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
 video|1|174764|1.941822|171164|1.901822|3600|0.040000|12678|347800|___|MPEGTS Stream ID|224
 video|1|178364|1.981822|174764|1.941822|3600|0.040000|24711|361336|K__
 video|1|139582|1.550911|135982|1.510911|3600|0.040000|12692|311516|___|MPEGTS Stream ID|224
 video|1|143182|1.590911|139582|1.550911|3600|0.040000|10824|325052|___|MPEGTS Stream ID|224
 video|1|146782|1.630911|143182|1.590911|3600|0.040000|11286|336144|___|MPEGTS Stream ID|224
 audio|0|132429|1.471433|132429|1.471433|2351|0.026122|209|386716|K__|MPEGTS Stream ID|192
-audio|0|134780|1.497556|134780|1.497556|2351|0.026122|209|N/A|K__
-audio|0|137131|1.523678|137131|1.523678|2351|0.026122|209|N/A|K__
-audio|0|139482|1.549800|139482|1.549800|2351|0.026122|209|N/A|K__
-audio|0|141833|1.575922|141833|1.575922|2351|0.026122|209|N/A|K__
-audio|0|144184|1.602044|144184|1.602044|2351|0.026122|209|N/A|K__
-audio|0|146535|1.628167|146535|1.628167|2351|0.026122|209|N/A|K__
-audio|0|148886|1.654289|148886|1.654289|2351|0.026122|209|N/A|K__
-audio|0|151237|1.680411|151237|1.680411|2351|0.026122|209|N/A|K__
-audio|0|153588|1.706533|153588|1.706533|2351|0.026122|209|N/A|K__
-audio|0|155939|1.732656|155939|1.732656|2351|0.026122|209|N/A|K__
+audio|0|134780|1.497556|134780|1.497556|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|137131|1.523678|137131|1.523678|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|139482|1.549800|139482|1.549800|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|141833|1.575922|141833|1.575922|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|144184|1.602044|144184|1.602044|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|146535|1.628167|146535|1.628167|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|148886|1.654289|148886|1.654289|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|151237|1.680411|151237|1.680411|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|153588|1.706533|153588|1.706533|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
+audio|0|155939|1.732656|155939|1.732656|2351|0.026122|209|N/A|K__|MPEGTS Stream ID|192
 video|1|150382|1.670911|146782|1.630911|3600|0.040000|12678|347800|___|MPEGTS Stream ID|224
 video|1|153982|1.710911|150382|1.670911|3600|0.040000|24711|361336|K__
 video|1|161182|1.790911|157582|1.750911|3600|0.040000|12135|155852|___|MPEGTS Stream ID|224
diff --git a/tests/ref/fate/ts-demux b/tests/ref/fate/ts-demux
index b01f525c38..4274a0e145 100644
--- a/tests/ref/fate/ts-demux
+++ b/tests/ref/fate/ts-demux
@@ -10,11 +10,11 @@ packet|codec_type=video|stream_index=0|pts=3912677354|pts_time=43474.192822|dts=
 packet|codec_type=video|stream_index=0|pts=3912683360|pts_time=43474.259556|dts=3912678855|dts_time=43474.209500|duration=1501|duration_time=0.016678|size=61720|pos=325240|flags=___|data_hash=CRC32:7e6594e5|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=224
 packet|codec_type=video|stream_index=0|pts=3912680357|pts_time=43474.226189|dts=3912680357|dts_time=43474.226189|duration=1501|duration_time=0.016678|size=17416|pos=390852|flags=___|data_hash=CRC32:31c8b89d|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=224
 packet|codec_type=audio|stream_index=1|pts=3912633305|pts_time=43473.703389|dts=3912633305|dts_time=43473.703389|duration=2880|duration_time=0.032000|size=1536|pos=218080|flags=K__|data_hash=CRC32:25b60d38|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=189
-packet|codec_type=audio|stream_index=1|pts=3912636185|pts_time=43473.735389|dts=3912636185|dts_time=43473.735389|duration=2880|duration_time=0.032000|size=1536|pos=N/A|flags=K__|data_hash=CRC32:d4e30aaf
-packet|codec_type=audio|stream_index=1|pts=3912639065|pts_time=43473.767389|dts=3912639065|dts_time=43473.767389|duration=2880|duration_time=0.032000|size=1536|pos=N/A|flags=K__|data_hash=CRC32:32d6d14d
+packet|codec_type=audio|stream_index=1|pts=3912636185|pts_time=43473.735389|dts=3912636185|dts_time=43473.735389|duration=2880|duration_time=0.032000|size=1536|pos=N/A|flags=K__|data_hash=CRC32:d4e30aaf|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=189
+packet|codec_type=audio|stream_index=1|pts=3912639065|pts_time=43473.767389|dts=3912639065|dts_time=43473.767389|duration=2880|duration_time=0.032000|size=1536|pos=N/A|flags=K__|data_hash=CRC32:32d6d14d|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=189
 packet|codec_type=audio|stream_index=2|pts=3912634060|pts_time=43473.711778|dts=3912634060|dts_time=43473.711778|duration=2880|duration_time=0.032000|size=768|pos=235564|flags=K__|data_hash=CRC32:34b350c9|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=189
-packet|codec_type=audio|stream_index=2|pts=3912636940|pts_time=43473.743778|dts=3912636940|dts_time=43473.743778|duration=2880|duration_time=0.032000|size=768|pos=N/A|flags=K__|data_hash=CRC32:457881f8
-packet|codec_type=audio|stream_index=2|pts=3912639820|pts_time=43473.775778|dts=3912639820|dts_time=43473.775778|duration=2880|duration_time=0.032000|size=768|pos=N/A|flags=K__|data_hash=CRC32:1abb0d9a
+packet|codec_type=audio|stream_index=2|pts=3912636940|pts_time=43473.743778|dts=3912636940|dts_time=43473.743778|duration=2880|duration_time=0.032000|size=768|pos=N/A|flags=K__|data_hash=CRC32:457881f8|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=189
+packet|codec_type=audio|stream_index=2|pts=3912639820|pts_time=43473.775778|dts=3912639820|dts_time=43473.775778|duration=2880|duration_time=0.032000|size=768|pos=N/A|flags=K__|data_hash=CRC32:1abb0d9a|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=189
 packet|codec_type=video|stream_index=0|pts=3912681858|pts_time=43474.242867|dts=3912681858|dts_time=43474.242867|duration=1501|duration_time=0.016678|size=18144|pos=409464|flags=___|data_hash=CRC32:826f8e8e|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=224
 packet|codec_type=video|stream_index=0|pts=3912687864|pts_time=43474.309600|dts=3912683360|dts_time=43474.259556|duration=1501|duration_time=0.016678|size=56848|pos=428640|flags=___|data_hash=CRC32:6b15be8c|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=224
 packet|codec_type=video|stream_index=0|pts=3912684861|pts_time=43474.276233|dts=3912684861|dts_time=43474.276233|duration=1501|duration_time=0.016678|size=16296|pos=489176|flags=___|data_hash=CRC32:911b1649|side_datum/mpegts_stream_id:side_data_type=MPEGTS Stream ID|side_datum/mpegts_stream_id:id=224
