This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch release/8.1 in repository ffmpeg.
commit f6df7088f9eba736965466f781b2c79f42e4a43b Author: Michael Niedermayer <[email protected]> AuthorDate: Sun Jul 26 23:06:23 2026 +0200 Commit: Michael Niedermayer <[email protected]> CommitDate: Sat Sep 19 14:27:04 2026 +0200 avcodec/utils: factor the timecode fields out of ff_alloc_timecode_sei (cherry picked from commit a290dec0bfe45f68880dcbf7cddea3a4939d00b2) Signed-off-by: Michael Niedermayer <[email protected]> --- libavcodec/utils.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 1d09c5825b..ccff500c0f 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -994,6 +994,22 @@ AVCPBProperties *av_cpb_properties_alloc(size_t *size) return props; } +static void put_timecode_fields(PutBitContext *pb, AVRational rate, uint32_t tc) +{ + unsigned hours, minutes, seconds, frames, drop; + + ff_timecode_set_smpte(&drop, &hours, &minutes, &seconds, &frames, rate, tc, 0, 0); + + put_bits(pb, 5, 0); // counting_type + put_bits(pb, 1, 1); // full_timestamp_flag + put_bits(pb, 1, 0); // discontinuity_flag + put_bits(pb, 1, drop); // cnt_dropped_flag + put_bits(pb, 9, frames); + put_bits(pb, 6, seconds); + put_bits(pb, 6, minutes); + put_bits(pb, 5, hours); +} + int ff_alloc_timecode_sei(const AVFrame *frame, AVRational rate, size_t prefix_len, void **data, size_t *sei_size) { @@ -1023,20 +1039,10 @@ int ff_alloc_timecode_sei(const AVFrame *frame, AVRational rate, size_t prefix_l put_bits(&pb, 2, m); // num_clock_ts for (int j = 1; j <= m; j++) { - unsigned hh, mm, ss, ff, drop; - ff_timecode_set_smpte(&drop, &hh, &mm, &ss, &ff, rate, tc[j], 0, 0); - put_bits(&pb, 1, 1); // clock_timestamp_flag put_bits(&pb, 1, 1); // units_field_based_flag - put_bits(&pb, 5, 0); // counting_type - put_bits(&pb, 1, 1); // full_timestamp_flag - put_bits(&pb, 1, 0); // discontinuity_flag - put_bits(&pb, 1, drop); - put_bits(&pb, 9, ff); - put_bits(&pb, 6, ss); - put_bits(&pb, 6, mm); - put_bits(&pb, 5, hh); - put_bits(&pb, 5, 0); + put_timecode_fields(&pb, rate, tc[j]); + put_bits(&pb, 5, 0); // time_offset_length } flush_put_bits(&pb); -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
