mirror of https://git.ffmpeg.org/ffmpeg.git
4fce3bab64
update_video_stats() currently uses OutputStream.data_size to print the total size of the encoded stream so far and the average bitrate. However, that field is updated in the muxer thread, right before the packet is sent to the muxer. Not only is this racy, but the numbers may not match even if muxing was in the main thread due to bitstream filters, filesize limiting, etc. Introduce a new counter, data_size_enc, for total size of the packets received from the encoder and use that in update_video_stats(). Rename data_size to data_size_mux to indicate its semantics more clearly. No synchronization is needed for data_size_mux, because it is only read in the main thread in print_final_stats(), which runs after the muxer threads are terminated. |
||
---|---|---|
.. | ||
Makefile | ||
cmdutils.c | ||
cmdutils.h | ||
ffmpeg.c | ||
ffmpeg.h | ||
ffmpeg_demux.c | ||
ffmpeg_filter.c | ||
ffmpeg_hw.c | ||
ffmpeg_mux.c | ||
ffmpeg_opt.c | ||
ffplay.c | ||
ffprobe.c | ||
fftools.manifest | ||
fftoolsres.rc | ||
fopen_utf8.h | ||
objpool.c | ||
objpool.h | ||
opt_common.c | ||
opt_common.h | ||
sync_queue.c | ||
sync_queue.h | ||
thread_queue.c | ||
thread_queue.h |