aboutsummaryrefslogtreecommitdiffstats
path: root/tools/enum_options.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-08-25 10:44:55 +0200
committerAnton Khirnov <anton@khirnov.net>2022-08-29 15:42:11 +0200
commit4fce3bab64699092100a65e957be4d1394c0b4d3 (patch)
treeb2b4ae4b25f2bedd2c7e7754bc2cd49f3196ee76 /tools/enum_options.c
parent0dd7347963041667e07366c83460fda8f19f4037 (diff)
downloadffmpeg-4fce3bab64699092100a65e957be4d1394c0b4d3.tar.gz
fftools/ffmpeg: use a separate counter for encoded packet data size
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.
Diffstat (limited to 'tools/enum_options.c')
0 files changed, 0 insertions, 0 deletions