summaryrefslogtreecommitdiffstats
path: root/libhb/muxavformat.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-01-16 10:25:47 -0800
committerJohn Stebbins <[email protected]>2019-01-16 10:27:34 -0800
commit71e73fec08f414574c74dd0b482c516faad2fbfb (patch)
treebf9729a227a6225ab3c536caeca287688f93b47b /libhb/muxavformat.c
parent8fcde66f6ae16352e8473a35d5b87cd4482e70e7 (diff)
muxavformat: use better approximation for duration of last video frame
Fixes https://github.com/HandBrake/HandBrake/issues/1802
Diffstat (limited to 'libhb/muxavformat.c')
-rw-r--r--libhb/muxavformat.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c
index ff041b47c..2d4390f53 100644
--- a/libhb/muxavformat.c
+++ b/libhb/muxavformat.c
@@ -1234,10 +1234,20 @@ static int avformatMux(hb_mux_object_t *m, hb_mux_data_t *track, hb_buffer_t *bu
// have zero duration.
if (track->type == MUX_TYPE_SUBTITLE &&
track->st->codecpar->codec_id != AV_CODEC_ID_HDMV_PGS_SUBTITLE)
+ {
duration = av_rescale_q(10, (AVRational){1,1},
track->st->time_base);
+ }
+ else if (track->type == MUX_TYPE_VIDEO)
+ {
+ duration = av_rescale_q(
+ (int64_t)job->vrate.den * 90000 / job->vrate.num,
+ (AVRational){1,90000}, track->st->time_base);
+ }
else
+ {
duration = 0;
+ }
}
av_init_packet(&pkt);