summaryrefslogtreecommitdiffstats
path: root/libhb/muxavformat.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/muxavformat.c')
-rw-r--r--libhb/muxavformat.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c
index 48bb2b3f6..72e23f496 100644
--- a/libhb/muxavformat.c
+++ b/libhb/muxavformat.c
@@ -1070,8 +1070,6 @@ static int avformatMux(hb_mux_object_t *m, hb_mux_data_t *track, hb_buffer_t *bu
pkt.flags |= AV_PKT_FLAG_KEY;
}
- track->duration += pkt.duration;
-
switch (track->type)
{
case MUX_TYPE_VIDEO:
@@ -1138,7 +1136,6 @@ static int avformatMux(hb_mux_object_t *m, hb_mux_data_t *track, hb_buffer_t *bu
*job->die = 1;
return -1;
}
- track->duration = pts;
}
if (track->st->codec->codec_id == AV_CODEC_ID_MOV_TEXT)
{
@@ -1209,6 +1206,7 @@ static int avformatMux(hb_mux_object_t *m, hb_mux_data_t *track, hb_buffer_t *bu
default:
break;
}
+ track->duration = pts + pkt.duration;
pkt.stream_index = track->st->index;
int ret = av_interleaved_write_frame(m->oc, &pkt);