This is needed for the application to be able to calculate packet UTC
times. The RTCP packet is sent as side data to the next AVPacket, but
there is no way to know how the timestamps in the RTCP packet relates
to the pts or dts in the AVPacket.

Signed-off-by: Branko Subasic <[email protected]>
---
 libavcodec/defs.h    | 1 +
 libavformat/rtpdec.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/libavcodec/defs.h b/libavcodec/defs.h
index b13e983b13..c6a941e172 100644
--- a/libavcodec/defs.h
+++ b/libavcodec/defs.h
@@ -348,6 +348,7 @@ typedef struct AVRTCPSenderReport {
     uint32_t rtp_timestamp; ///< RTP time when the report was sent
     uint32_t sender_nb_packets; ///< Total number of packets sent
uint32_t sender_nb_bytes; ///< Total number of bytes sent (excluding headers or padding) + uint32_t base_rtp_timestamp; //< Base RTP time, obtained from the RTP-Info header
 } AVRTCPSenderReport;
  /**
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 5872c0f59c..dddcb17d89 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -197,6 +197,7 @@ static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf,
             s->last_sr.rtp_timestamp = AV_RB32(buf + 16);
             s->last_sr.sender_nb_packets = AV_RB32(buf + 20);
             s->last_sr.sender_nb_bytes = AV_RB32(buf + 24);
+            s->last_sr.base_rtp_timestamp = s->base_timestamp;
              s->pending_sr = 1;
             s->last_rtcp_reception_time = av_gettime_relative();
--
2.43.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to