1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-23 04:24:35 +02:00

avformat/flacdec, takdec: Use FFRawDemuxerContext directly

The beginning of the private contexts of both the FLAC and the TAK
demuxer currently mimick FFRawDemuxerContext: A pointer to an AVClass
followed by the AVOpt-enabled field raw_packet_size. Said field is only
used by the demuxers' read_packet functions via
ff_raw_read_partial_packet(), which treats the private context as an
FFRaawDemuxerContext. Yet this is fragile, so better include a
FFRawDemuxerContext struct at the beginning of said demuxers' private
contexts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-06-07 19:49:20 +02:00
parent cd564ee547
commit 779dba0fc0
2 changed files with 2 additions and 4 deletions

View File

@ -31,8 +31,7 @@
#define SEEKPOINT_SIZE 18 #define SEEKPOINT_SIZE 18
typedef struct FLACDecContext { typedef struct FLACDecContext {
AVClass *class; FFRawDemuxerContext rawctx;
int raw_packet_size;
int found_seektable; int found_seektable;
} FLACDecContext; } FLACDecContext;

View File

@ -31,8 +31,7 @@
#include "rawdec.h" #include "rawdec.h"
typedef struct TAKDemuxContext { typedef struct TAKDemuxContext {
AVClass *class; FFRawDemuxerContext rawctx;
int raw_packet_size;
int mlast_frame; int mlast_frame;
int64_t data_end; int64_t data_end;
} TAKDemuxContext; } TAKDemuxContext;