[vlc-commits] demux: ts: fix output from variable->fixed (refs #23654)

Francois Cartegnie git at videolan.org
Thu Jan 23 21:12:49 CET 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 22 14:06:06 2020 +0100| [6efb4c78a573f754987a3bb3df107b720c5986bc] | committer: Francois Cartegnie

demux: ts: fix output from variable->fixed (refs #23654)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6efb4c78a573f754987a3bb3df107b720c5986bc
---

 modules/demux/mpeg/ts_pes.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/demux/mpeg/ts_pes.c b/modules/demux/mpeg/ts_pes.c
index 305f2343df..2f04eddf8c 100644
--- a/modules/demux/mpeg/ts_pes.c
+++ b/modules/demux/mpeg/ts_pes.c
@@ -272,6 +272,17 @@ bool ts_pes_Gather( ts_pes_parse_callback *cb,
             }
             else /* if( p_pes->gather.i_data_size == 0 ) // see next packet */
             {
+                if( likely(b_aligned_ts_payload) && b_unit_start )
+                {
+                    b_ret |= ts_pes_Push( cb, p_pes, NULL, true );
+                    /* now points to PES header */
+                    if( p_pkt->i_buffer >= 6 )
+                    {
+                        p_pes->gather.i_data_size = GetWBE(&p_pkt->p_buffer[4]);
+                        if( p_pes->gather.i_data_size > 0 )
+                            p_pes->gather.i_data_size += 6;
+                    }
+                }
                 /* Append or finish current/start new PES depending on unit_start */
                 b_ret |= ts_pes_Push( cb, p_pes, p_pkt, b_unit_start );
                 p_pkt = NULL;



More information about the vlc-commits mailing list