summaryrefslogtreecommitdiff
path: root/libavdevice/dshow.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-16 01:49:39 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-04 13:16:50 +0100
commitd61240f8c95e9cf7a0aaef2bb4495960d3fec62c (patch)
tree52398ddaec0cbe4e02d0db54669ecd1532f1569e /libavdevice/dshow.c
parentb74e47c4ff5bca998936c0d8b9a0892104a7403d (diff)
avcodec/packet_internal: Add proper PacketList struct
Up until now, we had a PacketList structure which is actually a PacketListEntry; a proper PacketList did not exist and all the related functions just passed pointers to pointers to the head and tail elements around. All these pointers were actually consecutive elements of their containing structs, i.e. the users already treated them as if they were a struct. So add a proper PacketList struct and rename the current PacketList to PacketListEntry; also make the functions use this structure instead of the pair of pointers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavdevice/dshow.c')
-rw-r--r--libavdevice/dshow.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 7e04880b38..3a16f3720f 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -238,7 +238,7 @@ static int
dshow_read_close(AVFormatContext *s)
{
struct dshow_ctx *ctx = s->priv_data;
- PacketList *pktl;
+ PacketListEntry *pktl;
if (ctx->control) {
IMediaControl_Stop(ctx->control);
@@ -298,7 +298,7 @@ dshow_read_close(AVFormatContext *s)
pktl = ctx->pktl;
while (pktl) {
- PacketList *next = pktl->next;
+ PacketListEntry *next = pktl->next;
av_packet_unref(&pktl->pkt);
av_free(pktl);
pktl = next;
@@ -342,7 +342,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;
- PacketList **ppktl, *pktl_next;
+ PacketListEntry **ppktl, *pktl_next;
// dump_videohdr(s, vdhdr);
@@ -351,7 +351,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(PacketList));
+ pktl_next = av_mallocz(sizeof(*pktl_next));
if(!pktl_next)
goto fail;
@@ -1868,7 +1868,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;
- PacketList *pktl = NULL;
+ PacketListEntry *pktl = NULL;
while (!ctx->eof && !pktl) {
WaitForSingleObject(ctx->mutex, INFINITE);