Pārlūkot izejas kodu

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>
Andreas Rheinhardt 4 gadi atpakaļ
vecāks
revīzija
779dba0fc0
2 mainītis faili ar 2 papildinājumiem un 4 dzēšanām
  1. 1 2
      libavformat/flacdec.c
  2. 1 2
      libavformat/takdec.c

+ 1 - 2
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;
 

+ 1 - 2
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;