aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/tableprint.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-23 23:26:57 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-08-27 02:23:43 +0200
commit1e6307f46c486d17f670043672d49335ea1bae97 (patch)
treeef6469a2bd472ee8189f6d9ce0a4f288cfd57e55 /libavcodec/tableprint.h
parent4dddcd08c47850fbf3cef2ff6b31f65133856e0f (diff)
downloadffmpeg-1e6307f46c486d17f670043672d49335ea1bae97.tar.gz
avcodec/encode, frame_thread_encoder: Unify calling encode callback
The encode-callback (the callback used by the FF_CODEC_CB_TYPE_ENCODE encoders) is currently called in two places: encode_simple_internal() and by the worker threads of frame-threaded encoders. After the call, some packet properties are set based upon the corresponding AVFrame properties and the packet is made refcounted if it isn't already. So there is some code duplication. There was also non-duplicated code in encode_simple_internal() which is executed even when using frame-threading. This included an emms_c() (which is needed for frame-threading, too, if it is needed for the single-threaded case, because there are allocations (via av_packet_make_refcounted()) immediately after returning from the encode-callback). Furthermore, some further properties are only set in encode_simple_internal(): For audio, pts and duration are derived from the corresponding fields of the frame if the encoder does not have the AV_CODEC_CAP_DELAY set. Yet this is wrong for frame-threaded encoders, because frame-threading always introduces delay regardless of whether the underlying codec has said cap. This only worked because there are no frame-threaded audio encoders. This commit fixes the code duplication and the above issue by factoring this code out and reusing it in both places. It would work in case of audio codecs with frame-threading, because now the values are derived from the correct AVFrame. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/tableprint.h')
0 files changed, 0 insertions, 0 deletions