avformat/mpegtsenc: add padding to m2ts streams

6144 byte alignment is needed.

Signed-off-by: Marton Balint <cus@passwd.hu>
pull/333/head
Marton Balint 5 years ago
parent 998906a0a4
commit 1e0ea36945
  1. 7
      libavformat/mpegtsenc.c

@ -1774,6 +1774,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
static void mpegts_write_flush(AVFormatContext *s)
{
MpegTSWrite *ts = s->priv_data;
int i;
/* flush current packets */
@ -1788,6 +1789,12 @@ static void mpegts_write_flush(AVFormatContext *s)
ts_st->opus_queued_samples = 0;
}
}
if (ts->m2ts_mode) {
int packets = (avio_tell(s->pb) / (TS_PACKET_SIZE + 4)) % 32;
while (packets++ < 32)
mpegts_insert_null_packet(s);
}
}
static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)

Loading…
Cancel
Save