summaryrefslogtreecommitdiff
path: root/libavformat/mp3enc.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-08-17 12:03:50 -0300
committerJames Almer <jamrial@gmail.com>2020-09-15 09:53:39 -0300
commit8a81820624ada4d339aeb2150ad5c2b36b12860c (patch)
treee282bffaec65e0cd54c523b5e88610ad4f901b5f /libavformat/mp3enc.c
parentfda5363c80bd09066d69fb9bd365c9114b8d08f3 (diff)
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 <jamrial@gmail.com>
Diffstat (limited to 'libavformat/mp3enc.c')
-rw-r--r--libavformat/mp3enc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
index a3586e1f86..4f91c4f1c3 100644
--- a/libavformat/mp3enc.c
+++ b/libavformat/mp3enc.c
@@ -28,6 +28,7 @@
#include "libavcodec/mpegaudio.h"
#include "libavcodec/mpegaudiodata.h"
#include "libavcodec/mpegaudiodecheader.h"
+#include "libavcodec/packet_internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"
@@ -387,7 +388,7 @@ static int mp3_queue_flush(AVFormatContext *s)
mp3_write_xing(s);
while (mp3->queue) {
- ff_packet_list_get(&mp3->queue, &mp3->queue_end, &pkt);
+ avpriv_packet_list_get(&mp3->queue, &mp3->queue_end, &pkt);
if (write && (ret = mp3_write_audio_packet(s, &pkt)) < 0)
write = 0;
av_packet_unref(&pkt);
@@ -522,7 +523,7 @@ static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
if (pkt->stream_index == mp3->audio_stream_idx) {
if (mp3->pics_to_write) {
/* buffer audio packets until we get all the pictures */
- int ret = ff_packet_list_put(&mp3->queue, &mp3->queue_end, pkt, FF_PACKETLIST_FLAG_REF_PACKET);
+ int ret = avpriv_packet_list_put(&mp3->queue, &mp3->queue_end, pkt, av_packet_ref, 0);
if (ret < 0) {
av_log(s, AV_LOG_WARNING, "Not enough memory to buffer audio. Skipping picture streams\n");
@@ -630,7 +631,7 @@ static void mp3_deinit(struct AVFormatContext *s)
{
MP3Context *mp3 = s->priv_data;
- ff_packet_list_free(&mp3->queue, &mp3->queue_end);
+ avpriv_packet_list_free(&mp3->queue, &mp3->queue_end);
av_freep(&mp3->xing_frame);
}