-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to new FFmpeg AVPacket API #938
Conversation
Resolving #939 first should further simplify the needed changes. The new API functions are supported since FFmpeg 3.0. |
Looking at the stuff that will be removed with the support for old FFmpeg versions, I just noticed that our StatusInfo stuff is completely broken since ef52574 tried to fix it for FFmpeg 2.0. TPacketQueue.GetStatusInfo no longer returns a value, but the result is used in TFFmpegDecodeStream.DecodeFrame. Luckily there appear to be only few audio files that don't start at PTS 0. Can you add a field to TPacketList to store the StatusInfo there? Edit: We don't need to do that. Since FFmpeg 5.0 there is an |
This has been rebased to current |
A significant breaking change is coming to the FFmpeg API in the next major version bump of libavcodec, which is expected to occur with the release of FFmpeg 8 sometime in the next few months. See #778 for more details.
AVPacket
) is being removed from the public ABI. The FFmpeg developers want to add fields to the end of the struct without bumping the major version. This means that calling applications should not allocate theAVPacket
structure, but instead useav_packet_alloc
to let FFmpeg allocate it. Otherwise, there is a risk of a segfault.av_init_packet
is being removed (av_packet_alloc
takes over this functionality).AVPacketList
is being removedNew code is added to use the FFmpeg allocator for
TAVPacket
, and operate onPAVPacket
instead ofTAVPacket
. A custom record typeTPacketList
was introduced to replaceTAVPacketList
, which fulfills the same purpose.I've done some testing locally on both Linux and Windows. Everything is working on my end and I haven't detected any memory leaks.
Fixes #778