aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/options.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2014-11-17 13:31:47 +0200
committerMartin Storsjö <martin@martin.st>2014-11-17 23:18:55 +0200
commit9257692ac15eff7b07540c1f61cebde0d8823fbd (patch)
tree6585f4ad7f959524ba5fad02f6eb70a89cc77ac7 /libavformat/options.c
parentc302d034ba2690a935df8bf7e4f5d44ed86e8d5c (diff)
downloadffmpeg-9257692ac15eff7b07540c1f61cebde0d8823fbd.tar.gz
lavf: Only initialize s->offset once when using avoid_negative_ts make_zero
When given a stream starting at dts=0, it would previously consider s->offset as uninitialized and set an offset when the second packet was written, ending up writing two packets with dts=0. By initializing this field to AV_NOPTS_VALUE, we make sure that we only initialize it once, on the first packet. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/options.c')
-rw-r--r--libavformat/options.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/options.c b/libavformat/options.c
index a5646df997..ad47004651 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -101,6 +101,7 @@ AVFormatContext *avformat_alloc_context(void)
ic = av_malloc(sizeof(AVFormatContext));
if (!ic) return ic;
avformat_get_context_defaults(ic);
+ ic->offset = AV_NOPTS_VALUE;
ic->internal = av_mallocz(sizeof(*ic->internal));
if (!ic->internal) {