summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-10-17 16:05:24 +0300
committerMartin Storsjö <martin@martin.st>2013-01-03 15:14:34 +0200
commit3f95f0dda55fca74b646937095a02a8fa9776622 (patch)
tree7d3b03ca97bf8aa208bc7b095f4a825dd849078d /libavformat/rtpdec.c
parenta0b7e289075dccf223b7f407790d8a86fc5d77e8 (diff)
rtpdec: Move the URLContext used for RTCP RR out from the context, to a parameter
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r--libavformat/rtpdec.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 10439305dd..77df188cb9 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -226,7 +226,7 @@ static int rtp_valid_packet_in_sequence(RTPStatistics *s, uint16_t seq)
return 1;
}
-int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
+int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, int count)
{
AVIOContext *pb;
uint8_t *buf;
@@ -242,7 +242,7 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
uint32_t fraction;
uint64_t ntp_time = s->last_rtcp_ntp_time; // TODO: Get local ntp time?
- if (!s->rtp_ctx || (count < 1))
+ if (!fd || (count < 1))
return -1;
/* TODO: I think this is way too often; RFC 1889 has algorithm for this */
@@ -316,7 +316,7 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, int count)
if ((len > 0) && buf) {
int av_unused result;
av_dlog(s->ic, "sending %d bytes of RR\n", len);
- result = ffurl_write(s->rtp_ctx, buf, len);
+ result = ffurl_write(fd, buf, len);
av_dlog(s->ic, "result from ffurl_write: %d\n", result);
av_free(buf);
}
@@ -367,8 +367,7 @@ void ff_rtp_send_punch_packets(URLContext *rtp_handle)
* rtp demux (otherwise AV_CODEC_ID_MPEG2TS packets are returned)
*/
RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st,
- URLContext *rtpc, int payload_type,
- int queue_size)
+ int payload_type, int queue_size)
{
RTPDemuxContext *s;
@@ -413,7 +412,6 @@ RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st,
}
}
// needed to send back RTCP RR in RTSP sessions
- s->rtp_ctx = rtpc;
gethostname(s->hostname, sizeof(s->hostname));
return s;
}