for (i = 0; i < zero_trail_bytes; i++)
avio_w8(ctx->pb, 0x00);
- avio_flush(ctx->pb);
+ avio_write_marker(ctx->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_FLUSH_POINT);
s->packet_number++;
s->vcd_padding_bytes_written += s->packet_size;
- avio_flush(ctx->pb);
+ avio_write_marker(ctx->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_FLUSH_POINT);
/* increasing the packet number is correct. The SCR of the following packs
* is calculated from the packet_number and it has to include the padding
if (s->is_dvd) {
// min VOBU length 0.4 seconds (mpucoder)
if (is_iframe &&
- (s->packet_number == 0 ||
+ (s->packet_number == 0 || pts != AV_NOPTS_VALUE &&
(pts - stream->vobu_start_pts >= 36000))) {
stream->bytes_to_iframe = av_fifo_size(stream->fifo);
stream->align_iframe = 1;