summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-26 11:52:28 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-26 14:51:47 +0200
commitc329195a27129c7e64af595ce351e3bbf1b9bf1c (patch)
treeb319e6f4806e83d5c254950ebdedcd34250aa66d /libavformat
parent060f14f493104e049481f12e9dc21330801bd137 (diff)
avformat/mux: use a local variable for offset
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mux.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 1e183096a2..de8d1981e8 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -499,14 +499,15 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
if (s->avoid_negative_ts > 0) {
AVStream *st = s->streams[pkt->stream_index];
+ int64_t offset = st->mux_ts_offset;
if (pkt->dts < 0 && pkt->dts != AV_NOPTS_VALUE && !s->offset) {
s->offset = -pkt->dts;
s->offset_timebase = st->time_base;
}
- if (s->offset && !st->mux_ts_offset) {
- st->mux_ts_offset =
+ if (s->offset && !offset) {
+ offset = st->mux_ts_offset =
av_rescale_q_rnd(s->offset,
s->offset_timebase,
st->time_base,
@@ -514,9 +515,9 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
}
if (pkt->dts != AV_NOPTS_VALUE)
- pkt->dts += st->mux_ts_offset;
+ pkt->dts += offset;
if (pkt->pts != AV_NOPTS_VALUE)
- pkt->pts += st->mux_ts_offset;
+ pkt->pts += offset;
}
if (!(s->oformat->flags & (AVFMT_TS_NEGATIVE | AVFMT_NOTIMESTAMPS)) && 0) {