changeset 986:f5194ed612b5 libavformat

fix debug code: do not try to take st->codec if st is NULL. This makes ffplay give me pics from FreeBoxTV \o/
author mmu_man
date Wed, 01 Mar 2006 22:45:27 +0000
parents 7f8b1a1ac020
children 955d23ed733f
files rtp.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rtp.c	Wed Mar 01 20:09:44 2006 +0000
+++ b/rtp.c	Wed Mar 01 22:45:27 2006 +0000
@@ -402,9 +402,11 @@
     /* NOTE: we can handle only one payload type */
     if (s->payload_type != payload_type)
         return -1;
+
+    st = s->st;
 #if defined(DEBUG) || 1
     if (seq != ((s->seq + 1) & 0xffff)) {
-        av_log(s->st->codec, AV_LOG_ERROR, "RTP: PT=%02x: bad cseq %04x expected=%04x\n",
+        av_log(st?st->codec:NULL, AV_LOG_ERROR, "RTP: PT=%02x: bad cseq %04x expected=%04x\n",
                payload_type, seq, ((s->seq + 1) & 0xffff));
     }
 #endif
@@ -412,7 +414,6 @@
     len -= 12;
     buf += 12;
 
-    st = s->st;
     if (!st) {
         /* specific MPEG2TS demux support */
         ret = mpegts_parse_packet(s->ts, pkt, buf, len);