From 8a81820624ada4d339aeb2150ad5c2b36b12860c Mon Sep 17 00:00:00 2001 From: James Almer Date: Mon, 17 Aug 2020 12:03:50 -0300 Subject: avcodec/packet: move AVPacketList definition and function helpers over from libavformat And replace the flags parameter with a function callback that can be used to copy the contents of the packet (e.g, av_packet_ref and av_packet_copy_props). Signed-off-by: James Almer --- libavformat/flacenc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libavformat/flacenc.c') diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c index b947a3b067..6b8ce8d7ee 100644 --- a/libavformat/flacenc.c +++ b/libavformat/flacenc.c @@ -23,6 +23,7 @@ #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "libavcodec/flac.h" +#include "libavcodec/packet_internal.h" #include "avformat.h" #include "avio_internal.h" #include "flacenc.h" @@ -305,7 +306,7 @@ static int flac_queue_flush(AVFormatContext *s) write = 0; while (c->queue) { - ff_packet_list_get(&c->queue, &c->queue_end, &pkt); + avpriv_packet_list_get(&c->queue, &c->queue_end, &pkt); if (write && (ret = flac_write_audio_packet(s, &pkt)) < 0) write = 0; av_packet_unref(&pkt); @@ -345,7 +346,7 @@ static void flac_deinit(struct AVFormatContext *s) { FlacMuxerContext *c = s->priv_data; - ff_packet_list_free(&c->queue, &c->queue_end); + avpriv_packet_list_free(&c->queue, &c->queue_end); } static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt) @@ -356,7 +357,7 @@ static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt) if (pkt->stream_index == c->audio_stream_idx) { if (c->waiting_pics) { /* buffer audio packets until we get all the pictures */ - ret = ff_packet_list_put(&c->queue, &c->queue_end, pkt, FF_PACKETLIST_FLAG_REF_PACKET); + ret = avpriv_packet_list_put(&c->queue, &c->queue_end, pkt, av_packet_ref, 0); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Out of memory in packet queue; skipping attached pictures\n"); c->waiting_pics = 0; -- cgit v1.2.3