---
 libavformat/rtpdec.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 823e03c..7d27da2 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -514,17 +514,17 @@ 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,
+    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) {
-        switch (st->codec->codec_id) {
+        switch (st->codecpar->codec_id) {
         case AV_CODEC_ID_ADPCM_G722:
             /* According to RFC 3551, the stream clock rate is 8000
              * even if the sample rate is 16000. */
-            if (st->codec->sample_rate == 8000)
-                st->codec->sample_rate = 16000;
+            if (st->codecpar->sample_rate == 8000)
+                st->codecpar->sample_rate = 16000;
             break;
         default:
             break;
@@ -616,7 +616,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;
@@ -730,7 +730,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 */
@@ -797,7 +797,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) {
@@ -813,7 +813,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,
+                av_log(s->ic, AV_LOG_WARNING,
                        "jitter buffer full\n");
                 return rtp_parse_queued_packet(s, pkt);
             }
-- 
2.0.0

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to