From 91dc1674477f80ac39e7fb1a02e8afd57996a06e Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 9 Jan 2025 14:28:58 -0400 Subject: [PATCH] MT#61822 fix missing duration scaling Change-Id: If0ebc38a30575346e2aaf08df7b125005cda0d80 (cherry picked from commit 6a7cd32beb34c344e242294e685b83e28311c026) --- daemon/media_player.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/media_player.c b/daemon/media_player.c index a69f29e34..c28af667d 100644 --- a/daemon/media_player.c +++ b/daemon/media_player.c @@ -615,12 +615,13 @@ static void packet_encoded_cache(AVPacket *pkt, struct codec_ssrc_handler *ch, s struct media_player_cache_packet *ep = g_slice_alloc0(sizeof(*ep)); + long duration = fraction_divl(pkt->duration, cr_fact); *ep = (__typeof__(*ep)) { .buf = buf, .s = *s, .pts = pkt->pts, - .duration_ts = pkt->duration, - .duration = (long long) pkt->duration * 1000000LL + .duration_ts = duration, + .duration = (long long) duration * 1000000LL / entry->coder.handler->dest_pt.clock_rate, };