lavf utils: Fix bad indentation.
This commit is contained in:
parent
6c7ee2f7db
commit
7e6029f98a
@ -587,7 +587,7 @@ static int init_input(AVFormatContext *s, const char *filename)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ((ret = avio_open(&s->pb, filename, AVIO_FLAG_READ)) < 0)
|
if ((ret = avio_open(&s->pb, filename, AVIO_FLAG_READ)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
if (s->iformat)
|
if (s->iformat)
|
||||||
return 0;
|
return 0;
|
||||||
return av_probe_input_buffer(s->pb, &s->iformat, filename, s, 0, 0);
|
return av_probe_input_buffer(s->pb, &s->iformat, filename, s, 0, 0);
|
||||||
@ -1146,7 +1146,7 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
|
|||||||
st->cur_pkt.data = NULL;
|
st->cur_pkt.data = NULL;
|
||||||
assert(st->cur_len == 0);
|
assert(st->cur_len == 0);
|
||||||
}else{
|
}else{
|
||||||
pkt->destruct = NULL;
|
pkt->destruct = NULL;
|
||||||
}
|
}
|
||||||
compute_pkt_fields(s, st, st->parser, pkt);
|
compute_pkt_fields(s, st, st->parser, pkt);
|
||||||
|
|
||||||
@ -1760,7 +1760,7 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int f
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
st= s->streams[stream_index];
|
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);
|
timestamp = av_rescale(timestamp, st->time_base.den, AV_TIME_BASE * (int64_t)st->time_base.num);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1959,39 +1959,40 @@ static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
|
|||||||
filesize = ic->file_size;
|
filesize = ic->file_size;
|
||||||
end_time = AV_NOPTS_VALUE;
|
end_time = AV_NOPTS_VALUE;
|
||||||
do{
|
do{
|
||||||
offset = filesize - (DURATION_MAX_READ_SIZE<<retry);
|
offset = filesize - (DURATION_MAX_READ_SIZE<<retry);
|
||||||
if (offset < 0)
|
if (offset < 0)
|
||||||
offset = 0;
|
offset = 0;
|
||||||
|
|
||||||
avio_seek(ic->pb, offset, SEEK_SET);
|
avio_seek(ic->pb, offset, SEEK_SET);
|
||||||
read_size = 0;
|
read_size = 0;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
if (read_size >= DURATION_MAX_READ_SIZE<<(FFMAX(retry-1,0)))
|
if (read_size >= DURATION_MAX_READ_SIZE<<(FFMAX(retry-1,0)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
do{
|
do {
|
||||||
ret = av_read_packet(ic, pkt);
|
ret = av_read_packet(ic, pkt);
|
||||||
}while(ret == AVERROR(EAGAIN));
|
} while(ret == AVERROR(EAGAIN));
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
break;
|
break;
|
||||||
read_size += pkt->size;
|
read_size += pkt->size;
|
||||||
st = ic->streams[pkt->stream_index];
|
st = ic->streams[pkt->stream_index];
|
||||||
if (pkt->pts != AV_NOPTS_VALUE &&
|
if (pkt->pts != AV_NOPTS_VALUE &&
|
||||||
(st->start_time != AV_NOPTS_VALUE ||
|
(st->start_time != AV_NOPTS_VALUE ||
|
||||||
st->first_dts != AV_NOPTS_VALUE)) {
|
st->first_dts != AV_NOPTS_VALUE)) {
|
||||||
duration = end_time = pkt->pts;
|
duration = end_time = pkt->pts;
|
||||||
if (st->start_time != AV_NOPTS_VALUE) duration -= st->start_time;
|
if (st->start_time != AV_NOPTS_VALUE)
|
||||||
else duration -= st->first_dts;
|
duration -= st->start_time;
|
||||||
if (duration < 0)
|
else
|
||||||
duration += 1LL<<st->pts_wrap_bits;
|
duration -= st->first_dts;
|
||||||
if (duration > 0) {
|
if (duration < 0)
|
||||||
if (st->duration == AV_NOPTS_VALUE ||
|
duration += 1LL<<st->pts_wrap_bits;
|
||||||
st->duration < duration)
|
if (duration > 0) {
|
||||||
st->duration = duration;
|
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
|
}while( end_time==AV_NOPTS_VALUE
|
||||||
&& filesize > (DURATION_MAX_READ_SIZE<<retry)
|
&& filesize > (DURATION_MAX_READ_SIZE<<retry)
|
||||||
&& ++retry <= DURATION_MAX_RETRY);
|
&& ++retry <= DURATION_MAX_RETRY);
|
||||||
@ -3914,7 +3915,7 @@ int avformat_query_codec(AVOutputFormat *ofmt, enum CodecID codec_id, int std_co
|
|||||||
return !!av_codec_get_tag(ofmt->codec_tag, codec_id);
|
return !!av_codec_get_tag(ofmt->codec_tag, codec_id);
|
||||||
else if (codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec ||
|
else if (codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec ||
|
||||||
codec_id == ofmt->subtitle_codec)
|
codec_id == ofmt->subtitle_codec)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return AVERROR_PATCHWELCOME;
|
return AVERROR_PATCHWELCOME;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user