diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-08-24 20:26:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-08-24 20:26:48 +0200 |
commit | bd4640375e24fc0aa8846d9ee42cebe3c1fa9c12 (patch) | |
tree | 9d3f2f97610a982d9d259247a95f20ebe3428dda /libavformat/utils.c | |
parent | d4f30c7daf1cf82e78fd7c3d2ea0f56b4c582abd (diff) | |
parent | b9630bcf8215034f5a50e1f6835d4c4366413618 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
avconv: Replace goto redo on decode fail with continue.
avconv: Remove dead store.
libx264: add 'crf_max' private option.
libx264: add 'weightp' private option.
libx264: add 'rc_lookahead' private option.
libx264: add 'psy_trellis' private option.
libx264: add 'psy_rd' private option.
libx264: add 'aq_strength' private option.
libx264: add 'aq_mode' private option.
libx264: add 'cqp' private option.
libx264: add 'crf' private option.
lavc: remove vbv_delay option
lavf utils: Fix bad indentation.
avconv: use av_clip_int16 for audio clipping
Conflicts:
libavcodec/libx264.c
libavcodec/options.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index ef1de94d77..7a9d69a63b 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -610,7 +610,7 @@ static int init_input(AVFormatContext *s, const char *filename) return 0; if ((ret = avio_open(&s->pb, filename, AVIO_FLAG_READ)) < 0) - return ret; + return ret; if (s->iformat) return 0; return av_probe_input_buffer(s->pb, &s->iformat, filename, s, 0, 0); @@ -1175,7 +1175,7 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) st->cur_pkt.data = NULL; assert(st->cur_len == 0); }else{ - pkt->destruct = NULL; + pkt->destruct = NULL; } compute_pkt_fields(s, st, st->parser, pkt); @@ -1793,7 +1793,7 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int f return -1; st= s->streams[stream_index]; - /* timestamp for default must be expressed in AV_TIME_BASE units */ + /* timestamp for default must be expressed in AV_TIME_BASE units */ timestamp = av_rescale(timestamp, st->time_base.den, AV_TIME_BASE * (int64_t)st->time_base.num); } @@ -1999,39 +1999,40 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset) filesize = ic->file_size; end_time = AV_NOPTS_VALUE; do{ - offset = filesize - (DURATION_MAX_READ_SIZE<<retry); - if (offset < 0) - offset = 0; + offset = filesize - (DURATION_MAX_READ_SIZE<<retry); + if (offset < 0) + offset = 0; - avio_seek(ic->pb, offset, SEEK_SET); - read_size = 0; - for(;;) { - if (read_size >= DURATION_MAX_READ_SIZE<<(FFMAX(retry-1,0))) - break; + avio_seek(ic->pb, offset, SEEK_SET); + read_size = 0; + for(;;) { + if (read_size >= DURATION_MAX_READ_SIZE<<(FFMAX(retry-1,0))) + break; - do{ - ret = av_read_packet(ic, pkt); - }while(ret == AVERROR(EAGAIN)); - if (ret != 0) - break; - read_size += pkt->size; - st = ic->streams[pkt->stream_index]; - if (pkt->pts != AV_NOPTS_VALUE && - (st->start_time != AV_NOPTS_VALUE || - st->first_dts != AV_NOPTS_VALUE)) { - duration = end_time = pkt->pts; - if (st->start_time != AV_NOPTS_VALUE) duration -= st->start_time; - else duration -= st->first_dts; - if (duration < 0) - duration += 1LL<<st->pts_wrap_bits; - if (duration > 0) { - if (st->duration == AV_NOPTS_VALUE || - st->duration < duration) - st->duration = duration; + do { + ret = av_read_packet(ic, pkt); + } while(ret == AVERROR(EAGAIN)); + if (ret != 0) + break; + read_size += pkt->size; + st = ic->streams[pkt->stream_index]; + if (pkt->pts != AV_NOPTS_VALUE && + (st->start_time != AV_NOPTS_VALUE || + st->first_dts != AV_NOPTS_VALUE)) { + duration = end_time = pkt->pts; + if (st->start_time != AV_NOPTS_VALUE) + duration -= st->start_time; + else + duration -= st->first_dts; + if (duration < 0) + duration += 1LL<<st->pts_wrap_bits; + if (duration > 0) { + if (st->duration == AV_NOPTS_VALUE || st->duration < duration) + st->duration = duration; + } } + av_free_packet(pkt); } - av_free_packet(pkt); - } }while( end_time==AV_NOPTS_VALUE && filesize > (DURATION_MAX_READ_SIZE<<retry) && ++retry <= DURATION_MAX_RETRY); @@ -4049,7 +4050,7 @@ int avformat_query_codec(AVOutputFormat *ofmt, enum CodecID codec_id, int std_co return !!av_codec_get_tag(ofmt->codec_tag, codec_id); else if (codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec || codec_id == ofmt->subtitle_codec) - return 1; + return 1; } return AVERROR_PATCHWELCOME; } |