mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
avformat/mpegtsenc: add padding to m2ts streams
6144 byte alignment is needed. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
998906a0a4
commit
1e0ea36945
1 changed files with 7 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue