From: Mathieu Duponchelle Date: Wed, 8 May 2019 14:56:29 +0000 (+0200) Subject: tsmux: fix continuity counter for packets with no payload X-Git-Tag: 1.19.3~507^2~3350 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c7c08e7c4bfe6c2fc4c4a8d86aca7b3bedddb08;p=platform%2Fupstream%2Fgstreamer.git tsmux: fix continuity counter for packets with no payload --- diff --git a/gst/mpegtsmux/tsmux/tsmux.c b/gst/mpegtsmux/tsmux/tsmux.c index 71550d41c8..91dadd6b0e 100644 --- a/gst/mpegtsmux/tsmux/tsmux.c +++ b/gst/mpegtsmux/tsmux/tsmux.c @@ -823,7 +823,7 @@ tsmux_write_ts_header (guint8 * buf, TsMuxPacketInfo * pi, guint * payload_len_out, guint * payload_offset_out, guint stream_avail) { guint8 *tmp; - guint8 adaptation_flag; + guint8 adaptation_flag = 0; guint8 adapt_min_length = 0; guint8 adapt_len = 0; guint payload_len; @@ -851,7 +851,6 @@ tsmux_write_ts_header (guint8 * buf, TsMuxPacketInfo * pi, * 2 bits: adaptation field control (1x has_adaptation_field | x1 has_payload) * 4 bits: continuity counter (xxxx) */ - adaptation_flag = pi->packet_count & 0x0f; if (pi->flags & TSMUX_PACKET_FLAG_ADAPTATION) { write_adapt = TRUE; @@ -895,6 +894,8 @@ tsmux_write_ts_header (guint8 * buf, TsMuxPacketInfo * pi, pi->packet_count++; } + adaptation_flag |= pi->packet_count & 0x0f; + /* Write the byte of transport_scrambling_control, adaptation_field_control * + continuity counter out */ buf[3] = adaptation_flag;