[vlc-commits] sout: rtp: clear out M-bit flag from TS/PS rtp header

Francois Cartegnie git at videolan.org
Thu Jul 13 15:20:39 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jul 13 15:11:10 2017 +0200| [3e38360df41aab463aa17f8edbf325ccf03cdfde] | committer: Francois Cartegnie

sout: rtp: clear out M-bit flag from TS/PS rtp header

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

 modules/stream_out/rtp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index 5bfdc62bfc..b203d5e3f2 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -1725,6 +1725,7 @@ static ssize_t AccessOutGrabberWriteBuffer( sout_stream_t *p_stream,
     uint8_t         *p_data = p_buffer->p_buffer;
     size_t          i_data  = p_buffer->i_buffer;
     size_t          i_max   = id->i_mtu - 12;
+    bool            b_dis   = (p_buffer->i_flags & BLOCK_FLAG_DISCONTINUITY);
 
     size_t i_packet = ( p_buffer->i_buffer + i_max - 1 ) / i_max;
 
@@ -1744,11 +1745,13 @@ static ssize_t AccessOutGrabberWriteBuffer( sout_stream_t *p_stream,
         {
             /* allocate a new packet */
             p_sys->packet = block_Alloc( id->i_mtu );
-            rtp_packetize_common( id, p_sys->packet, 1, i_dts );
+            /* m-bit is discontinuity for MPEG1/2 PS and TS, RFC2250 2.1 */
+            rtp_packetize_common( id, p_sys->packet, b_dis, i_dts );
             p_sys->packet->i_buffer = 12;
             p_sys->packet->i_dts = i_dts;
             p_sys->packet->i_length = p_buffer->i_length / i_packet;
             i_dts += p_sys->packet->i_length;
+            b_dis = false;
         }
 
         i_size = __MIN( i_data,



More information about the vlc-commits mailing list