samples_size = wanted_size;
}
}
-#if 0
- printf("diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n",
- diff, avg_diff, samples_size - samples_size1,
- is->audio_clock, is->video_clock, is->audio_diff_threshold);
-#endif
+ av_dlog(NULL, "diff=%f adiff=%f sample_diff=%d apts=%0.3f vpts=%0.3f %f\n",
+ diff, avg_diff, samples_size - samples_size1,
+ is->audio_clock, is->video_clock, is->audio_diff_threshold);
}
} else {
/* too big difference : may be initial PTS errors, so
index = 62; /* value 63 is not allowed */
}
-#if 0
- printf("%2d:%d in=%x %x %d\n",
- j, i, vmax, scale_factor_table[index], index);
-#endif
+ av_dlog(NULL, "%2d:%d in=%x %x %d\n",
+ j, i, vmax, scale_factor_table[index], index);
/* store the scale factor */
assert(index >=0 && index <= 63);
sf[i] = index;
code = 0; /* kill warning */
}
-#if 0
- printf("%d: %2d %2d %2d %d %d -> %d\n", j,
- sf[0], sf[1], sf[2], d1, d2, code);
-#endif
+ av_dlog(NULL, "%d: %2d %2d %2d %d %d -> %d\n", j,
+ sf[0], sf[1], sf[2], d1, d2, code);
scale_code[j] = code;
sf += 3;
}
}
}
}
-#if 0
- printf("current=%d max=%d max_sb=%d alloc=%d\n",
- current_frame_size, max_frame_size, max_sb,
- bit_alloc[max_sb]);
-#endif
+ av_dlog(NULL, "current=%d max=%d max_sb=%d alloc=%d\n",
+ current_frame_size, max_frame_size, max_sb,
+ bit_alloc[max_sb]);
if (max_sb < 0)
break;
to have the full timing information. The time take by this
function should be negligible for uncorrupted streams */
mpegvideo_extract_headers(s, avctx, buf, buf_size);
-#if 0
- printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",
- s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict);
-#endif
+ av_dlog(NULL, "pict_type=%d frame_rate=%0.3f repeat_pict=%d\n",
+ s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict);
*poutbuf = buf;
*poutbuf_size = buf_size;
*/
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
{
-#if 0
if(pc->overread){
- printf("overread %d, state:%X next:%d index:%d o_index:%d\n", pc->overread, pc->state, next, pc->index, pc->overread_index);
- printf("%X %X %X %X\n", (*buf)[0], (*buf)[1],(*buf)[2],(*buf)[3]);
+ av_dlog(pc, "overread %d, state:%X next:%d index:%d o_index:%d\n",
+ pc->overread, pc->state, next, pc->index, pc->overread_index);
+ av_dlog(pc, "%X %X %X %X\n", (*buf)[0], (*buf)[1], (*buf)[2], (*buf)[3]);
}
-#endif
/* Copy overread bytes from last frame into buffer. */
for(; pc->overread>0; pc->overread--){
ioctl(video_fd, VIDIOCSAUDIO, &audio);
ioctl(video_fd, VIDIOCGPICT, &pict);
-#if 0
- printf("v4l: colour=%d hue=%d brightness=%d constrast=%d whiteness=%d\n",
- pict.colour,
- pict.hue,
- pict.brightness,
- pict.contrast,
- pict.whiteness);
-#endif
+ av_dlog(s1, "v4l: colour=%d hue=%d brightness=%d constrast=%d whiteness=%d\n",
+ pict.colour, pict.hue, pict.brightness, pict.contrast, pict.whiteness);
/* try to choose a suitable video format */
pict.palette = desired_palette;
pict.depth= desired_depth;
pkt->dts = dts;
pkt->pos = dummy_pos;
pkt->stream_index = st->index;
-#if 0
- av_log(s, AV_LOG_DEBUG, "%d: pts=%0.3f dts=%0.3f size=%d\n",
- pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0, pkt->size);
-#endif
+ av_dlog(s, AV_LOG_DEBUG, "%d: pts=%0.3f dts=%0.3f size=%d\n",
+ pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0,
+ pkt->size);
return 0;
}
id = stream->id;
-#if 0
- printf("packet ID=%2x PTS=%0.3f\n",
- id, pts / 90000.0);
-#endif
+ av_dlog(ctx, "packet ID=%2x PTS=%0.3f\n", id, pts / 90000.0);
buf_ptr = buffer;
best_dts= pkt_desc->dts;
}
-#if 0
- av_log(ctx, AV_LOG_DEBUG, "bumping scr, scr:%f, dts:%f\n",
- scr/90000.0, best_dts/90000.0);
-#endif
+ av_dlog(ctx, AV_LOG_DEBUG, "bumping scr, scr:%f, dts:%f\n",
+ scr / 90000.0, best_dts / 90000.0);
if(best_dts == INT64_MAX)
return 0;
s->bit_rate = (TS_PACKET_SIZE * 8) * 27e6 / ts->pcr_incr;
st->codec->bit_rate = s->bit_rate;
st->start_time = ts->cur_pcr;
-#if 0
- av_log(ts->stream, AV_LOG_DEBUG, "start=%0.3f pcr=%0.3f incr=%d\n",
- st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr);
-#endif
+ av_dlog(ts->stream, AV_LOG_DEBUG, "start=%0.3f pcr=%0.3f incr=%d\n",
+ st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr);
}
avio_seek(pb, pos, SEEK_SET);
int complete = 0;
int segp = 0, psize = 0;
-#if 0
- av_log (s, AV_LOG_DEBUG, "ogg_packet: curidx=%i\n", ogg->curidx);
-#endif
+ av_dlog(s, AV_LOG_DEBUG, "ogg_packet: curidx=%i\n", ogg->curidx);
do{
idx = ogg->curidx;
os = ogg->streams + idx;
-#if 0
- av_log (s, AV_LOG_DEBUG,
+ av_dlog(s, AV_LOG_DEBUG,
"ogg_packet: idx=%d pstart=%d psize=%d segp=%d nsegs=%d\n",
idx, os->pstart, os->psize, os->segp, os->nsegs);
-#endif
if (!os->codec){
if (os->header < 0){
}
}while (!complete);
-#if 0
- av_log (s, AV_LOG_DEBUG,
+ av_dlog(s, AV_LOG_DEBUG,
"ogg_packet: idx %i, frame size %i, start %i\n",
idx, os->psize, os->pstart);
-#endif
if (os->granule == -1)
av_log(s, AV_LOG_WARNING, "Page at %"PRId64" is missing granule\n", os->page_pos);
return -1;
}while (!ogg->headers);
-#if 0
- av_log (s, AV_LOG_DEBUG, "found headers\n");
-#endif
+ av_dlog(s, AV_LOG_DEBUG, "found headers\n");
return 0;
}
tag = avio_rl32(pb);
tag_size = avio_rb32(pb);
avio_rb16(pb);
-#if 0
- printf("tag=%c%c%c%c (%08x) size=%d\n",
- (tag) & 0xff,
- (tag >> 8) & 0xff,
- (tag >> 16) & 0xff,
- (tag >> 24) & 0xff,
- tag,
- tag_size);
-#endif
+ av_dlog(s, "tag=%c%c%c%c (%08x) size=%d\n",
+ (tag ) & 0xff,
+ (tag >> 8) & 0xff,
+ (tag >> 16) & 0xff,
+ (tag >> 24) & 0xff,
+ tag,
+ tag_size);
if (tag_size < 10 && tag != MKTAG('D', 'A', 'T', 'A'))
return -1;
switch(tag) {
}
av_update_stream_timings(ic);
-#if 0
{
int i;
AVStream *st;
for(i = 0;i < ic->nb_streams; i++) {
st = ic->streams[i];
- printf("%d: start_time: %0.3f duration: %0.3f\n",
- i, (double)st->start_time / AV_TIME_BASE,
- (double)st->duration / AV_TIME_BASE);
+ av_dlog(ic, "%d: start_time: %0.3f duration: %0.3f\n", i,
+ (double) st->start_time / AV_TIME_BASE,
+ (double) st->duration / AV_TIME_BASE);
}
- printf("stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
- (double)ic->start_time / AV_TIME_BASE,
- (double)ic->duration / AV_TIME_BASE,
- ic->bit_rate / 1000);
+ av_dlog(ic, "stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
+ (double) ic->start_time / AV_TIME_BASE,
+ (double) ic->duration / AV_TIME_BASE,
+ ic->bit_rate / 1000);
}
-#endif
}
static int has_codec_parameters(AVCodecContext *enc)