From e493452efe006bdb8e4e2679fc9377591e9e646a 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) (cherry picked from commit ae560b9018d1bc553dd520f003f139c3b50e63da) --- 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 41173ff0c..5759fa8f4 100644 --- a/daemon/media_player.c +++ b/daemon/media_player.c @@ -750,12 +750,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, };