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;