Commit 1e0ea369 authored by Marton Balint's avatar Marton Balint

avformat/mpegtsenc: add padding to m2ts streams

6144 byte alignment is needed.
Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent 998906a0
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment