From patchwork Fri Mar 5 16:32:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 26118 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id DB07444B9E2 for ; Fri, 5 Mar 2021 18:35:38 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BC21568AA26; Fri, 5 Mar 2021 18:35:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8624068A7E9 for ; Fri, 5 Mar 2021 18:35:30 +0200 (EET) Received: by mail-qt1-f179.google.com with SMTP id r24so2145079qtt.8 for ; Fri, 05 Mar 2021 08:35:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=5L6f8dtPEMJFLlaWo0t3pXue7S4NMLl4gqgygATw7Xo=; b=FupyJGV1YS1kuILObFtJZAIGVSvjKxj6H80l4S1Az6m5RVlIa2L38yIZgQznXeQSJQ c21DxrPP3kEn2iD69OarHzaYzDYCW+YUA/U1AYlO7OudVPodk1cbDLQEgisD0ocBNB/k jG8UYtXU7qlJZDeSL7Thva78XA1IbVPSjViTRsF1WH2+y7IhMejgaMASjvKZdAwRoq6c 3i4scE+MQ4uhIQf/VSt5bBI64tLOH1lQ6ayqbGi89uoQx2o5sa0tkgiFDCBimqaNpmPZ H52u1u31qRGvejPyOR8LzVcdmt2BxNwlI2DJc3F+uDbiSUj81sRgFUJPEqmzNN5H2VKh FCvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5L6f8dtPEMJFLlaWo0t3pXue7S4NMLl4gqgygATw7Xo=; b=B7Di2xK48Y7qRwFJy0kl4wJpELVHAe61q01ok/Oa8fZP16tFuefmOGIiFRyW/PQvF/ OnRp+a20E0Dt2muWfsD6Ok/2il19fOmHslIfxQHBeIT1Xx8DM6LUN85O2VqXfQhPkn08 uQUqjiiOsjwGOVh6psJcFUk/tIRbl7+tVlL0ChO64C6Jfch9IxEpZgEBWCK/J1WgHt5R qOzzMaF8AVbi8Aj78xknW+KR2/tNR+wT50HbCns17XhhF38wNK7c7NB+/jq5xxFv8Bu+ v8q6N3Jyi0kBdBf0PaU+sklsmwzbeaURgcQKpi2zwaqhB31CU7+jyn4ZFBdee9XfK4XT RZwA== X-Gm-Message-State: AOAM531fu1FYaXaJLknZ3zdrexieu/acChe66YlsT28uBltNuKBjyfvK NhxI6NnGS+CDsZBBcxHq1r2qnjZ/U4EP8A== X-Google-Smtp-Source: ABdhPJy6sLEytw+N/S5sK66wdePd61E4nPn/amsnnSiw762VVwMjz/mVgeEGFOKTDoUxe0ZQS65xBA== X-Received: by 2002:a05:622a:552:: with SMTP id m18mr9793837qtx.207.1614962128526; Fri, 05 Mar 2021 08:35:28 -0800 (PST) Received: from localhost.localdomain ([181.23.89.132]) by smtp.gmail.com with ESMTPSA id b10sm2168494qtt.23.2021.03.05.08.35.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 08:35:28 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Mar 2021 13:32:53 -0300 Message-Id: <20210305163339.63164-3-jamrial@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210305163339.63164-1-jamrial@gmail.com> References: <20210305163339.63164-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/48] avcodec/packet_internal: make avpriv_packet_list_* functions use an internal struct X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The next pointer is kept at the end for backwards compatibility until the major bump, when it should be moved at the front. Signed-off-by: James Almer --- libavcodec/avpacket.c | 18 +++++++++--------- libavcodec/packet_internal.h | 10 +++++++--- libavdevice/decklink_common.h | 2 +- libavdevice/decklink_dec.cpp | 9 +++++---- libavdevice/dshow.c | 10 +++++----- libavdevice/dshow_capture.h | 3 ++- libavdevice/vfwcap.c | 13 +++++++------ libavformat/aiffenc.c | 4 ++-- libavformat/flacenc.c | 2 +- libavformat/internal.h | 14 +++++++------- libavformat/matroskadec.c | 4 ++-- libavformat/mp3enc.c | 2 +- libavformat/mux.c | 11 ++++++----- libavformat/mxfenc.c | 7 ++++--- libavformat/ttaenc.c | 2 +- libavformat/utils.c | 14 +++++++------- 16 files changed, 67 insertions(+), 58 deletions(-) diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index ae0cbfb9f9..8c75c75f7b 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -733,13 +733,13 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif } -int avpriv_packet_list_put(AVPacketList **packet_buffer, - AVPacketList **plast_pktl, +int avpriv_packet_list_put(PacketList **packet_buffer, + PacketList **plast_pktl, AVPacket *pkt, int (*copy)(AVPacket *dst, const AVPacket *src), int flags) { - AVPacketList *pktl = av_mallocz(sizeof(AVPacketList)); + PacketList *pktl = av_mallocz(sizeof(PacketList)); int ret; if (!pktl) @@ -770,11 +770,11 @@ int avpriv_packet_list_put(AVPacketList **packet_buffer, return 0; } -int avpriv_packet_list_get(AVPacketList **pkt_buffer, - AVPacketList **pkt_buffer_end, +int avpriv_packet_list_get(PacketList **pkt_buffer, + PacketList **pkt_buffer_end, AVPacket *pkt) { - AVPacketList *pktl; + PacketList *pktl; if (!*pkt_buffer) return AVERROR(EAGAIN); pktl = *pkt_buffer; @@ -786,12 +786,12 @@ int avpriv_packet_list_get(AVPacketList **pkt_buffer, return 0; } -void avpriv_packet_list_free(AVPacketList **pkt_buf, AVPacketList **pkt_buf_end) +void avpriv_packet_list_free(PacketList **pkt_buf, PacketList **pkt_buf_end) { - AVPacketList *tmp = *pkt_buf; + PacketList *tmp = *pkt_buf; while (tmp) { - AVPacketList *pktl = tmp; + PacketList *pktl = tmp; tmp = pktl->next; av_packet_unref(&pktl->pkt); av_freep(&pktl); diff --git a/libavcodec/packet_internal.h b/libavcodec/packet_internal.h index 832ddb4a61..b1d91f6347 100644 --- a/libavcodec/packet_internal.h +++ b/libavcodec/packet_internal.h @@ -23,6 +23,10 @@ #include "packet.h" +typedef struct PacketList { + AVPacket pkt; + struct PacketList *next; +} PacketList; /** * Append an AVPacket to the list. @@ -37,7 +41,7 @@ * @return 0 on success, negative AVERROR value on failure. On failure, the packet and the list are unchanged. */ -int avpriv_packet_list_put(AVPacketList **head, AVPacketList **tail, +int avpriv_packet_list_put(PacketList **head, PacketList **tail, AVPacket *pkt, int (*copy)(AVPacket *dst, const AVPacket *src), int flags); @@ -54,7 +58,7 @@ int avpriv_packet_list_put(AVPacketList **head, AVPacketList **tail, * @return 0 on success, and a packet is returned. AVERROR(EAGAIN) if * the list was empty. */ -int avpriv_packet_list_get(AVPacketList **head, AVPacketList **tail, +int avpriv_packet_list_get(PacketList **head, PacketList **tail, AVPacket *pkt); /** @@ -63,7 +67,7 @@ int avpriv_packet_list_get(AVPacketList **head, AVPacketList **tail, * @param head List head element * @param tail List tail element */ -void avpriv_packet_list_free(AVPacketList **head, AVPacketList **tail); +void avpriv_packet_list_free(PacketList **head, PacketList **tail); int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type); diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h index e49d9d54ad..6e032956a8 100644 --- a/libavdevice/decklink_common.h +++ b/libavdevice/decklink_common.h @@ -75,7 +75,7 @@ class decklink_output_callback; class decklink_input_callback; typedef struct AVPacketQueue { - AVPacketList *first_pkt, *last_pkt; + PacketList *first_pkt, *last_pkt; int nb_packets; unsigned long long size; int abort_request; diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp index 4f8103e614..5acb2e8fbb 100644 --- a/libavdevice/decklink_dec.cpp +++ b/libavdevice/decklink_dec.cpp @@ -35,6 +35,7 @@ extern "C" { extern "C" { #include "config.h" +#include "libavcodec/packet_internal.h" #include "libavformat/avformat.h" #include "libavutil/avassert.h" #include "libavutil/avutil.h" @@ -481,7 +482,7 @@ static void avpacket_queue_init(AVFormatContext *avctx, AVPacketQueue *q) static void avpacket_queue_flush(AVPacketQueue *q) { - AVPacketList *pkt, *pkt1; + PacketList *pkt, *pkt1; pthread_mutex_lock(&q->mutex); for (pkt = q->first_pkt; pkt != NULL; pkt = pkt1) { @@ -514,7 +515,7 @@ static unsigned long long avpacket_queue_size(AVPacketQueue *q) static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt) { - AVPacketList *pkt1; + PacketList *pkt1; // Drop Packet if queue size is > maximum queue size if (avpacket_queue_size(q) > (uint64_t)q->max_q_size) { @@ -528,7 +529,7 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt) return -1; } - pkt1 = (AVPacketList *)av_malloc(sizeof(AVPacketList)); + pkt1 = (PacketList *)av_malloc(sizeof(PacketList)); if (!pkt1) { av_packet_unref(pkt); return -1; @@ -556,7 +557,7 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt) static int avpacket_queue_get(AVPacketQueue *q, AVPacket *pkt, int block) { - AVPacketList *pkt1; + PacketList *pkt1; int ret; pthread_mutex_lock(&q->mutex); diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index a16764d74c..73a9a48b20 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -58,7 +58,7 @@ static int dshow_read_close(AVFormatContext *s) { struct dshow_ctx *ctx = s->priv_data; - AVPacketList *pktl; + PacketList *pktl; if (ctx->control) { IMediaControl_Stop(ctx->control); @@ -118,7 +118,7 @@ dshow_read_close(AVFormatContext *s) pktl = ctx->pktl; while (pktl) { - AVPacketList *next = pktl->next; + PacketList *next = pktl->next; av_packet_unref(&pktl->pkt); av_free(pktl); pktl = next; @@ -162,7 +162,7 @@ callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, e { AVFormatContext *s = priv_data; struct dshow_ctx *ctx = s->priv_data; - AVPacketList **ppktl, *pktl_next; + PacketList **ppktl, *pktl_next; // dump_videohdr(s, vdhdr); @@ -171,7 +171,7 @@ callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, e if(shall_we_drop(s, index, devtype)) goto fail; - pktl_next = av_mallocz(sizeof(AVPacketList)); + pktl_next = av_mallocz(sizeof(PacketList)); if(!pktl_next) goto fail; @@ -1262,7 +1262,7 @@ static int dshow_check_event_queue(IMediaEvent *media_event) static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt) { struct dshow_ctx *ctx = s->priv_data; - AVPacketList *pktl = NULL; + PacketList *pktl = NULL; while (!ctx->eof && !pktl) { WaitForSingleObject(ctx->mutex, INFINITE); diff --git a/libavdevice/dshow_capture.h b/libavdevice/dshow_capture.h index 710b65cc85..06ded2ba96 100644 --- a/libavdevice/dshow_capture.h +++ b/libavdevice/dshow_capture.h @@ -34,6 +34,7 @@ #include #include "libavcodec/internal.h" +#include "libavcodec/packet_internal.h" /* EC_DEVICE_LOST is not defined in MinGW dshow headers. */ #ifndef EC_DEVICE_LOST @@ -320,7 +321,7 @@ struct dshow_ctx { HANDLE mutex; HANDLE event[2]; /* event[0] is set by DirectShow * event[1] is set by callback() */ - AVPacketList *pktl; + PacketList *pktl; int eof; diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c index e2ab276c2e..b3ef5f3448 100644 --- a/libavdevice/vfwcap.c +++ b/libavdevice/vfwcap.c @@ -24,6 +24,7 @@ #include "libavutil/opt.h" #include "libavutil/parseutils.h" +#include "libavcodec/packet_internal.h" #include "libavformat/internal.h" // windows.h must no be included before winsock2.h, and libavformat internal @@ -44,7 +45,7 @@ struct vfw_ctx { HWND hwnd; HANDLE mutex; HANDLE event; - AVPacketList *pktl; + PacketList *pktl; unsigned int curbufsize; unsigned int frame_num; char *video_size; /**< A string describing video size, set by a private option. */ @@ -178,7 +179,7 @@ static LRESULT CALLBACK videostream_cb(HWND hwnd, LPVIDEOHDR vdhdr) { AVFormatContext *s; struct vfw_ctx *ctx; - AVPacketList **ppktl, *pktl_next; + PacketList **ppktl, *pktl_next; s = (AVFormatContext *) GetWindowLongPtr(hwnd, GWLP_USERDATA); ctx = s->priv_data; @@ -190,7 +191,7 @@ static LRESULT CALLBACK videostream_cb(HWND hwnd, LPVIDEOHDR vdhdr) WaitForSingleObject(ctx->mutex, INFINITE); - pktl_next = av_mallocz(sizeof(AVPacketList)); + pktl_next = av_mallocz(sizeof(PacketList)); if(!pktl_next) goto fail; @@ -219,7 +220,7 @@ fail: static int vfw_read_close(AVFormatContext *s) { struct vfw_ctx *ctx = s->priv_data; - AVPacketList *pktl; + PacketList *pktl; if(ctx->hwnd) { SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0); @@ -233,7 +234,7 @@ static int vfw_read_close(AVFormatContext *s) pktl = ctx->pktl; while (pktl) { - AVPacketList *next = pktl->next; + PacketList *next = pktl->next; av_packet_unref(&pktl->pkt); av_free(pktl); pktl = next; @@ -439,7 +440,7 @@ fail: static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt) { struct vfw_ctx *ctx = s->priv_data; - AVPacketList *pktl = NULL; + PacketList *pktl = NULL; while(!pktl) { WaitForSingleObject(ctx->mutex, INFINITE); diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c index 53a2f97e22..06e475cddb 100644 --- a/libavformat/aiffenc.c +++ b/libavformat/aiffenc.c @@ -37,7 +37,7 @@ typedef struct AIFFOutputContext { int64_t frames; int64_t ssnd; int audio_stream_idx; - AVPacketList *pict_list, *pict_list_end; + PacketList *pict_list, *pict_list_end; int write_id3v2; int id3v2_version; } AIFFOutputContext; @@ -48,7 +48,7 @@ static int put_id3v2_tags(AVFormatContext *s, AIFFOutputContext *aiff) uint64_t pos, end, size; ID3v2EncContext id3v2 = { 0 }; AVIOContext *pb = s->pb; - AVPacketList *pict_list = aiff->pict_list; + PacketList *pict_list = aiff->pict_list; if (!s->metadata && !s->nb_chapters && !aiff->pict_list) return 0; diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c index 1c983486aa..ec9f4ab43e 100644 --- a/libavformat/flacenc.c +++ b/libavformat/flacenc.c @@ -39,7 +39,7 @@ typedef struct FlacMuxerContext { int audio_stream_idx; int waiting_pics; /* audio packets are queued here until we get all the attached pictures */ - AVPacketList *queue, *queue_end; + PacketList *queue, *queue_end; /* updated streaminfo sent by the encoder at the end */ uint8_t streaminfo[FLAC_STREAMINFO_SIZE]; diff --git a/libavformat/internal.h b/libavformat/internal.h index 0ffdc87b6a..e913d958fc 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -73,8 +73,8 @@ struct AVFormatInternal { * not decoded, for example to get the codec parameters in MPEG * streams. */ - struct AVPacketList *packet_buffer; - struct AVPacketList *packet_buffer_end; + struct PacketList *packet_buffer; + struct PacketList *packet_buffer_end; /* av_seek_frame() support */ int64_t data_offset; /**< offset of the first packet */ @@ -85,13 +85,13 @@ struct AVFormatInternal { * be identified, as parsing cannot be done without knowing the * codec. */ - struct AVPacketList *raw_packet_buffer; - struct AVPacketList *raw_packet_buffer_end; + struct PacketList *raw_packet_buffer; + struct PacketList *raw_packet_buffer_end; /** * Packets split by the parser get queued here. */ - struct AVPacketList *parse_queue; - struct AVPacketList *parse_queue_end; + struct PacketList *parse_queue; + struct PacketList *parse_queue_end; /** * Remaining size available for raw_packet_buffer, in bytes. */ @@ -347,7 +347,7 @@ struct AVStreamInternal { /** * last packet in packet_buffer for this stream when muxing. */ - struct AVPacketList *last_in_packet_buffer; + struct PacketList *last_in_packet_buffer; }; #ifdef __GNUC__ diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 25eca5825e..9a65774464 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -382,8 +382,8 @@ typedef struct MatroskaDemuxContext { int64_t segment_start; /* the packet queue */ - AVPacketList *queue; - AVPacketList *queue_end; + PacketList *queue; + PacketList *queue_end; int done; diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index 4f91c4f1c3..e939eb752f 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -132,7 +132,7 @@ typedef struct MP3Context { int pics_to_write; /* audio packets are queued here until we get all the attached pictures */ - AVPacketList *queue, *queue_end; + PacketList *queue, *queue_end; } MP3Context; static const uint8_t xing_offtbl[2][2] = {{32, 17}, {17, 9}}; diff --git a/libavformat/mux.c b/libavformat/mux.c index 062ba8d789..440113b149 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -22,6 +22,7 @@ #include "avformat.h" #include "internal.h" #include "libavcodec/internal.h" +#include "libavcodec/packet_internal.h" #include "libavutil/opt.h" #include "libavutil/dict.h" #include "libavutil/pixdesc.h" @@ -830,11 +831,11 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, int (*compare)(AVFormatContext *, const AVPacket *, const AVPacket *)) { int ret; - AVPacketList **next_point, *this_pktl; + PacketList **next_point, *this_pktl; AVStream *st = s->streams[pkt->stream_index]; int chunked = s->max_chunk_size || s->max_chunk_duration; - this_pktl = av_malloc(sizeof(AVPacketList)); + this_pktl = av_malloc(sizeof(PacketList)); if (!this_pktl) { av_packet_unref(pkt); return AVERROR(ENOMEM); @@ -931,7 +932,7 @@ static int interleave_compare_dts(AVFormatContext *s, const AVPacket *next, int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush) { - AVPacketList *pktl; + PacketList *pktl; int stream_count = 0; int noninterleaved_count = 0; int i, ret; @@ -968,7 +969,7 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, for (i = 0; i < s->nb_streams; i++) { int64_t last_dts; - const AVPacketList *last = s->streams[i]->internal->last_in_packet_buffer; + const PacketList *last = s->streams[i]->internal->last_in_packet_buffer; if (!last) continue; @@ -1064,7 +1065,7 @@ int ff_get_muxer_ts_offset(AVFormatContext *s, int stream_index, int64_t *offset const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream) { - AVPacketList *pktl = s->internal->packet_buffer; + PacketList *pktl = s->internal->packet_buffer; while (pktl) { if (pktl->pkt.stream_index == stream) { return &pktl->pkt; diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 1c668998e2..7a16bf9155 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -53,6 +53,7 @@ #include "libavcodec/h264_ps.h" #include "libavcodec/golomb.h" #include "libavcodec/internal.h" +#include "libavcodec/packet_internal.h" #include "avformat.h" #include "avio_internal.h" #include "internal.h" @@ -3104,9 +3105,9 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket stream_count += !!s->streams[i]->internal->last_in_packet_buffer; if (stream_count && (s->nb_streams == stream_count || flush)) { - AVPacketList *pktl = s->internal->packet_buffer; + PacketList *pktl = s->internal->packet_buffer; if (s->nb_streams != stream_count) { - AVPacketList *last = NULL; + PacketList *last = NULL; // find last packet in edit unit while (pktl) { if (!stream_count || pktl->pkt.stream_index == 0) @@ -3120,7 +3121,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket } // purge packet queue while (pktl) { - AVPacketList *next = pktl->next; + PacketList *next = pktl->next; av_packet_unref(&pktl->pkt); av_freep(&pktl); pktl = next; diff --git a/libavformat/ttaenc.c b/libavformat/ttaenc.c index 92f5053d52..32eb269040 100644 --- a/libavformat/ttaenc.c +++ b/libavformat/ttaenc.c @@ -30,7 +30,7 @@ typedef struct TTAMuxContext { AVIOContext *seek_table; - AVPacketList *queue, *queue_end; + PacketList *queue, *queue_end; uint32_t nb_samples; int frame_size; int last_frame; diff --git a/libavformat/utils.c b/libavformat/utils.c index 36164e0f0d..73b1a9b52c 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -812,7 +812,7 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) av_init_packet(pkt); for (;;) { - AVPacketList *pktl = s->internal->raw_packet_buffer; + PacketList *pktl = s->internal->raw_packet_buffer; const AVPacket *pkt1; if (pktl) { @@ -1020,7 +1020,7 @@ static int has_decode_delay_been_guessed(AVStream *st) return st->internal->nb_decoded_frames >= 20; } -static AVPacketList *get_next_pkt(AVFormatContext *s, AVStream *st, AVPacketList *pktl) +static PacketList *get_next_pkt(AVFormatContext *s, AVStream *st, PacketList *pktl) { if (pktl->next) return pktl->next; @@ -1076,7 +1076,7 @@ static int64_t select_from_pts_buffer(AVStream *st, int64_t *pts_buffer, int64_t * of the packets in a window. */ static void update_dts_from_pts(AVFormatContext *s, int stream_index, - AVPacketList *pkt_buffer) + PacketList *pkt_buffer) { AVStream *st = s->streams[stream_index]; int delay = st->internal->avctx->has_b_frames; @@ -1105,8 +1105,8 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index, int64_t dts, int64_t pts, AVPacket *pkt) { AVStream *st = s->streams[stream_index]; - AVPacketList *pktl = s->internal->packet_buffer ? s->internal->packet_buffer : s->internal->parse_queue; - AVPacketList *pktl_it; + PacketList *pktl = s->internal->packet_buffer ? s->internal->packet_buffer : s->internal->parse_queue; + PacketList *pktl_it; uint64_t shift; @@ -1157,7 +1157,7 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index, static void update_initial_durations(AVFormatContext *s, AVStream *st, int stream_index, int64_t duration) { - AVPacketList *pktl = s->internal->packet_buffer ? s->internal->packet_buffer : s->internal->parse_queue; + PacketList *pktl = s->internal->packet_buffer ? s->internal->packet_buffer : s->internal->parse_queue; int64_t cur_dts = RELATIVE_TS_BASE; if (st->first_dts != AV_NOPTS_VALUE) { @@ -1742,7 +1742,7 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) } for (;;) { - AVPacketList *pktl = s->internal->packet_buffer; + PacketList *pktl = s->internal->packet_buffer; if (pktl) { AVPacket *next_pkt = &pktl->pkt;