[FFmpeg-cvslog] r14211 - in trunk/libavformat: rtpdec.c rtpenc.c

mru subversion
Sun Jul 13 21:41:11 CEST 2008


Author: mru
Date: Sun Jul 13 21:41:10 2008
New Revision: 14211

Log:
RTP: use dprintf(), allow compilation with -DDEBUG

Modified:
   trunk/libavformat/rtpdec.c
   trunk/libavformat/rtpenc.c

Modified: trunk/libavformat/rtpdec.c
==============================================================================
--- trunk/libavformat/rtpdec.c	(original)
+++ trunk/libavformat/rtpdec.c	Sun Jul 13 21:41:10 2008
@@ -250,13 +250,9 @@ int rtp_check_and_send_back_rr(RTPDemuxC
     len = url_close_dyn_buf(pb, &buf);
     if ((len > 0) && buf) {
         int result;
-#if defined(DEBUG)
-        printf("sending %d bytes of RR\n", len);
-#endif
+        dprintf(s->ic, "sending %d bytes of RR\n", len);
         result= url_write(s->rtp_ctx, buf, len);
-#if defined(DEBUG)
-        printf("result from url_write: %d\n", result);
-#endif
+        dprintf(s->ic, "result from url_write: %d\n", result);
         av_free(buf);
     }
     return 0;

Modified: trunk/libavformat/rtpenc.c
==============================================================================
--- trunk/libavformat/rtpenc.c	(original)
+++ trunk/libavformat/rtpenc.c	Sun Jul 13 21:41:10 2008
@@ -120,9 +120,7 @@ static void rtcp_send_sr(AVFormatContext
     RTPDemuxContext *s = s1->priv_data;
     uint32_t rtp_ts;
 
-#if defined(DEBUG)
-    printf("RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp);
-#endif
+    dprintf(s1, "RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp);
 
     if (s->first_rtcp_ntp_time == AV_NOPTS_VALUE) s->first_rtcp_ntp_time = ntp_time;
     s->last_rtcp_ntp_time = ntp_time;
@@ -146,9 +144,7 @@ void ff_rtp_send_data(AVFormatContext *s
 {
     RTPDemuxContext *s = s1->priv_data;
 
-#ifdef DEBUG
-    printf("rtp_send_data size=%d\n", len);
-#endif
+    dprintf(s1, "rtp_send_data size=%d\n", len);
 
     /* build the RTP header */
     put_byte(s1->pb, (RTP_VERSION << 6));
@@ -301,9 +297,7 @@ static int rtp_write_packet(AVFormatCont
     int size= pkt->size;
     uint8_t *buf1= pkt->data;
 
-#ifdef DEBUG
-    printf("%d: write len=%d\n", pkt->stream_index, size);
-#endif
+    dprintf(s1, "%d: write len=%d\n", pkt->stream_index, size);
 
     rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) /
         RTCP_TX_RATIO_DEN;




More information about the ffmpeg-cvslog mailing list