History

avcodec/packet_internal: make avpriv_packet_list_* functions use an internal struct

The next pointer is kept at the end for backwards compatability until the major bump, when it should ideally be moved at the front.

James Almer committed 5 years ago

Commit d422b2e1 parent f7db77b16 files · +67 −58Browse files

Unified · Split

16 files
  1. libavcodec/avpacket.c +9 −9
  2. libavcodec/packet_internal.h +7 −3
  3. libavdevice/decklink_common.h +1 −1
  4. libavdevice/decklink_dec.cpp +5 −4
  5. libavdevice/dshow.c +5 −5
  6. libavdevice/dshow_capture.h +2 −1
  7. libavdevice/vfwcap.c +7 −6
  8. libavformat/aiffenc.c +2 −2
  9. libavformat/flacenc.c +1 −1
  10. libavformat/internal.h +7 −7
  11. libavformat/matroskadec.c +2 −2
  12. libavformat/mp3enc.c +1 −1
  13. libavformat/mux.c +6 −5
  14. libavformat/mxfenc.c +4 −3
  15. libavformat/ttaenc.c +1 −1
  16. libavformat/utils.c +7 −7
libavcodec/avpacket.c+9−9
@@ -737,13 +737,13 @@ FF_ENABLE_DEPRECATION_WARNINGS · 736 unmodified lines
737#endif737#endif
738}738}
739 739
740int avpriv_packet_list_put(AVPacketList **packet_buffer,740int avpriv_packet_list_put(PacketList **packet_buffer,
741 AVPacketList **plast_pktl,741 PacketList **plast_pktl,
742 AVPacket *pkt,742 AVPacket *pkt,
743 int (*copy)(AVPacket *dst, const AVPacket *src),743 int (*copy)(AVPacket *dst, const AVPacket *src),
744 int flags)744 int flags)
745{745{
746 AVPacketList *pktl = av_mallocz(sizeof(AVPacketList));746 PacketList *pktl = av_mallocz(sizeof(PacketList));
747 int ret;747 int ret;
748 748
749 if (!pktl)749 if (!pktl)
@@ -774,11 +774,11 @@ int avpriv_packet_list_put(AVPacketList **packet_buffer, · 24 unmodified lines
774 return 0;774 return 0;
775}775}
776 776
777int avpriv_packet_list_get(AVPacketList **pkt_buffer,777int avpriv_packet_list_get(PacketList **pkt_buffer,
778 AVPacketList **pkt_buffer_end,778 PacketList **pkt_buffer_end,
779 AVPacket *pkt)779 AVPacket *pkt)
780{780{
781 AVPacketList *pktl;781 PacketList *pktl;
782 if (!*pkt_buffer)782 if (!*pkt_buffer)
783 return AVERROR(EAGAIN);783 return AVERROR(EAGAIN);
784 pktl = *pkt_buffer;784 pktl = *pkt_buffer;
@@ -790,12 +790,12 @@ int avpriv_packet_list_get(AVPacketList **pkt_buffer, · 5 unmodified lines
790 return 0;790 return 0;
791}791}
792 792
793void avpriv_packet_list_free(AVPacketList **pkt_buf, AVPacketList **pkt_buf_end)793void avpriv_packet_list_free(PacketList **pkt_buf, PacketList **pkt_buf_end)
794{794{
795 AVPacketList *tmp = *pkt_buf;795 PacketList *tmp = *pkt_buf;
796 796
797 while (tmp) {797 while (tmp) {
798 AVPacketList *pktl = tmp;798 PacketList *pktl = tmp;
799 tmp = pktl->next;799 tmp = pktl->next;
800 av_packet_unref(&pktl->pkt);800 av_packet_unref(&pktl->pkt);
801 av_freep(&pktl);801 av_freep(&pktl);
libavcodec/packet_internal.h+7−3
@@ -23,6 +23,10 @@ · 22 unmodified lines
23 23
24#include "packet.h"24#include "packet.h"
25 25
26typedef struct PacketList {
27 AVPacket pkt;
28 struct PacketList *next;
29} PacketList;
26 30
27/**31/**
28 * Append an AVPacket to the list.32 * Append an AVPacket to the list.
@@ -37,7 +41,7 @@ · 8 unmodified lines
37 * @return 0 on success, negative AVERROR value on failure. On failure,41 * @return 0 on success, negative AVERROR value on failure. On failure,
38 the packet and the list are unchanged.42 the packet and the list are unchanged.
39 */43 */
40int avpriv_packet_list_put(AVPacketList **head, AVPacketList **tail,44int avpriv_packet_list_put(PacketList **head, PacketList **tail,
41 AVPacket *pkt,45 AVPacket *pkt,
42 int (*copy)(AVPacket *dst, const AVPacket *src),46 int (*copy)(AVPacket *dst, const AVPacket *src),
43 int flags);47 int flags);
@@ -54,7 +58,7 @@ int avpriv_packet_list_put(AVPacketList **head, AVPacketList **tail, · 10 unmodified lines
54 * @return 0 on success, and a packet is returned. AVERROR(EAGAIN) if58 * @return 0 on success, and a packet is returned. AVERROR(EAGAIN) if
55 * the list was empty.59 * the list was empty.
56 */60 */
57int avpriv_packet_list_get(AVPacketList **head, AVPacketList **tail,61int avpriv_packet_list_get(PacketList **head, PacketList **tail,
58 AVPacket *pkt);62 AVPacket *pkt);
59 63
60/**64/**
@@ -63,7 +67,7 @@ int avpriv_packet_list_get(AVPacketList **head, AVPacketList **tail, · 2 unmodified lines
63 * @param head List head element67 * @param head List head element
64 * @param tail List tail element68 * @param tail List tail element
65 */69 */
66void avpriv_packet_list_free(AVPacketList **head, AVPacketList **tail);70void avpriv_packet_list_free(PacketList **head, PacketList **tail);
67 71
68int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type);72int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type);
69 73
libavdevice/decklink_common.h+1−1
@@ -75,7 +75,7 @@ class decklink_output_callback; · 74 unmodified lines
75class decklink_input_callback;75class decklink_input_callback;
76 76
77typedef struct AVPacketQueue {77typedef struct AVPacketQueue {
78 AVPacketList *first_pkt, *last_pkt;78 PacketList *first_pkt, *last_pkt;
79 int nb_packets;79 int nb_packets;
80 unsigned long long size;80 unsigned long long size;
81 int abort_request;81 int abort_request;
libavdevice/decklink_dec.cpp+5−4
@@ -35,6 +35,7 @@ extern "C" { · 34 unmodified lines
35 35
36extern "C" {36extern "C" {
37#include "config.h"37#include "config.h"
38#include "libavcodec/packet_internal.h"
38#include "libavformat/avformat.h"39#include "libavformat/avformat.h"
39#include "libavutil/avassert.h"40#include "libavutil/avassert.h"
40#include "libavutil/avutil.h"41#include "libavutil/avutil.h"
@@ -482,7 +483,7 @@ static void avpacket_queue_init(AVFormatContext *avctx, AVPacketQueue *q) · 441 unmodified lines
482 483
483static void avpacket_queue_flush(AVPacketQueue *q)484static void avpacket_queue_flush(AVPacketQueue *q)
484{485{
485 AVPacketList *pkt, *pkt1;486 PacketList *pkt, *pkt1;
486 487
487 pthread_mutex_lock(&q->mutex);488 pthread_mutex_lock(&q->mutex);
488 for (pkt = q->first_pkt; pkt != NULL; pkt = pkt1) {489 for (pkt = q->first_pkt; pkt != NULL; pkt = pkt1) {
@@ -515,7 +516,7 @@ static unsigned long long avpacket_queue_size(AVPacketQueue *q) · 26 unmodified lines
515 516
516static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt)517static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt)
517{518{
518 AVPacketList *pkt1;519 PacketList *pkt1;
519 520
520 // Drop Packet if queue size is > maximum queue size521 // Drop Packet if queue size is > maximum queue size
521 if (avpacket_queue_size(q) > (uint64_t)q->max_q_size) {522 if (avpacket_queue_size(q) > (uint64_t)q->max_q_size) {
@@ -529,7 +530,7 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt) · 7 unmodified lines
529 return -1;530 return -1;
530 }531 }
531 532
532 pkt1 = (AVPacketList *)av_malloc(sizeof(AVPacketList));533 pkt1 = (PacketList *)av_malloc(sizeof(PacketList));
533 if (!pkt1) {534 if (!pkt1) {
534 av_packet_unref(pkt);535 av_packet_unref(pkt);
535 return -1;536 return -1;
@@ -557,7 +558,7 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt) · 21 unmodified lines
557 558
558static int avpacket_queue_get(AVPacketQueue *q, AVPacket *pkt, int block)559static int avpacket_queue_get(AVPacketQueue *q, AVPacket *pkt, int block)
559{560{
560 AVPacketList *pkt1;561 PacketList *pkt1;
561 int ret;562 int ret;
562 563
563 pthread_mutex_lock(&q->mutex);564 pthread_mutex_lock(&q->mutex);
libavdevice/dshow.c+5−5
@@ -58,7 +58,7 @@ static int · 57 unmodified lines
58dshow_read_close(AVFormatContext *s)58dshow_read_close(AVFormatContext *s)
59{59{
60 struct dshow_ctx *ctx = s->priv_data;60 struct dshow_ctx *ctx = s->priv_data;
61 AVPacketList *pktl;61 PacketList *pktl;
62 62
63 if (ctx->control) {63 if (ctx->control) {
64 IMediaControl_Stop(ctx->control);64 IMediaControl_Stop(ctx->control);
@@ -118,7 +118,7 @@ dshow_read_close(AVFormatContext *s) · 53 unmodified lines
118 118
119 pktl = ctx->pktl;119 pktl = ctx->pktl;
120 while (pktl) {120 while (pktl) {
121 AVPacketList *next = pktl->next;121 PacketList *next = pktl->next;
122 av_packet_unref(&pktl->pkt);122 av_packet_unref(&pktl->pkt);
123 av_free(pktl);123 av_free(pktl);
124 pktl = next;124 pktl = next;
@@ -162,7 +162,7 @@ callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, e · 37 unmodified lines
162{162{
163 AVFormatContext *s = priv_data;163 AVFormatContext *s = priv_data;
164 struct dshow_ctx *ctx = s->priv_data;164 struct dshow_ctx *ctx = s->priv_data;
165 AVPacketList **ppktl, *pktl_next;165 PacketList **ppktl, *pktl_next;
166 166
167// dump_videohdr(s, vdhdr);167// dump_videohdr(s, vdhdr);
168 168
@@ -171,7 +171,7 @@ callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, e · 2 unmodified lines
171 if(shall_we_drop(s, index, devtype))171 if(shall_we_drop(s, index, devtype))
172 goto fail;172 goto fail;
173 173
174 pktl_next = av_mallocz(sizeof(AVPacketList));174 pktl_next = av_mallocz(sizeof(PacketList));
175 if(!pktl_next)175 if(!pktl_next)
176 goto fail;176 goto fail;
177 177
@@ -1262,7 +1262,7 @@ static int dshow_check_event_queue(IMediaEvent *media_event) · 1084 unmodified lines
1262static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)1262static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
1263{1263{
1264 struct dshow_ctx *ctx = s->priv_data;1264 struct dshow_ctx *ctx = s->priv_data;
1265 AVPacketList *pktl = NULL;1265 PacketList *pktl = NULL;
1266 1266
1267 while (!ctx->eof && !pktl) {1267 while (!ctx->eof && !pktl) {
1268 WaitForSingleObject(ctx->mutex, INFINITE);1268 WaitForSingleObject(ctx->mutex, INFINITE);
libavdevice/dshow_capture.h+2−1
@@ -34,6 +34,7 @@ · 33 unmodified lines
34#include <dvdmedia.h>34#include <dvdmedia.h>
35 35
36#include "libavcodec/internal.h"36#include "libavcodec/internal.h"
37#include "libavcodec/packet_internal.h"
37 38
38/* EC_DEVICE_LOST is not defined in MinGW dshow headers. */39/* EC_DEVICE_LOST is not defined in MinGW dshow headers. */
39#ifndef EC_DEVICE_LOST40#ifndef EC_DEVICE_LOST
@@ -320,7 +321,7 @@ struct dshow_ctx { · 280 unmodified lines
320 HANDLE mutex;321 HANDLE mutex;
321 HANDLE event[2]; /* event[0] is set by DirectShow322 HANDLE event[2]; /* event[0] is set by DirectShow
322 * event[1] is set by callback() */323 * event[1] is set by callback() */
323 AVPacketList *pktl;324 PacketList *pktl;
324 325
325 int eof;326 int eof;
326 327
libavdevice/vfwcap.c+7−6
@@ -24,6 +24,7 @@ · 23 unmodified lines
24#include "libavutil/opt.h"24#include "libavutil/opt.h"
25#include "libavutil/parseutils.h"25#include "libavutil/parseutils.h"
26 26
27#include "libavcodec/packet_internal.h"
27#include "libavformat/internal.h"28#include "libavformat/internal.h"
28 29
29// windows.h must no be included before winsock2.h, and libavformat internal30// windows.h must no be included before winsock2.h, and libavformat internal
@@ -44,7 +45,7 @@ struct vfw_ctx { · 14 unmodified lines
44 HWND hwnd;45 HWND hwnd;
45 HANDLE mutex;46 HANDLE mutex;
46 HANDLE event;47 HANDLE event;
47 AVPacketList *pktl;48 PacketList *pktl;
48 unsigned int curbufsize;49 unsigned int curbufsize;
49 unsigned int frame_num;50 unsigned int frame_num;
50 char *video_size; /**< A string describing video size, set by a private option. */51 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) · 127 unmodified lines
178{179{
179 AVFormatContext *s;180 AVFormatContext *s;
180 struct vfw_ctx *ctx;181 struct vfw_ctx *ctx;
181 AVPacketList **ppktl, *pktl_next;182 PacketList **ppktl, *pktl_next;
182 183
183 s = (AVFormatContext *) GetWindowLongPtr(hwnd, GWLP_USERDATA);184 s = (AVFormatContext *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
184 ctx = s->priv_data;185 ctx = s->priv_data;
@@ -190,7 +191,7 @@ static LRESULT CALLBACK videostream_cb(HWND hwnd, LPVIDEOHDR vdhdr) · 5 unmodified lines
190 191
191 WaitForSingleObject(ctx->mutex, INFINITE);192 WaitForSingleObject(ctx->mutex, INFINITE);
192 193
193 pktl_next = av_mallocz(sizeof(AVPacketList));194 pktl_next = av_mallocz(sizeof(PacketList));
194 if(!pktl_next)195 if(!pktl_next)
195 goto fail;196 goto fail;
196 197
@@ -219,7 +220,7 @@ fail: · 22 unmodified lines
219static int vfw_read_close(AVFormatContext *s)220static int vfw_read_close(AVFormatContext *s)
220{221{
221 struct vfw_ctx *ctx = s->priv_data;222 struct vfw_ctx *ctx = s->priv_data;
222 AVPacketList *pktl;223 PacketList *pktl;
223 224
224 if(ctx->hwnd) {225 if(ctx->hwnd) {
225 SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);226 SendMessage(ctx->hwnd, WM_CAP_SET_CALLBACK_VIDEOSTREAM, 0, 0);
@@ -233,7 +234,7 @@ static int vfw_read_close(AVFormatContext *s) · 7 unmodified lines
233 234
234 pktl = ctx->pktl;235 pktl = ctx->pktl;
235 while (pktl) {236 while (pktl) {
236 AVPacketList *next = pktl->next;237 PacketList *next = pktl->next;
237 av_packet_unref(&pktl->pkt);238 av_packet_unref(&pktl->pkt);
238 av_free(pktl);239 av_free(pktl);
239 pktl = next;240 pktl = next;
@@ -439,7 +440,7 @@ fail: · 199 unmodified lines
439static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt)440static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt)
440{441{
441 struct vfw_ctx *ctx = s->priv_data;442 struct vfw_ctx *ctx = s->priv_data;
442 AVPacketList *pktl = NULL;443 PacketList *pktl = NULL;
443 444
444 while(!pktl) {445 while(!pktl) {
445 WaitForSingleObject(ctx->mutex, INFINITE);446 WaitForSingleObject(ctx->mutex, INFINITE);
libavformat/aiffenc.c+2−2
@@ -37,7 +37,7 @@ typedef struct AIFFOutputContext { · 36 unmodified lines
37 int64_t frames;37 int64_t frames;
38 int64_t ssnd;38 int64_t ssnd;
39 int audio_stream_idx;39 int audio_stream_idx;
40 AVPacketList *pict_list, *pict_list_end;40 PacketList *pict_list, *pict_list_end;
41 int write_id3v2;41 int write_id3v2;
42 int id3v2_version;42 int id3v2_version;
43} AIFFOutputContext;43} AIFFOutputContext;
@@ -48,7 +48,7 @@ static int put_id3v2_tags(AVFormatContext *s, AIFFOutputContext *aiff) · 4 unmodified lines
48 uint64_t pos, end, size;48 uint64_t pos, end, size;
49 ID3v2EncContext id3v2 = { 0 };49 ID3v2EncContext id3v2 = { 0 };
50 AVIOContext *pb = s->pb;50 AVIOContext *pb = s->pb;
51 AVPacketList *pict_list = aiff->pict_list;51 PacketList *pict_list = aiff->pict_list;
52 52
53 if (!s->metadata && !s->nb_chapters && !aiff->pict_list)53 if (!s->metadata && !s->nb_chapters && !aiff->pict_list)
54 return 0;54 return 0;
libavformat/flacenc.c+1−1
@@ -39,7 +39,7 @@ typedef struct FlacMuxerContext { · 38 unmodified lines
39 int audio_stream_idx;39 int audio_stream_idx;
40 int waiting_pics;40 int waiting_pics;
41 /* audio packets are queued here until we get all the attached pictures */41 /* audio packets are queued here until we get all the attached pictures */
42 AVPacketList *queue, *queue_end;42 PacketList *queue, *queue_end;
43 43
44 /* updated streaminfo sent by the encoder at the end */44 /* updated streaminfo sent by the encoder at the end */
45 uint8_t streaminfo[FLAC_STREAMINFO_SIZE];45 uint8_t streaminfo[FLAC_STREAMINFO_SIZE];
libavformat/internal.h+7−7
@@ -73,8 +73,8 @@ struct AVFormatInternal { · 72 unmodified lines
73 * not decoded, for example to get the codec parameters in MPEG73 * not decoded, for example to get the codec parameters in MPEG
74 * streams.74 * streams.
75 */75 */
76 struct AVPacketList *packet_buffer;76 struct PacketList *packet_buffer;
77 struct AVPacketList *packet_buffer_end;77 struct PacketList *packet_buffer_end;
78 78
79 /* av_seek_frame() support */79 /* av_seek_frame() support */
80 int64_t data_offset; /**< offset of the first packet */80 int64_t data_offset; /**< offset of the first packet */
@@ -85,13 +85,13 @@ struct AVFormatInternal { · 4 unmodified lines
85 * be identified, as parsing cannot be done without knowing the85 * be identified, as parsing cannot be done without knowing the
86 * codec.86 * codec.
87 */87 */
88 struct AVPacketList *raw_packet_buffer;88 struct PacketList *raw_packet_buffer;
89 struct AVPacketList *raw_packet_buffer_end;89 struct PacketList *raw_packet_buffer_end;
90 /**90 /**
91 * Packets split by the parser get queued here.91 * Packets split by the parser get queued here.
92 */92 */
93 struct AVPacketList *parse_queue;93 struct PacketList *parse_queue;
94 struct AVPacketList *parse_queue_end;94 struct PacketList *parse_queue_end;
95 /**95 /**
96 * Remaining size available for raw_packet_buffer, in bytes.96 * Remaining size available for raw_packet_buffer, in bytes.
97 */97 */
@@ -347,7 +347,7 @@ struct AVStreamInternal { · 249 unmodified lines
347 /**347 /**
348 * last packet in packet_buffer for this stream when muxing.348 * last packet in packet_buffer for this stream when muxing.
349 */349 */
350 struct AVPacketList *last_in_packet_buffer;350 struct PacketList *last_in_packet_buffer;
351};351};
352 352
353#ifdef __GNUC__353#ifdef __GNUC__
libavformat/matroskadec.c+2−2
@@ -382,8 +382,8 @@ typedef struct MatroskaDemuxContext { · 381 unmodified lines
382 int64_t segment_start;382 int64_t segment_start;
383 383
384 /* the packet queue */384 /* the packet queue */
385 AVPacketList *queue;385 PacketList *queue;
386 AVPacketList *queue_end;386 PacketList *queue_end;
387 387
388 int done;388 int done;
389 389
libavformat/mp3enc.c+1−1
@@ -132,7 +132,7 @@ typedef struct MP3Context { · 131 unmodified lines
132 int pics_to_write;132 int pics_to_write;
133 133
134 /* audio packets are queued here until we get all the attached pictures */134 /* audio packets are queued here until we get all the attached pictures */
135 AVPacketList *queue, *queue_end;135 PacketList *queue, *queue_end;
136} MP3Context;136} MP3Context;
137 137
138static const uint8_t xing_offtbl[2][2] = {{32, 17}, {17, 9}};138static const uint8_t xing_offtbl[2][2] = {{32, 17}, {17, 9}};
libavformat/mux.c+6−5
@@ -22,6 +22,7 @@ · 21 unmodified lines
22#include "avformat.h"22#include "avformat.h"
23#include "internal.h"23#include "internal.h"
24#include "libavcodec/internal.h"24#include "libavcodec/internal.h"
25#include "libavcodec/packet_internal.h"
25#include "libavutil/opt.h"26#include "libavutil/opt.h"
26#include "libavutil/dict.h"27#include "libavutil/dict.h"
27#include "libavutil/pixdesc.h"28#include "libavutil/pixdesc.h"
@@ -830,11 +831,11 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, · 802 unmodified lines
830 int (*compare)(AVFormatContext *, const AVPacket *, const AVPacket *))831 int (*compare)(AVFormatContext *, const AVPacket *, const AVPacket *))
831{832{
832 int ret;833 int ret;
833 AVPacketList **next_point, *this_pktl;834 PacketList **next_point, *this_pktl;
834 AVStream *st = s->streams[pkt->stream_index];835 AVStream *st = s->streams[pkt->stream_index];
835 int chunked = s->max_chunk_size || s->max_chunk_duration;836 int chunked = s->max_chunk_size || s->max_chunk_duration;
836 837
837 this_pktl = av_malloc(sizeof(AVPacketList));838 this_pktl = av_malloc(sizeof(PacketList));
838 if (!this_pktl) {839 if (!this_pktl) {
839 av_packet_unref(pkt);840 av_packet_unref(pkt);
840 return AVERROR(ENOMEM);841 return AVERROR(ENOMEM);
@@ -931,7 +932,7 @@ static int interleave_compare_dts(AVFormatContext *s, const AVPacket *next, · 90 unmodified lines
931int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,932int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
932 AVPacket *pkt, int flush)933 AVPacket *pkt, int flush)
933{934{
934 AVPacketList *pktl;935 PacketList *pktl;
935 int stream_count = 0;936 int stream_count = 0;
936 int noninterleaved_count = 0;937 int noninterleaved_count = 0;
937 int i, ret;938 int i, ret;
@@ -968,7 +969,7 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, · 30 unmodified lines
968 969
969 for (i = 0; i < s->nb_streams; i++) {970 for (i = 0; i < s->nb_streams; i++) {
970 int64_t last_dts;971 int64_t last_dts;
971 const AVPacketList *last = s->streams[i]->internal->last_in_packet_buffer;972 const PacketList *last = s->streams[i]->internal->last_in_packet_buffer;
972 973
973 if (!last)974 if (!last)
974 continue;975 continue;
@@ -1064,7 +1065,7 @@ int ff_get_muxer_ts_offset(AVFormatContext *s, int stream_index, int64_t *offset · 89 unmodified lines
1064 1065
1065const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream)1066const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream)
1066{1067{
1067 AVPacketList *pktl = s->internal->packet_buffer;1068 PacketList *pktl = s->internal->packet_buffer;
1068 while (pktl) {1069 while (pktl) {
1069 if (pktl->pkt.stream_index == stream) {1070 if (pktl->pkt.stream_index == stream) {
1070 return &pktl->pkt;1071 return &pktl->pkt;
libavformat/mxfenc.c+4−3
@@ -53,6 +53,7 @@ · 52 unmodified lines
53#include "libavcodec/h264_ps.h"53#include "libavcodec/h264_ps.h"
54#include "libavcodec/golomb.h"54#include "libavcodec/golomb.h"
55#include "libavcodec/internal.h"55#include "libavcodec/internal.h"
56#include "libavcodec/packet_internal.h"
56#include "avformat.h"57#include "avformat.h"
57#include "avio_internal.h"58#include "avio_internal.h"
58#include "internal.h"59#include "internal.h"
@@ -3104,9 +3105,9 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket · 3045 unmodified lines
3104 stream_count += !!s->streams[i]->internal->last_in_packet_buffer;3105 stream_count += !!s->streams[i]->internal->last_in_packet_buffer;
3105 3106
3106 if (stream_count && (s->nb_streams == stream_count || flush)) {3107 if (stream_count && (s->nb_streams == stream_count || flush)) {
3107 AVPacketList *pktl = s->internal->packet_buffer;3108 PacketList *pktl = s->internal->packet_buffer;
3108 if (s->nb_streams != stream_count) {3109 if (s->nb_streams != stream_count) {
3109 AVPacketList *last = NULL;3110 PacketList *last = NULL;
3110 // find last packet in edit unit3111 // find last packet in edit unit
3111 while (pktl) {3112 while (pktl) {
3112 if (!stream_count || pktl->pkt.stream_index == 0)3113 if (!stream_count || pktl->pkt.stream_index == 0)
@@ -3120,7 +3121,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket · 7 unmodified lines
3120 }3121 }
3121 // purge packet queue3122 // purge packet queue
3122 while (pktl) {3123 while (pktl) {
3123 AVPacketList *next = pktl->next;3124 PacketList *next = pktl->next;
3124 av_packet_unref(&pktl->pkt);3125 av_packet_unref(&pktl->pkt);
3125 av_freep(&pktl);3126 av_freep(&pktl);
3126 pktl = next;3127 pktl = next;
libavformat/ttaenc.c+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
30 30
31typedef struct TTAMuxContext {31typedef struct TTAMuxContext {
32 AVIOContext *seek_table;32 AVIOContext *seek_table;
33 AVPacketList *queue, *queue_end;33 PacketList *queue, *queue_end;
34 uint32_t nb_samples;34 uint32_t nb_samples;
35 int frame_size;35 int frame_size;
36 int last_frame;36 int last_frame;
libavformat/utils.c+7−7
@@ -812,7 +812,7 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) · 811 unmodified lines
812 av_init_packet(pkt);812 av_init_packet(pkt);
813 813
814 for (;;) {814 for (;;) {
815 AVPacketList *pktl = s->internal->raw_packet_buffer;815 PacketList *pktl = s->internal->raw_packet_buffer;
816 const AVPacket *pkt1;816 const AVPacket *pkt1;
817 817
818 if (pktl) {818 if (pktl) {
@@ -1020,7 +1020,7 @@ static int has_decode_delay_been_guessed(AVStream *st) · 201 unmodified lines
1020 return st->internal->nb_decoded_frames >= 20;1020 return st->internal->nb_decoded_frames >= 20;
1021}1021}
1022 1022
1023static AVPacketList *get_next_pkt(AVFormatContext *s, AVStream *st, AVPacketList *pktl)1023static PacketList *get_next_pkt(AVFormatContext *s, AVStream *st, PacketList *pktl)
1024{1024{
1025 if (pktl->next)1025 if (pktl->next)
1026 return pktl->next;1026 return pktl->next;
@@ -1076,7 +1076,7 @@ static int64_t select_from_pts_buffer(AVStream *st, int64_t *pts_buffer, int64_t · 49 unmodified lines
1076 * of the packets in a window.1076 * of the packets in a window.
1077 */1077 */
1078static void update_dts_from_pts(AVFormatContext *s, int stream_index,1078static void update_dts_from_pts(AVFormatContext *s, int stream_index,
1079 AVPacketList *pkt_buffer)1079 PacketList *pkt_buffer)
1080{1080{
1081 AVStream *st = s->streams[stream_index];1081 AVStream *st = s->streams[stream_index];
1082 int delay = st->internal->avctx->has_b_frames;1082 int delay = st->internal->avctx->has_b_frames;
@@ -1105,8 +1105,8 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index, · 22 unmodified lines
1105 int64_t dts, int64_t pts, AVPacket *pkt)1105 int64_t dts, int64_t pts, AVPacket *pkt)
1106{1106{
1107 AVStream *st = s->streams[stream_index];1107 AVStream *st = s->streams[stream_index];
1108 AVPacketList *pktl = s->internal->packet_buffer ? s->internal->packet_buffer : s->internal->parse_queue;1108 PacketList *pktl = s->internal->packet_buffer ? s->internal->packet_buffer : s->internal->parse_queue;
1109 AVPacketList *pktl_it;1109 PacketList *pktl_it;
1110 1110
1111 uint64_t shift;1111 uint64_t shift;
1112 1112
@@ -1157,7 +1157,7 @@ static void update_initial_timestamps(AVFormatContext *s, int stream_index, · 44 unmodified lines
1157static void update_initial_durations(AVFormatContext *s, AVStream *st,1157static void update_initial_durations(AVFormatContext *s, AVStream *st,
1158 int stream_index, int64_t duration)1158 int stream_index, int64_t duration)
1159{1159{
1160 AVPacketList *pktl = s->internal->packet_buffer ? s->internal->packet_buffer : s->internal->parse_queue;1160 PacketList *pktl = s->internal->packet_buffer ? s->internal->packet_buffer : s->internal->parse_queue;
1161 int64_t cur_dts = RELATIVE_TS_BASE;1161 int64_t cur_dts = RELATIVE_TS_BASE;
1162 1162
1163 if (st->first_dts != AV_NOPTS_VALUE) {1163 if (st->first_dts != AV_NOPTS_VALUE) {
@@ -1742,7 +1742,7 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) · 578 unmodified lines
1742 }1742 }
1743 1743
1744 for (;;) {1744 for (;;) {
1745 AVPacketList *pktl = s->internal->packet_buffer;1745 PacketList *pktl = s->internal->packet_buffer;
1746 1746
1747 if (pktl) {1747 if (pktl) {
1748 AVPacket *next_pkt = &pktl->pkt;1748 AVPacket *next_pkt = &pktl->pkt;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t