summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-18 02:38:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-18 02:46:07 +0100
commit9943c5a42bdf8412f60e8a33489d6f2a8b1b9d61 (patch)
treea1dd73d724ac6e4e34cb818f9bd3d7b309be347c /libavformat/mux.c
parentafbaa9a737b3546c12fdf328016cc1e587d65dc9 (diff)
parent9257692ac15eff7b07540c1f61cebde0d8823fbd (diff)
Merge commit '9257692ac15eff7b07540c1f61cebde0d8823fbd'
* commit '9257692ac15eff7b07540c1f61cebde0d8823fbd': lavf: Only initialize s->offset once when using avoid_negative_ts make_zero Conflicts: libavformat/mux.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 3fb4a012cf..a09e33cfdd 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -557,13 +557,13 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
AVStream *st = s->streams[pkt->stream_index];
int64_t offset = st->mux_ts_offset;
- if (!s->offset && pkt->dts != AV_NOPTS_VALUE &&
+ if (s->offset == AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE &&
(pkt->dts < 0 || s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_MAKE_ZERO)) {
s->offset = -pkt->dts;
s->offset_timebase = st->time_base;
}
- if (s->offset && !offset) {
+ if (s->offset != AV_NOPTS_VALUE && !offset) {
offset = st->mux_ts_offset =
av_rescale_q_rnd(s->offset,
s->offset_timebase,