Closed abdulbadii closed 1 month ago
Yeah, I think this function was removed as deprecated: https://www.ffmpeg.org/doxygen/3.3/group__lavc__decoding.html#gaaa1fbe477c04455cdc7a994090100db4
Can the deprecated function used in untrunc be swapped out with a new one that does the same thing?
diff --git a/src/codec.cpp b/src/codec.cpp
index e4fac55..e6142a2 100644
--- a/src/codec.cpp
+++ b/src/codec.cpp
@@ -338,7 +338,7 @@ bool Codec::matchSample(const uchar *start) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
inline int untr_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt, uint maxlength) {
- int consumed = avcodec_decode_audio4(avctx, frame, got_frame, pkt);
+ int consumed = pkt->size;
// ffmpeg 3.4+ uses internal buffer which needs to be updated.
// this is slow because of the internal memory allocation.
@@ -350,7 +350,7 @@ inline int untr_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_fr
}
avcodec_flush_buffers(avctx);
pkt->size = maxlength;
- consumed = avcodec_decode_audio4(avctx, frame, got_frame, pkt);
+ consumed = pkt->size;
if (consumed < 0) {
avcodec_flush_buffers(avctx);
}
@@ -363,7 +363,7 @@ inline int untr_decode_video2(AVCodecContext *avctx, AVFrame *frame, int *got_fr
// thus there is no way to detect video frame bounderies using ffmpeg3.4+..
// https://github.com/FFmpeg/FFmpeg/blob/7fc329e2dd6226dfecaa4a1d7adf353bf2773726/libavcodec/avcodec.h#L4793
// https://github.com/FFmpeg/FFmpeg/commit/061a0c14bb5767bca72e3a7227ca400de439ba09
- return avcodec_decode_video2(avctx, frame, got_frame, pkt);
+ return pkt->size;
}
#pragma GCC diagnostic pop
How is the solution of this failure on Arch Linux
and line 361, please help out guide to correct way