summaryrefslogtreecommitdiff
path: root/libavformat/mpegtsenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r--libavformat/mpegtsenc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 493ae2eb6f..a594ca257f 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -460,6 +460,9 @@ static int mpegts_write_header(AVFormatContext *s)
const char *provider_name;
int *pids;
+ if (s->max_delay < 0) /* Not set by the caller */
+ s->max_delay = 0;
+
// round up to a whole number of TS packets
ts->pes_payload_size = (ts->pes_payload_size + 14 + 183) / 184 * 184 - 14;