Commit d3bb7191 authored by Anton Khirnov's avatar Anton Khirnov

lavf/utils: drop av_ prefixes from static functions.

parent c3bec4cd
......@@ -79,7 +79,7 @@ const char *avformat_license(void)
* @param num must be >= 0
* @param den must be >= 1
*/
static void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
static void frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
{
num += (den >> 1);
if (num >= den) {
......@@ -97,7 +97,7 @@ static void av_frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
* @param f fractional number
* @param incr increment, can be positive or negative
*/
static void av_frac_add(AVFrac *f, int64_t incr)
static void frac_add(AVFrac *f, int64_t incr)
{
int64_t num, den;
......@@ -1088,7 +1088,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
}
static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
{
AVStream *st;
int len, ret, i;
......@@ -1218,7 +1218,7 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt)
}
}
if(s->debug & FF_FDEBUG_TS)
av_log(s, AV_LOG_DEBUG, "av_read_frame_internal stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d, duration=%d, flags=%d\n",
av_log(s, AV_LOG_DEBUG, "read_frame_internal stream=%d, pts=%"PRId64", dts=%"PRId64", size=%d, duration=%d, flags=%d\n",
pkt->stream_index,
pkt->pts,
pkt->dts,
......@@ -1264,7 +1264,7 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
}
}
if(genpts){
int ret= av_read_frame_internal(s, pkt);
int ret= read_frame_internal(s, pkt);
if(ret<0){
if(pktl && ret != AVERROR(EAGAIN)){
eof=1;
......@@ -1278,7 +1278,7 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
return AVERROR(ENOMEM);
}else{
assert(!s->packet_buffer);
return av_read_frame_internal(s, pkt);
return read_frame_internal(s, pkt);
}
}
}
......@@ -1650,7 +1650,7 @@ int64_t av_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts, i
return pos;
}
static int av_seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos, int flags){
static int seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos, int flags){
int64_t pos_min, pos_max;
#if 0
AVStream *st;
......@@ -1675,7 +1675,7 @@ static int av_seek_frame_byte(AVFormatContext *s, int stream_index, int64_t pos,
return 0;
}
static int av_seek_frame_generic(AVFormatContext *s,
static int seek_frame_generic(AVFormatContext *s,
int stream_index, int64_t timestamp, int flags)
{
int index;
......@@ -1743,7 +1743,7 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int f
ff_read_frame_flush(s);
if(flags & AVSEEK_FLAG_BYTE)
return av_seek_frame_byte(s, stream_index, timestamp, flags);
return seek_frame_byte(s, stream_index, timestamp, flags);
if(stream_index < 0){
stream_index= av_find_default_stream_index(s);
......@@ -1767,7 +1767,7 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int f
if(s->iformat->read_timestamp && !(s->iformat->flags & AVFMT_NOBINSEARCH))
return av_seek_frame_binary(s, stream_index, timestamp, flags);
else if (!(s->iformat->flags & AVFMT_NOGENSEARCH))
return av_seek_frame_generic(s, stream_index, timestamp, flags);
return seek_frame_generic(s, stream_index, timestamp, flags);
else
return -1;
}
......@@ -1791,7 +1791,7 @@ int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int
if(s->iformat->read_seek || 1)
return av_seek_frame(s, stream_index, ts, flags | (ts - min_ts > (uint64_t)(max_ts - ts) ? AVSEEK_FLAG_BACKWARD : 0));
// try some generic seek like av_seek_frame_generic() but with new ts semantics
// try some generic seek like seek_frame_generic() but with new ts semantics
}
/*******************************************************/
......@@ -1801,7 +1801,7 @@ int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int
*
* @return TRUE if the stream has accurate duration for at least one component.
*/
static int av_has_duration(AVFormatContext *ic)
static int has_duration(AVFormatContext *ic)
{
int i;
AVStream *st;
......@@ -1819,7 +1819,7 @@ static int av_has_duration(AVFormatContext *ic)
*
* Also computes the global bitrate if possible.
*/
static void av_update_stream_timings(AVFormatContext *ic)
static void update_stream_timings(AVFormatContext *ic)
{
int64_t start_time, start_time1, end_time, end_time1;
int64_t duration, duration1;
......@@ -1870,7 +1870,7 @@ static void fill_all_stream_timings(AVFormatContext *ic)
int i;
AVStream *st;
av_update_stream_timings(ic);
update_stream_timings(ic);
for(i = 0;i < ic->nb_streams; i++) {
st = ic->streams[i];
if (st->start_time == AV_NOPTS_VALUE) {
......@@ -1882,7 +1882,7 @@ static void fill_all_stream_timings(AVFormatContext *ic)
}
}
static void av_estimate_timings_from_bit_rate(AVFormatContext *ic)
static void estimate_timings_from_bit_rate(AVFormatContext *ic)
{
int64_t filesize, duration;
int bit_rate, i;
......@@ -1919,7 +1919,7 @@ static void av_estimate_timings_from_bit_rate(AVFormatContext *ic)
#define DURATION_MAX_RETRY 3
/* only usable for MPEG-PS streams */
static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
{
AVPacket pkt1, *pkt = &pkt1;
AVStream *st;
......@@ -1936,7 +1936,7 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset
for (i=0; i<ic->nb_streams; i++) {
st = ic->streams[i];
if (st->start_time == AV_NOPTS_VALUE && st->first_dts == AV_NOPTS_VALUE)
av_log(st->codec, AV_LOG_WARNING, "start time is not set in av_estimate_timings_from_pts\n");
av_log(st->codec, AV_LOG_WARNING, "start time is not set in estimate_timings_from_pts\n");
if (st->parser) {
av_parser_close(st->parser);
......@@ -1998,7 +1998,7 @@ static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset
}
}
static void av_estimate_timings(AVFormatContext *ic, int64_t old_offset)
static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
{
int64_t file_size;
......@@ -2016,17 +2016,17 @@ static void av_estimate_timings(AVFormatContext *ic, int64_t old_offset)
!strcmp(ic->iformat->name, "mpegts")) &&
file_size && ic->pb->seekable) {
/* get accurate estimate from the PTSes */
av_estimate_timings_from_pts(ic, old_offset);
} else if (av_has_duration(ic)) {
estimate_timings_from_pts(ic, old_offset);
} else if (has_duration(ic)) {
/* at least one component has timings - we use them for all
the components */
fill_all_stream_timings(ic);
} else {
av_log(ic, AV_LOG_WARNING, "Estimating duration from bitrate, this may be inaccurate\n");
/* less precise: use bitrate info */
av_estimate_timings_from_bit_rate(ic);
estimate_timings_from_bit_rate(ic);
}
av_update_stream_timings(ic);
update_stream_timings(ic);
{
int i;
......@@ -2311,7 +2311,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
/* NOTE: a new stream can be added there if no header in file
(AVFMTCTX_NOHEADER) */
ret = av_read_frame_internal(ic, &pkt1);
ret = read_frame_internal(ic, &pkt1);
if (ret == AVERROR(EAGAIN))
continue;
......@@ -2467,7 +2467,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
}
}
av_estimate_timings(ic, old_offset);
estimate_timings(ic, old_offset);
compute_chapters_end(ic);
......@@ -2931,7 +2931,7 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
ret = AVERROR_INVALIDDATA;
goto fail;
}
av_frac_init(&st->pts, 0, 0, den);
frac_init(&st->pts, 0, 0, den);
}
}
......@@ -3009,11 +3009,11 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){
likely equal to the encoder delay, but it would be better if we
had the real timestamps from the encoder */
if (frame_size >= 0 && (pkt->size || st->pts.num!=st->pts.den>>1 || st->pts.val)) {
av_frac_add(&st->pts, (int64_t)st->time_base.den * frame_size);
frac_add(&st->pts, (int64_t)st->time_base.den * frame_size);
}
break;
case AVMEDIA_TYPE_VIDEO:
av_frac_add(&st->pts, (int64_t)st->time_base.den * st->codec->time_base.num);
frac_add(&st->pts, (int64_t)st->time_base.den * st->codec->time_base.num);
break;
default:
break;
......@@ -3122,7 +3122,7 @@ int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pk
* @return 1 if a packet was output, 0 if no packet could be output,
* < 0 if an error occurred
*/
static int av_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in, int flush){
static int interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in, int flush){
if(s->oformat->interleave_packet)
return s->oformat->interleave_packet(s, out, in, flush);
else
......@@ -3147,7 +3147,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
for(;;){
AVPacket opkt;
int ret= av_interleave_packet(s, &opkt, pkt, 0);
int ret= interleave_packet(s, &opkt, pkt, 0);
if(ret<=0) //FIXME cleanup needed for ret<0 ?
return ret;
......@@ -3169,7 +3169,7 @@ int av_write_trailer(AVFormatContext *s)
for(;;){
AVPacket pkt;
ret= av_interleave_packet(s, &pkt, NULL, 1);
ret= interleave_packet(s, &pkt, NULL, 1);
if(ret<0) //FIXME cleanup needed for ret<0 ?
goto fail;
if(!ret)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment