comparison dvbsub_parser.c @ 9999:c78fd9154378 libavcodec

Change av_log() calls surrounded by '#ifdef DEBUG' into dprintf macros.
author diego
date Thu, 30 Jul 2009 21:00:08 +0000
parents 0dce4fe6e6f3
children
comparison
equal deleted inserted replaced
9998:6b229807a182 9999:c78fd9154378
53 { 53 {
54 DVBSubParseContext *pc = s->priv_data; 54 DVBSubParseContext *pc = s->priv_data;
55 uint8_t *p, *p_end; 55 uint8_t *p, *p_end;
56 int len, buf_pos = 0; 56 int len, buf_pos = 0;
57 57
58 #ifdef DEBUG 58 dprintf(avctx, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
59 av_log(avctx, AV_LOG_INFO, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
60 s->pts, s->last_pts, s->cur_frame_pts[s->cur_frame_start_index]); 59 s->pts, s->last_pts, s->cur_frame_pts[s->cur_frame_start_index]);
61 #endif
62 60
63 #ifdef DEBUG_PACKET_CONTENTS 61 #ifdef DEBUG_PACKET_CONTENTS
64 int i; 62 int i;
65 63
66 for (i=0; i < buf_size; i++) 64 for (i=0; i < buf_size; i++)
82 80
83 if (s->last_pts != s->pts && s->pts != AV_NOPTS_VALUE) /* Start of a new packet */ 81 if (s->last_pts != s->pts && s->pts != AV_NOPTS_VALUE) /* Start of a new packet */
84 { 82 {
85 if (pc->packet_index != pc->packet_start) 83 if (pc->packet_index != pc->packet_start)
86 { 84 {
87 #ifdef DEBUG 85 dprintf(avctx, "Discarding %d bytes\n",
88 av_log(avctx, AV_LOG_INFO, "Discarding %d bytes\n", 86 pc->packet_index - pc->packet_start);
89 pc->packet_index - pc->packet_start);
90 #endif
91 } 87 }
92 88
93 pc->packet_start = 0; 89 pc->packet_start = 0;
94 pc->packet_index = 0; 90 pc->packet_index = 0;
95 91
96 if (buf_size < 2 || buf[0] != 0x20 || buf[1] != 0x00) { 92 if (buf_size < 2 || buf[0] != 0x20 || buf[1] != 0x00) {
97 #ifdef DEBUG 93 dprintf(avctx, "Bad packet header\n");
98 av_log(avctx, AV_LOG_INFO, "Bad packet header\n");
99 #endif
100 return -1; 94 return -1;
101 } 95 }
102 96
103 buf_pos = 2; 97 buf_pos = 2;
104 98
151 } else 145 } else
152 break; 146 break;
153 } else if (*p == 0xff) { 147 } else if (*p == 0xff) {
154 if (p + 1 < p_end) 148 if (p + 1 < p_end)
155 { 149 {
156 #ifdef DEBUG 150 dprintf(avctx, "Junk at end of packet\n");
157 av_log(avctx, AV_LOG_INFO, "Junk at end of packet\n");
158 #endif
159 } 151 }
160 pc->packet_index = p - pc->packet_buf; 152 pc->packet_index = p - pc->packet_buf;
161 pc->in_packet = 0; 153 pc->in_packet = 0;
162 break; 154 break;
163 } else { 155 } else {