aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpdec.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-02-24 18:24:34 +0000
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-02-24 18:24:34 +0000
commit79b1a24b7ddd20ba68b0bb7a5ad41fe0dd77ffc8 (patch)
tree852b63b5f3c53d699696259720c952015691a3f3 /libavformat/rtpdec.c
parentef7ce480c848267a77bd89666b9b22b2298c181d (diff)
parent8d918a98aa24134a043d578ef45bae363dbed9db (diff)
downloadffmpeg-79b1a24b7ddd20ba68b0bb7a5ad41fe0dd77ffc8.tar.gz
Merge commit '8d918a98aa24134a043d578ef45bae363dbed9db'
* commit '8d918a98aa24134a043d578ef45bae363dbed9db': rtpdec: Use the right logging context Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r--libavformat/rtpdec.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index c3e50d44b2..c8eed7ee18 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -150,8 +150,7 @@ static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf,
switch (buf[1]) {
case RTCP_SR:
if (payload_len < 20) {
- av_log(NULL, AV_LOG_ERROR,
- "Invalid length for RTCP SR packet\n");
+ av_log(s->ic, AV_LOG_ERROR, "Invalid RTCP SR packet length\n");
return AVERROR_INVALIDDATA;
}
@@ -521,8 +520,8 @@ RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st,
s->st = st;
s->queue_size = queue_size;
- av_log(s->st ? s->st->codec : NULL, AV_LOG_VERBOSE,
- "setting jitter buffer size to %d\n", s->queue_size);
+ av_log(s->ic, AV_LOG_VERBOSE, "setting jitter buffer size to %d\n",
+ s->queue_size);
rtp_init_statistics(&s->statistics, 0);
if (st) {
@@ -623,7 +622,7 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt,
st = s->st;
// only do something with this if all the rtp checks pass...
if (!rtp_valid_packet_in_sequence(&s->statistics, seq)) {
- av_log(st ? st->codec : NULL, AV_LOG_ERROR,
+ av_log(s->ic, AV_LOG_ERROR,
"RTP: PT=%02x: bad cseq %04x expected=%04x\n",
payload_type, seq, ((s->seq + 1) & 0xffff));
return -1;
@@ -737,7 +736,7 @@ static int rtp_parse_queued_packet(RTPDemuxContext *s, AVPacket *pkt)
return -1;
if (!has_next_packet(s))
- av_log(s->st ? s->st->codec : NULL, AV_LOG_WARNING,
+ av_log(s->ic, AV_LOG_WARNING,
"RTP: missed %d packets\n", s->queue->seq - s->seq - 1);
/* Parse the first packet in the queue, and dequeue it */
@@ -804,7 +803,7 @@ static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt,
int16_t diff = seq - s->seq;
if (diff < 0) {
/* Packet older than the previously emitted one, drop */
- av_log(s->st ? s->st->codec : NULL, AV_LOG_WARNING,
+ av_log(s->ic, AV_LOG_WARNING,
"RTP: dropping old packet received too late\n");
return -1;
} else if (diff <= 1) {
@@ -820,8 +819,7 @@ static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt,
/* Return the first enqueued packet if the queue is full,
* even if we're missing something */
if (s->queue_len >= s->queue_size) {
- av_log(s->st ? s->st->codec : NULL, AV_LOG_WARNING,
- "jitter buffer full\n");
+ av_log(s->ic, AV_LOG_WARNING, "jitter buffer full\n");
return rtp_parse_queued_packet(s, pkt);
}
return -1;
@@ -871,7 +869,7 @@ int ff_parse_fmtp(AVFormatContext *s,
int value_size = strlen(p) + 1;
if (!(value = av_malloc(value_size))) {
- av_log(NULL, AV_LOG_ERROR, "Failed to allocate data for FMTP.\n");
+ av_log(s, AV_LOG_ERROR, "Failed to allocate data for FMTP.\n");
return AVERROR(ENOMEM);
}