From c8f038f4b5b10973cf2a32d578849448e9094809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Per=C5=BCy=C5=82o?= Date: Wed, 10 Nov 2021 12:43:42 +0100 Subject: [PATCH] Fixed invalid timestamps calculations inside rtp serializer (#73) --- lib/membrane/rtp/serializer.ex | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/membrane/rtp/serializer.ex b/lib/membrane/rtp/serializer.ex index 102b491e..d802ce7a 100644 --- a/lib/membrane/rtp/serializer.ex +++ b/lib/membrane/rtp/serializer.ex @@ -68,8 +68,7 @@ defmodule Membrane.RTP.Serializer do {rtp_metadata, metadata} = Map.pop(metadata, :rtp, %{}) rtp_offset = - rtp_metadata - |> buffer_timestamp(metadata) + metadata.timestamp |> Ratio.mult(state.clock_rate) |> Membrane.Time.to_seconds() @@ -94,7 +93,4 @@ defmodule Membrane.RTP.Serializer do {{:ok, buffer: {:output, buffer}}, state} end - - defp buffer_timestamp(%{timestamp: timestamp}, _metadata), do: timestamp - defp buffer_timestamp(_rtp_metadata, %{timestamp: timestamp}), do: timestamp end