aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mpegtsenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-04-03 20:53:52 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-03 21:01:40 +0200
commit5b97681eaa5aed5103519deed4a706b89a910746 (patch)
tree689fdc631098d338a622a78d8638a541149780f8 /libavformat/mpegtsenc.c
parent44cae912522d579a15c39a00ef2b91dc9c42f881 (diff)
parent7d097a0fc57f0fa8385962a539c657c2f40b5ed0 (diff)
downloadffmpeg-5b97681eaa5aed5103519deed4a706b89a910746.tar.gz
Merge commit '7d097a0fc57f0fa8385962a539c657c2f40b5ed0'
* commit '7d097a0fc57f0fa8385962a539c657c2f40b5ed0': mpegtsenc: Take max_delay into account when buffering multiple audio packets into one PES packet Conflicts: libavformat/mpegtsenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r--libavformat/mpegtsenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index cc650bbd29..ae0593dee7 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1356,7 +1356,10 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
}
}
- if (ts_st->payload_size && ts_st->payload_size + size > ts->pes_payload_size) {
+ if (ts_st->payload_size && (ts_st->payload_size + size > ts->pes_payload_size ||
+ (dts != AV_NOPTS_VALUE && ts_st->payload_dts != AV_NOPTS_VALUE &&
+ av_compare_ts(dts - ts_st->payload_dts, st->time_base,
+ s->max_delay, AV_TIME_BASE_Q) >= 0))) {
mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_size,
ts_st->payload_pts, ts_st->payload_dts,
ts_st->payload_flags & AV_PKT_FLAG_KEY);