1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-29 05:57:37 +02:00
Files
FFmpeg/libavformat/rtpdec_formats.h
Jonathan Baudanza 2a180c7150 libavformat/rtpdec_opus: Set duration field on Opus AVPacket
This commit will properly set the duration field of Opus AVPackets.
Currently, duration is set to 0 on Opus packets from the RTP demuxer.

The Ogg muxer depends on the duration field to properly compute the page granule
value. Without a proper duration, the granule will be wrong, and result in
negative pts values in ogg files.

See oggenc.c:657 (ogg_write_packet_internal)

This commit calculates using the opus_duration function, which was copied
from oggparseopus.c

I moved this functionality and the existing opus extradata functionality
(added by me in 6c24f2b) into a new rtpdec_opus.c file.

Reviewed-by: Tristan Matthews <tmatth@videolan.org>
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
2025-05-22 22:10:46 +02:00

4.9 KiB