@ -169,6 +169,9 @@ static void writeout(AVIOContext *s, const uint8_t *data, int len)
if ( ret < 0 ) {
if ( ret < 0 ) {
s - > error = ret ;
s - > error = ret ;
} else {
} else {
ctx - > bytes_written + = len ;
s - > bytes_written = ctx - > bytes_written ;
if ( s - > pos + len > ctx - > written_output_size ) {
if ( s - > pos + len > ctx - > written_output_size ) {
ctx - > written_output_size = s - > pos + len ;
ctx - > written_output_size = s - > pos + len ;
# if FF_API_AVIOCONTEXT_WRITTEN
# if FF_API_AVIOCONTEXT_WRITTEN
@ -584,6 +587,7 @@ static void fill_buffer(AVIOContext *s)
s - > buf_ptr = dst ;
s - > buf_ptr = dst ;
s - > buf_end = dst + len ;
s - > buf_end = dst + len ;
ffiocontext ( s ) - > bytes_read + = len ;
ffiocontext ( s ) - > bytes_read + = len ;
s - > bytes_read = ffiocontext ( s ) - > bytes_read ;
}
}
}
}
@ -657,6 +661,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size)
} else {
} else {
s - > pos + = len ;
s - > pos + = len ;
ffiocontext ( s ) - > bytes_read + = len ;
ffiocontext ( s ) - > bytes_read + = len ;
s - > bytes_read = ffiocontext ( s ) - > bytes_read ;
size - = len ;
size - = len ;
buf + = len ;
buf + = len ;
// reset the buffer
// reset the buffer
@ -1236,8 +1241,9 @@ int avio_close(AVIOContext *s)
av_freep ( & s - > buffer ) ;
av_freep ( & s - > buffer ) ;
if ( s - > write_flag )
if ( s - > write_flag )
av_log ( s , AV_LOG_VERBOSE , " Statistics: %d seeks, %d writeouts \n " ,
av_log ( s , AV_LOG_VERBOSE ,
ctx - > seek_count , ctx - > writeout_count ) ;
" Statistics: % " PRId64 " bytes written, %d seeks, %d writeouts \n " ,
ctx - > bytes_written , ctx - > seek_count , ctx - > writeout_count ) ;
else
else
av_log ( s , AV_LOG_VERBOSE , " Statistics: % " PRId64 " bytes read, %d seeks \n " ,
av_log ( s , AV_LOG_VERBOSE , " Statistics: % " PRId64 " bytes read, %d seeks \n " ,
ctx - > bytes_read , ctx - > seek_count ) ;
ctx - > bytes_read , ctx - > seek_count ) ;