Commit 1ec28a66 authored by Gilles Chanteperdrix's avatar Gilles Chanteperdrix Committed by Martin Storsjö

rtpdec: fix issue with conversion from unsigned to signed

When receiving an RTCP packet, the difference between the last RTCP
timestamp and the base timestamp may be negative. As these timestamps
are of the uint32_t type, the result becomes a large integer. Cast
the difference to int32_t to avoid this issue.

The result of this issue is very large start times for RTSP
streams, and difficulty to restart correctly after a pause.
Signed-off-by: 's avatarGilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent ff394ca0
...@@ -143,7 +143,7 @@ static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, ...@@ -143,7 +143,7 @@ static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf,
s->first_rtcp_ntp_time = s->last_rtcp_ntp_time; s->first_rtcp_ntp_time = s->last_rtcp_ntp_time;
if (!s->base_timestamp) if (!s->base_timestamp)
s->base_timestamp = s->last_rtcp_timestamp; s->base_timestamp = s->last_rtcp_timestamp;
s->rtcp_ts_offset = s->last_rtcp_timestamp - s->base_timestamp; s->rtcp_ts_offset = (int32_t)(s->last_rtcp_timestamp - s->base_timestamp);
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment