diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-04 13:23:19 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-04 13:23:19 +0100 |
commit | 8d0b2aae71f01904e4a7ac0e8795592da5a0bd89 (patch) | |
tree | e0bfc884210a851e22fd1acabb6b9e873cef5bb4 /libavformat/rtpdec.c | |
parent | ea96feddb7bb813c1e0c9befe9c96bf73996f841 (diff) | |
parent | e96406eda4f143f101bd44372f7b2d542183000a (diff) | |
download | ffmpeg-8d0b2aae71f01904e4a7ac0e8795592da5a0bd89.tar.gz |
Merge commit 'e96406eda4f143f101bd44372f7b2d542183000a'
* commit 'e96406eda4f143f101bd44372f7b2d542183000a':
rtsp: Add support for depacketizing RTP data via custom IO
Conflicts:
libavformat/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r-- | libavformat/rtpdec.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index 5412e6735b..31c033a882 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -226,7 +226,8 @@ static int rtp_valid_packet_in_sequence(RTPStatistics *s, uint16_t seq) return 1; } -int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, int count) +int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, + AVIOContext *avio, int count) { AVIOContext *pb; uint8_t *buf; @@ -242,7 +243,7 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, int count) uint32_t fraction; uint64_t ntp_time = s->last_rtcp_ntp_time; // TODO: Get local ntp time? - if (!fd || (count < 1)) + if ((!fd && !avio) || (count < 1)) return -1; /* TODO: I think this is way too often; RFC 1889 has algorithm for this */ @@ -255,7 +256,9 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, int count) return -1; s->last_octet_count = s->octet_count; - if (avio_open_dyn_buf(&pb) < 0) + if (!fd) + pb = avio; + else if (avio_open_dyn_buf(&pb) < 0) return -1; // Receiver Report @@ -312,6 +315,8 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, int count) avio_w8(pb, 0); avio_flush(pb); + if (!fd) + return 0; len = avio_close_dyn_buf(pb, &buf); if ((len > 0) && buf) { int av_unused result; |