mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
avformat: add writeout_count statistic
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
0138fe5656
commit
ad6a50c0ed
@ -140,6 +140,12 @@ typedef struct AVIOContext {
|
|||||||
* This field is internal to libavformat and access from outside is not allowed.
|
* This field is internal to libavformat and access from outside is not allowed.
|
||||||
*/
|
*/
|
||||||
int seek_count;
|
int seek_count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* writeout statistic
|
||||||
|
* This field is internal to libavformat and access from outside is not allowed.
|
||||||
|
*/
|
||||||
|
int writeout_count;
|
||||||
} AVIOContext;
|
} AVIOContext;
|
||||||
|
|
||||||
/* unbuffered I/O */
|
/* unbuffered I/O */
|
||||||
|
@ -131,6 +131,7 @@ static void writeout(AVIOContext *s, const uint8_t *data, int len)
|
|||||||
s->error = ret;
|
s->error = ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
s->writeout_count ++;
|
||||||
s->pos += len;
|
s->pos += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -827,7 +828,9 @@ int avio_close(AVIOContext *s)
|
|||||||
avio_flush(s);
|
avio_flush(s);
|
||||||
h = s->opaque;
|
h = s->opaque;
|
||||||
av_freep(&s->buffer);
|
av_freep(&s->buffer);
|
||||||
if (!s->write_flag)
|
if (s->write_flag)
|
||||||
|
av_log(s, AV_LOG_DEBUG, "Statistics: %d seeks, %d writeouts\n", s->seek_count, s->writeout_count);
|
||||||
|
else
|
||||||
av_log(s, AV_LOG_DEBUG, "Statistics: %"PRId64" bytes read, %d seeks\n", s->bytes_read, s->seek_count);
|
av_log(s, AV_LOG_DEBUG, "Statistics: %"PRId64" bytes read, %d seeks\n", s->bytes_read, s->seek_count);
|
||||||
av_free(s);
|
av_free(s);
|
||||||
return ffurl_close(h);
|
return ffurl_close(h);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user