diff options
author | Matteo Bernardini | 2022-11-19 09:46:49 +0100 |
---|---|---|
committer | Matteo Bernardini | 2022-11-19 09:46:49 +0100 |
commit | e99f4d18a14724754ffbcc10960e56bcc86ac8f3 (patch) | |
tree | 2824b9a71116e0a0d12e47345abb901ad9f370cd /libraries/libopenshot/patches/0005-FFmpegWriter-Don-t-use-AVPicture-gone-in-5.0.patch | |
parent | b54a7d46399fd01b3bf2adc2d1b4a2b429d3c6c4 (diff) | |
download | slackbuilds-e99f4d18a14724754ffbcc10960e56bcc86ac8f3.tar.gz |
20221119.1 global branch merge.current-20221119.1
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'libraries/libopenshot/patches/0005-FFmpegWriter-Don-t-use-AVPicture-gone-in-5.0.patch')
-rw-r--r-- | libraries/libopenshot/patches/0005-FFmpegWriter-Don-t-use-AVPicture-gone-in-5.0.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/libraries/libopenshot/patches/0005-FFmpegWriter-Don-t-use-AVPicture-gone-in-5.0.patch b/libraries/libopenshot/patches/0005-FFmpegWriter-Don-t-use-AVPicture-gone-in-5.0.patch new file mode 100644 index 0000000000..1f929749b7 --- /dev/null +++ b/libraries/libopenshot/patches/0005-FFmpegWriter-Don-t-use-AVPicture-gone-in-5.0.patch @@ -0,0 +1,57 @@ +From: "FeRD (Frank Dana)" <ferdnyc@gmail.com> +Date: Thu, 24 Feb 2022 10:34:41 -0500 +Subject: [PATCH] FFmpegWriter: Don't use AVPicture (gone in 5.0) + +--- + src/FFmpegWriter.cpp | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/src/FFmpegWriter.cpp b/src/FFmpegWriter.cpp +index 7a45ab4..fdd0652 100644 +--- a/src/FFmpegWriter.cpp ++++ b/src/FFmpegWriter.cpp +@@ -772,7 +772,7 @@ void FFmpegWriter::write_queued_frames() { + // Get AVFrame + AVFrame *av_frame = av_frames[frame]; + +- // Deallocate AVPicture and AVFrame ++ // Deallocate buffer and AVFrame + av_freep(&(av_frame->data[0])); + AV_FREE_FRAME(&av_frame); + av_frames.erase(frame); +@@ -2035,26 +2035,26 @@ bool FFmpegWriter::write_video_packet(std::shared_ptr<Frame> frame, AVFrame *fra + if (oc->oformat->flags & AVFMT_RAWPICTURE) { + #endif + // Raw video case. +- AVPacket pkt; +- av_init_packet(&pkt); ++ AVPacket* pkt; ++ av_packet_from_data( ++ pkt, frame_final->data[0], ++ frame_final->linesize[0] * frame_final->height); + +- pkt.flags |= AV_PKT_FLAG_KEY; +- pkt.stream_index = video_st->index; +- pkt.data = (uint8_t *) frame_final->data; +- pkt.size = sizeof(AVPicture); ++ pkt->flags |= AV_PKT_FLAG_KEY; ++ pkt->stream_index = video_st->index; + + // Set PTS (in frames and scaled to the codec's timebase) +- pkt.pts = video_timestamp; ++ pkt->pts = video_timestamp; + + /* write the compressed frame in the media file */ +- int error_code = av_interleaved_write_frame(oc, &pkt); ++ int error_code = av_interleaved_write_frame(oc, pkt); + if (error_code < 0) { + ZmqLogger::Instance()->AppendDebugMethod("FFmpegWriter::write_video_packet ERROR [" + av_err2string(error_code) + "]", "error_code", error_code); + return false; + } + + // Deallocate packet +- AV_FREE_PACKET(&pkt); ++ AV_FREE_PACKET(pkt); + + } else + { |