diff mbox series

[FFmpeg-devel,06/41] avformat/flacdec, takdec: Use FFRawDemuxerContext directly

Message ID VI1PR0301MB2159278437ADFF5EE2169FC78F0E9@VI1PR0301MB2159.eurprd03.prod.outlook.com
State Accepted
Commit 779dba0fc0f16cf4ddceba0b6527301889b58ccf
Headers show
Series [FFmpeg-devel,01/41] avformat/Makefile: Add missing rawdec dependency for IPU demuxer
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt June 17, 2021, 2:31 a.m. UTC
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>
---
 libavformat/flacdec.c | 3 +--
 libavformat/takdec.c  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
index d4158032e4..c841fdba01 100644
--- a/libavformat/flacdec.c
+++ b/libavformat/flacdec.c
@@ -31,8 +31,7 @@ 
 #define SEEKPOINT_SIZE 18
 
 typedef struct FLACDecContext {
-    AVClass *class;
-    int raw_packet_size;
+    FFRawDemuxerContext rawctx;
     int found_seektable;
 } FLACDecContext;
 
diff --git a/libavformat/takdec.c b/libavformat/takdec.c
index cbb9a9345e..cf400ec04b 100644
--- a/libavformat/takdec.c
+++ b/libavformat/takdec.c
@@ -31,8 +31,7 @@ 
 #include "rawdec.h"
 
 typedef struct TAKDemuxContext {
-    AVClass *class;
-    int     raw_packet_size;
+    FFRawDemuxerContext rawctx;
     int     mlast_frame;
     int64_t data_end;
 } TAKDemuxContext;