diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-01 15:51:40 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-01 16:12:38 +0200 |
commit | 31ab1575e59e33957864d1bdf13253f8d366ccba (patch) | |
tree | 074dd6605a3d7e0a42b6cd12d2f071fe25d3d25a /libavformat | |
parent | adc5539e7b94a94114d591d83e7ae63f52b5916f (diff) | |
parent | 1218777ffd152287244349d4ff9e1cbc84fa2c54 (diff) | |
download | ffmpeg-31ab1575e59e33957864d1bdf13253f8d366ccba.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
avcodec: Convert some commented-out printf/av_log instances to av_dlog
avcodec: Drop silly and/or broken printf debug output
avcodec: Drop some silly commented-out av_log() invocations
avformat: Convert some commented-out printf/av_log instances to av_dlog
avformat: Remove non-compiling and/or silly commented-out printf/av_log statements
Remove some silly disabled code.
ac3dec: ensure get_buffer() gets a buffer for the correct number of channels
Conflicts:
libavcodec/dnxhddec.c
libavcodec/ffv1.c
libavcodec/h264.c
libavcodec/h264_parser.c
libavcodec/mjpegdec.c
libavcodec/motion_est_template.c
libavcodec/mpegaudiodec.c
libavcodec/mpegvideo_enc.c
libavcodec/put_bits.h
libavcodec/ratecontrol.c
libavcodec/wmaenc.c
libavdevice/timefilter.c
libavformat/asfdec.c
libavformat/avidec.c
libavformat/avienc.c
libavformat/flvenc.c
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/asfdec.c | 49 | ||||
-rw-r--r-- | libavformat/assdec.c | 2 | ||||
-rw-r--r-- | libavformat/avidec.c | 24 | ||||
-rw-r--r-- | libavformat/ffmdec.c | 3 | ||||
-rw-r--r-- | libavformat/flvenc.c | 3 | ||||
-rw-r--r-- | libavformat/h263dec.c | 2 | ||||
-rw-r--r-- | libavformat/movenc.c | 1 | ||||
-rw-r--r-- | libavformat/mpeg.c | 2 | ||||
-rw-r--r-- | libavformat/mpegenc.c | 9 | ||||
-rw-r--r-- | libavformat/mpegts.c | 6 | ||||
-rw-r--r-- | libavformat/mpegtsenc.c | 2 | ||||
-rw-r--r-- | libavformat/mxfenc.c | 2 | ||||
-rw-r--r-- | libavformat/nutenc.c | 4 | ||||
-rw-r--r-- | libavformat/rmdec.c | 5 | ||||
-rw-r--r-- | libavformat/rtsp.c | 2 | ||||
-rw-r--r-- | libavformat/swfdec.c | 1 | ||||
-rw-r--r-- | libavformat/utils.c | 11 |
17 files changed, 56 insertions, 72 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index b1b8eeb303..b58cf28064 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -21,6 +21,7 @@ //#define DEBUG +#include "libavutil/attributes.h" #include "libavutil/bswap.h" #include "libavutil/common.h" #include "libavutil/avstring.h" @@ -420,9 +421,6 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) avio_rl16(pb); //ds_data_size avio_r8(pb); //ds_silence_data } - //printf("Descrambling: ps:%d cs:%d ds:%d s:%d sd:%d\n", - // asf_st->ds_packet_size, asf_st->ds_chunk_size, - // asf_st->ds_data_size, asf_st->ds_span, asf_st->ds_silence_data); if (asf_st->ds_span > 1) { if (!asf_st->ds_chunk_size || (asf_st->ds_packet_size/asf_st->ds_chunk_size <= 1) @@ -443,7 +441,6 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) st->codec->bits_per_coded_sample = avio_rl16(pb); /* depth */ tag1 = avio_rl32(pb); avio_skip(pb, 20); - // av_log(s, AV_LOG_DEBUG, "size:%d tsize:%d sizeX:%d\n", size, total_size, sizeX); if (sizeX > 40) { st->codec->extradata_size = sizeX - 40; st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); @@ -614,16 +611,18 @@ static int asf_read_metadata(AVFormatContext *s, int64_t size) for(i=0;i<n;i++) { char name[1024]; + int av_unused value_type; avio_rl16(pb); //lang_list_index stream_num= avio_rl16(pb); name_len= avio_rl16(pb); - avio_skip(pb, 2); /* value_type */ + value_type = avio_rl16(pb); /* value_type */ value_len= avio_rl32(pb); if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len) avio_skip(pb, name_len - ret); - //av_log(s, AV_LOG_ERROR, "%d %d %d %d %d <%s>\n", i, stream_num, name_len, value_type, value_len, name); + av_dlog(s, "%d %d %d %d %d <%s>\n", + i, stream_num, name_len, value_type, value_len, name); value_num= avio_rl16(pb);//we should use get_value() here but it does not work 2 is le16 here but le32 elsewhere avio_skip(pb, value_len - 2); @@ -689,9 +688,7 @@ static int asf_read_header(AVFormatContext *s) uint64_t gpos= avio_tell(pb); ff_get_guid(pb, &g); gsize = avio_rl64(pb); - av_dlog(s, "%08"PRIx64": ", gpos); print_guid(&g); - av_dlog(s, " size=0x%"PRIx64"\n", gsize); if (!ff_guidcmp(&g, &ff_asf_data_header)) { asf->data_object_offset = avio_tell(pb); // if not streaming, gsize is not unlimited (how?), and there is enough space in the file.. @@ -784,7 +781,9 @@ static int asf_read_header(AVFormatContext *s) &st->sample_aspect_ratio.num, asf->dar[0].num, asf->dar[0].den, INT_MAX); -//av_log(s, AV_LOG_INFO, "i=%d, st->codec->codec_type:%d, dar %d:%d sar=%d:%d\n", i, st->codec->codec_type, dar[i].num, dar[i].den, st->sample_aspect_ratio.num, st->sample_aspect_ratio.den); + av_dlog(s, "i=%d, st->codec->codec_type:%d, asf->dar %d:%d sar=%d:%d\n", + i, st->codec->codec_type, asf->dar[i].num, asf->dar[i].den, + st->sample_aspect_ratio.num, st->sample_aspect_ratio.den); // copy and convert language codes to the frontend if (asf->streams[i].stream_language_index < 128) { @@ -926,7 +925,9 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){ DO_2BITS(asf->packet_property >> 4, asf->packet_seq, 0); DO_2BITS(asf->packet_property >> 2, asf->packet_frag_offset, 0); DO_2BITS(asf->packet_property, asf->packet_replic_size, 0); -//printf("key:%d stream:%d seq:%d offset:%d replic_size:%d\n", asf->packet_key_frame, asf->stream_index, asf->packet_seq, //asf->packet_frag_offset, asf->packet_replic_size); + av_dlog(asf, "key:%d stream:%d seq:%d offset:%d replic_size:%d\n", + asf->packet_key_frame, asf->stream_index, asf->packet_seq, + asf->packet_frag_offset, asf->packet_replic_size); if (rsize+asf->packet_replic_size > asf->packet_size_left) { av_log(s, AV_LOG_ERROR, "packet_replic_size %d is invalid\n", asf->packet_replic_size); return AVERROR_INVALIDDATA; @@ -939,9 +940,6 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){ } asf->packet_frag_timestamp = avio_rl32(pb); // timestamp if(asf->packet_replic_size >= 8+38+4){ -// for(i=0; i<asf->packet_replic_size-8; i++) -// av_log(s, AV_LOG_DEBUG, "%02X ",avio_r8(pb)); -// av_log(s, AV_LOG_DEBUG, "\n"); avio_skip(pb, 10); ts0= avio_rl64(pb); ts1= avio_rl64(pb); @@ -980,10 +978,8 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){ asf->packet_padsize -= diff; } } - //printf("Fragsize %d\n", asf->packet_frag_size); } else { asf->packet_frag_size = asf->packet_size_left - rsize; - //printf("Using rest %d %d %d\n", asf->packet_frag_size, asf->packet_size_left, rsize); } if (asf->packet_replic_size == 1) { asf->packet_multi_size = asf->packet_frag_size; @@ -991,7 +987,6 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){ return AVERROR_INVALIDDATA; } asf->packet_size_left -= rsize; - //printf("___objsize____ %d %d rs:%d\n", asf->packet_obj_size, asf->packet_frag_offset, rsize); return 0; } @@ -1017,7 +1012,6 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk || asf->packet_segments < 1) { //asf->packet_size_left <= asf->packet_padsize) { int ret = asf->packet_size_left + asf->packet_padsize; - //printf("PacketLeftSize:%d Pad:%d Pos:%"PRId64"\n", asf->packet_size_left, asf->packet_padsize, avio_tell(pb)); assert(ret>=0); /* fail safe */ avio_skip(pb, ret); @@ -1064,7 +1058,6 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk continue; } asf->packet_multi_size -= asf->packet_obj_size; - //printf("COMPRESS size %d %d %d ms:%d\n", asf->packet_obj_size, asf->packet_frag_timestamp, asf->packet_size_left, asf->packet_multi_size); } if( /*asf->packet_frag_size == asf->packet_obj_size*/ asf_st->frag_offset + asf->packet_frag_size <= asf_st->pkt.size @@ -1100,9 +1093,11 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk asf_st->palette_changed = 0; } } -//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n", -//asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & AV_PKT_FLAG_KEY, -//s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO, asf->packet_obj_size); + av_dlog(asf, "new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n", + asf->stream_index, asf->packet_key_frame, + asf_st->pkt.flags & AV_PKT_FLAG_KEY, + s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO, + asf->packet_obj_size); if (s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO) asf->packet_key_frame = 1; if (asf->packet_key_frame) @@ -1110,9 +1105,9 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk } /* read data */ - //printf("READ PACKET s:%d os:%d o:%d,%d l:%d DATA:%p\n", - // s->packet_size, asf_st->pkt.size, asf->packet_frag_offset, - // asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data); + av_dlog(asf, "READ PACKET s:%d os:%d o:%d,%d l:%d DATA:%p\n", + s->packet_size, asf_st->pkt.size, asf->packet_frag_offset, + asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data); asf->packet_size_left -= asf->packet_frag_size; if (asf->packet_size_left < 0) continue; @@ -1174,8 +1169,6 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk int row = off / asf_st->ds_span; int col = off % asf_st->ds_span; int idx = row + col * asf_st->ds_packet_size / asf_st->ds_chunk_size; - //printf("off:%d row:%d col:%d idx:%d\n", off, row, col, idx); - assert(offset + asf_st->ds_chunk_size <= asf_st->pkt.size); assert(idx+1 <= asf_st->pkt.size / asf_st->ds_chunk_size); memcpy(newdata + offset, @@ -1190,7 +1183,6 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk } asf_st->frag_offset = 0; *pkt= asf_st->pkt; - //printf("packet %d %d\n", asf_st->pkt.size, asf->packet_frag_size); asf_st->pkt.size = 0; asf_st->pkt.data = 0; asf_st->pkt.side_data_elems = 0; @@ -1280,7 +1272,6 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, if (avio_seek(s->pb, pos, SEEK_SET) < 0) return AV_NOPTS_VALUE; -//printf("asf_read_pts\n"); asf_reset_header(s); for(;;){ if (av_read_frame(s, pkt) < 0){ @@ -1308,8 +1299,6 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, } *ppos= pos; -//printf("found keyframe at %"PRId64" stream %d stamp:%"PRId64"\n", *ppos, stream_index, pts); - return pts; } diff --git a/libavformat/assdec.c b/libavformat/assdec.c index 687869107c..835fd8a55d 100644 --- a/libavformat/assdec.c +++ b/libavformat/assdec.c @@ -60,7 +60,7 @@ static int64_t get_pts(const uint8_t *p) if(sscanf(p, "%*[^,],%d:%d:%d%*c%d", &hour, &min, &sec, &hsec) != 4) return AV_NOPTS_VALUE; -// av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d [%s]\n", i, hour, min, sec, hsec, p); + av_dlog(NULL, "%d %d %d %d [%s]\n", hour, min, sec, hsec, p); min+= 60*hour; sec+= 60*min; diff --git a/libavformat/avidec.c b/libavformat/avidec.c index de945829f4..b4c5fe8d0c 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -545,7 +545,8 @@ static int avi_read_header(AVFormatContext *s) } ast->sample_size = avio_rl32(pb); /* sample ssize */ ast->cum_len *= FFMAX(1, ast->sample_size); -// av_log(s, AV_LOG_DEBUG, "%d %d %d %d\n", ast->rate, ast->scale, ast->start, ast->sample_size); + av_dlog(s, "%"PRIu32" %"PRIu32" %d\n", + ast->rate, ast->scale, ast->sample_size); switch(tag1) { case MKTAG('v', 'i', 'd', 's'): @@ -743,7 +744,9 @@ static int avi_read_header(AVFormatContext *s) if(active_aspect.num && active_aspect.den && active.num && active.den){ st->sample_aspect_ratio= av_div_q(active_aspect, active); -//av_log(s, AV_LOG_ERROR, "vprp %d/%d %d/%d\n", active_aspect.num, active_aspect.den, active.num, active.den); + av_dlog(s, "vprp %d/%d %d/%d\n", + active_aspect.num, active_aspect.den, + active.num, active.den); } size -= 9*4; } @@ -921,7 +924,8 @@ start_sync: size= d[4] + (d[5]<<8) + (d[6]<<16) + (d[7]<<24); n= get_stream_idx(d+2); -//av_log(s, AV_LOG_DEBUG, "%X %X %X %X %X %X %X %X %"PRId64" %d %d\n", d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], i, size, n); + av_dlog(s, "%X %X %X %X %X %X %X %X %"PRId64" %u %d\n", + d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], i, size, n); if(i + (uint64_t)size > avi->fsize || d[0] > 127) continue; @@ -931,7 +935,6 @@ start_sync: ||(d[0] == 'J' && d[1] == 'U' && d[2] == 'N' && d[3] == 'K') ||(d[0] == 'i' && d[1] == 'd' && d[2] == 'x' && d[3] == '1')){ avio_skip(pb, size); -//av_log(s, AV_LOG_DEBUG, "SKIP\n"); goto start_sync; } @@ -1010,7 +1013,6 @@ start_sync: if (exit_early) return 0; -//av_log(s, AV_LOG_DEBUG, "OK\n"); if(d[2]*256+d[3] == ast->prefix) ast->prefix_count++; else{ @@ -1073,7 +1075,8 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt) ts = av_rescale_q(ts, st->time_base, (AVRational){FFMAX(1, ast->sample_size), AV_TIME_BASE}); -// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d/%d %"PRId64"\n", ts, st->time_base.num, st->time_base.den, ast->frame_offset); + av_dlog(s, "%"PRId64" %d/%d %"PRId64"\n", ts, + st->time_base.num, st->time_base.den, ast->frame_offset); if(ts < best_ts){ best_ts= ts; best_st= st; @@ -1093,13 +1096,11 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt) best_ast->frame_offset= best_st->index_entries[i].timestamp; } -// av_log(s, AV_LOG_DEBUG, "%d\n", i); if(i>=0){ int64_t pos= best_st->index_entries[i].pos; pos += best_ast->packet_size - best_ast->remaining; if(avio_seek(s->pb, pos + 8, SEEK_SET) < 0) return AVERROR_EOF; -// av_log(s, AV_LOG_DEBUG, "pos=%"PRId64"\n", pos); av_assert0(best_ast->remaining <= best_ast->packet_size); @@ -1168,7 +1169,9 @@ resync: // pkt->dts += ast->start; if(ast->sample_size) pkt->dts /= ast->sample_size; -//av_log(s, AV_LOG_DEBUG, "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d base:%d st:%d size:%d\n", pkt->dts, ast->frame_offset, ast->scale, ast->rate, ast->sample_size, AV_TIME_BASE, avi->stream_index, size); + av_dlog(s, "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d base:%d st:%d size:%d\n", + pkt->dts, ast->frame_offset, ast->scale, ast->rate, + ast->sample_size, AV_TIME_BASE, avi->stream_index, size); pkt->stream_index = avi->stream_index; if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { @@ -1457,7 +1460,8 @@ static int avi_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp pos = st->index_entries[index].pos; timestamp = st->index_entries[index].timestamp / FFMAX(ast->sample_size, 1); -// av_log(s, AV_LOG_DEBUG, "XX %"PRId64" %d %"PRId64"\n", timestamp, index, st->index_entries[index].timestamp); + av_dlog(s, "XX %"PRId64" %d %"PRId64"\n", + timestamp, index, st->index_entries[index].timestamp); if (CONFIG_DV_DEMUXER && avi->dv_demux) { /* One and only one real stream for DV in AVI, and it has video */ diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index df9ac8d9fc..c6d9fab9cf 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -246,9 +246,6 @@ static void adjust_write_index(AVFormatContext *s) ffm->write_index += pos_max; } - //printf("Adjusted write index from %"PRId64" to %"PRId64": pts=%0.6f\n", orig_write_index, ffm->write_index, pts / 1000000.); - //printf("pts range %0.6f - %0.6f\n", get_dts(s, 0) / 1000000. , get_dts(s, ffm->file_size - 2 * FFM_PACKET_SIZE) / 1000000. ); - end: avio_seek(pb, ptr, SEEK_SET); } diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 97c00bf79e..c528bf5bef 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -446,9 +446,6 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) uint8_t *data = NULL; int flags = -1, flags_size, ret; - av_dlog(s, "type:%s pts:%"PRId64" dts:%"PRId64" size:%d\n", - av_get_media_type_string(enc->codec_type), pkt->pts, pkt->dts, size); - if (enc->codec_id == AV_CODEC_ID_VP6 || enc->codec_id == AV_CODEC_ID_VP6F || enc->codec_id == AV_CODEC_ID_VP6A || enc->codec_id == AV_CODEC_ID_AAC) flags_size = 2; diff --git a/libavformat/h263dec.c b/libavformat/h263dec.c index 8afacad8b7..667fdbdcbb 100644 --- a/libavformat/h263dec.c +++ b/libavformat/h263dec.c @@ -55,8 +55,6 @@ static int h263_probe(AVProbeData *p) last_gn= gn; } } -//av_log(NULL, AV_LOG_ERROR, "h263_probe: psc:%d invalid:%d res_change:%d\n", valid_psc, invalid_psc, res_change); -//h263_probe: psc:3 invalid:0 res_change:0 (1588/recent_ffmpeg_parses_mpg_incorrectly.mpg) if(valid_psc > 2*invalid_psc + 2*res_change + 3){ return 50; }else if(valid_psc > 2*invalid_psc) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index ded2859719..6de5306c0b 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2196,7 +2196,6 @@ static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s) mov_write_psp_udta_tag(pb, LIBAVCODEC_IDENT, "eng", 0x04); mov_write_psp_udta_tag(pb, title->value, "eng", 0x01); -// snprintf(dt,32,"%04d/%02d/%02d %02d:%02d:%02d",t_st->tm_year+1900,t_st->tm_mon+1,t_st->tm_mday,t_st->tm_hour,t_st->tm_min,t_st->tm_sec); mov_write_psp_udta_tag(pb, "2006/04/01 11:11:11", "und", 0x03); update_size(pb, pos2); diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 54125ae9a2..22e7869961 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -85,7 +85,6 @@ static int mpegps_probe(AVProbeData *p) if(vid+audio > invalid+1) /* invalid VDR files nd short PES streams */ score= AVPROBE_SCORE_MAX/4; -//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d %d %d len:%d\n", sys, priv1, pspack,vid, audio, invalid, p->buf_size); if(sys>invalid && sys*9 <= pspack*10) return (audio > 12 || vid > 3 || pspack > 2) ? AVPROBE_SCORE_MAX/2+2 : AVPROBE_SCORE_MAX/4; // +1 for .mpg if(pspack > invalid && (priv1+vid+audio)*10 >= pspack*9) @@ -223,7 +222,6 @@ static int mpegps_read_pes_header(AVFormatContext *s, size = MAX_SYNC_SIZE; startcode = find_next_start_code(s->pb, &size, &m->header_state); last_sync = avio_tell(s->pb); - //printf("startcode=%x pos=0x%"PRIx64"\n", startcode, avio_tell(s->pb)); if (startcode < 0){ if(url_feof(s->pb)) return AVERROR_EOF; diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 28e652551b..e2a96bc631 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -1006,7 +1006,10 @@ retry: } if(timestamp_packet){ -//av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f scr:%f stream:%d\n", timestamp_packet->dts/90000.0, timestamp_packet->pts/90000.0, scr/90000.0, best_i); + av_dlog(ctx, "dts:%f pts:%f scr:%f stream:%d\n", + timestamp_packet->dts / 90000.0, + timestamp_packet->pts / 90000.0, + scr / 90000.0, best_i); es_size= flush_packet(ctx, best_i, timestamp_packet->pts, timestamp_packet->dts, scr, trailer_size); }else{ assert(av_fifo_size(stream->fifo) == trailer_size); @@ -1065,7 +1068,9 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) dts += 2*preload; } -//av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n", dts/90000.0, pts/90000.0, pkt->flags, pkt->stream_index, pts != AV_NOPTS_VALUE); + av_dlog(ctx, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n", + dts / 90000.0, pts / 90000.0, pkt->flags, + pkt->stream_index, pts != AV_NOPTS_VALUE); if (!stream->premux_packet) stream->next_packet = &stream->premux_packet; *stream->next_packet= diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index c39cf45d7b..6316d6178e 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -423,7 +423,8 @@ static int get_packet_size(const uint8_t *buf, int size) score = analyze(buf, size, TS_PACKET_SIZE, NULL); dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, NULL); fec_score= analyze(buf, size, TS_FEC_PACKET_SIZE, NULL); -// av_log(NULL, AV_LOG_DEBUG, "score: %d, dvhs_score: %d, fec_score: %d \n", score, dvhs_score, fec_score); + av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n", + score, dvhs_score, fec_score); if (score > fec_score && score > dvhs_score) return TS_PACKET_SIZE; else if(dvhs_score > score && dvhs_score > fec_score) return TS_DVHS_PACKET_SIZE; @@ -1878,7 +1879,8 @@ static int mpegts_probe(AVProbeData *p) score = analyze(p->buf, TS_PACKET_SIZE *check_count, TS_PACKET_SIZE , NULL)*CHECK_COUNT/check_count; dvhs_score= analyze(p->buf, TS_DVHS_PACKET_SIZE*check_count, TS_DVHS_PACKET_SIZE, NULL)*CHECK_COUNT/check_count; fec_score = analyze(p->buf, TS_FEC_PACKET_SIZE *check_count, TS_FEC_PACKET_SIZE , NULL)*CHECK_COUNT/check_count; -// av_log(NULL, AV_LOG_DEBUG, "score: %d, dvhs_score: %d, fec_score: %d \n", score, dvhs_score, fec_score); + av_dlog(NULL, "score: %d, dvhs_score: %d, fec_score: %d \n", + score, dvhs_score, fec_score); // we need a clear definition for the returned score otherwise things will become messy sooner or later if (score > fec_score && score > dvhs_score && score > 6) return AVPROBE_SCORE_MAX + score - CHECK_COUNT; diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index eba7312fbd..0b7a678157 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -1098,7 +1098,7 @@ static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt) do { p = avpriv_mpv_find_start_code(p, buf_end, &state); - //av_log(s, AV_LOG_INFO, "nal %d\n", state & 0x1f); + av_dlog(s, "nal %d\n", state & 0x1f); } while (p < buf_end && (state & 0x1f) != 9 && (state & 0x1f) != 5 && (state & 0x1f) != 1); diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 6fdc70448b..220b3e47eb 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -2107,7 +2107,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket } *out = pktl->pkt; - //av_log(s, AV_LOG_DEBUG, "out st:%d dts:%lld\n", (*out).stream_index, (*out).dts); + av_dlog(s, "out st:%d dts:%lld\n", (*out).stream_index, (*out).dts); s->packet_buffer = pktl->next; if(s->streams[pktl->pkt.stream_index]->last_in_packet_buffer == pktl) s->streams[pktl->pkt.stream_index]->last_in_packet_buffer= NULL; diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index d3db102589..f719c8ea59 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -96,16 +96,12 @@ static int find_header_idx(AVFormatContext *s, AVCodecContext *c, int size, int int i; int len= find_expected_header(c, size, frame_type, out); -//av_log(NULL, AV_LOG_ERROR, "expected_h len=%d size=%d codec_id=%d\n", len, size, c->codec_id); - for(i=1; i<nut->header_count; i++){ if( len == nut->header_len[i] && !memcmp(out, nut->header[i], len)){ -// av_log(NULL, AV_LOG_ERROR, "found %d\n", i); return i; } } -// av_log(NULL, AV_LOG_ERROR, "nothing found\n"); return 0; } diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 3cbf3f590f..a69017dc09 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -358,7 +358,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb, st->codec->codec_tag = avio_rl32(pb); st->codec->codec_id = ff_codec_get_id(ff_rm_codec_tags, st->codec->codec_tag); -// av_log(s, AV_LOG_DEBUG, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0')); + av_dlog(s, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0')); if (st->codec->codec_id == AV_CODEC_ID_NONE) goto fail1; st->codec->width = avio_rb16(pb); @@ -1002,7 +1002,8 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index, } if((flags&2) && (seq&0x7F) == 1){ -// av_log(s, AV_LOG_DEBUG, "%d %d-%d %"PRId64" %d\n", flags, stream_index2, stream_index, dts, seq); + av_dlog(s, "%d %d-%d %"PRId64" %d\n", + flags, stream_index2, stream_index, dts, seq); av_add_index_entry(st, pos, dts, 0, 0, AVINDEX_KEYFRAME); if(stream_index2 == stream_index) break; diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index bfebe40c81..80f1047c5d 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -155,8 +155,6 @@ static void rtsp_parse_range_npt(const char *p, int64_t *start, int64_t *end) get_word_sep(buf, sizeof(buf), "-", &p); av_parse_time(end, buf, 1); } -// av_log(NULL, AV_LOG_DEBUG, "Range Start: %lld\n", *start); -// av_log(NULL, AV_LOG_DEBUG, "Range End: %lld\n", *end); } static int get_sockaddr(const char *buf, struct sockaddr_storage *sock) diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index 86ea6dec9e..3967d82ef3 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.c @@ -45,7 +45,6 @@ static int get_swf_tag(AVIOContext *pb, int *len_ptr) if (len == 0x3f) { len = avio_rl32(pb); } -// av_log(NULL, AV_LOG_DEBUG, "Tag: %d - Len: %d\n", tag, len); *len_ptr = len; return tag; } diff --git a/libavformat/utils.c b/libavformat/utils.c index 7940037782..b3298f8fbd 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1113,8 +1113,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts > pkt->dts) presentation_delayed = 1; -// av_log(NULL, AV_LOG_DEBUG, "IN delayed:%d pts:%s, dts:%s cur_dts:%s st:%d pc:%p duration:%d\n", -// presentation_delayed, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), pkt->stream_index, pc, pkt->duration); + av_dlog(NULL, "IN delayed:%d pts:%s, dts:%s cur_dts:%s st:%d pc:%p duration:%d\n", + presentation_delayed, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), pkt->stream_index, pc, pkt->duration); /* interpolate PTS and DTS if they are not present */ //We skip H264 currently because delay and has_b_frames are not reliably set if((delay==0 || (delay==1 && pc)) && st->codec->codec_id != AV_CODEC_ID_H264){ @@ -1182,8 +1182,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, if(pkt->dts > st->cur_dts) st->cur_dts = pkt->dts; -// av_log(NULL, AV_LOG_ERROR, "OUTdelayed:%d/%d pts:%s, dts:%s cur_dts:%s\n", -// presentation_delayed, delay, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts)); + av_dlog(NULL, "OUTdelayed:%d/%d pts:%s, dts:%s cur_dts:%s\n", + presentation_delayed, delay, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts)); /* update flags */ if (is_intra_only(st->codec)) @@ -3536,7 +3536,8 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){ return AVERROR(EINVAL); } -// av_log(s, AV_LOG_DEBUG, "av_write_frame: pts2:%s dts2:%s\n", av_ts2str(pkt->pts), av_ts2str(pkt->dts)); + av_dlog(s, "av_write_frame: pts2:%s dts2:%s\n", + av_ts2str(pkt->pts), av_ts2str(pkt->dts)); st->cur_dts= pkt->dts; st->pts.val= pkt->dts; |