[FFmpeg-devel] [PATCH v4 2/6] avformat/apm: use new extradata format
Michael Niedermayer
michael at niedermayer.cc
Sat Jun 27 17:09:43 EEST 2020
On Sat, Jun 20, 2020 at 10:59:28AM +0000, Zane van Iperen wrote:
> Signed-off-by: Zane van Iperen <zane at zanevaniperen.com>
> ---
> libavformat/Makefile | 2 +-
> libavformat/apm.c | 130 +++++++++++++++++++++++--------------------
> 2 files changed, 70 insertions(+), 62 deletions(-)
>
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 26af859a28..a4113fe644 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -93,7 +93,7 @@ OBJS-$(CONFIG_AMRWB_DEMUXER) += amr.o
> OBJS-$(CONFIG_ANM_DEMUXER) += anm.o
> OBJS-$(CONFIG_APC_DEMUXER) += apc.o
> OBJS-$(CONFIG_APE_DEMUXER) += ape.o apetag.o img2.o
> -OBJS-$(CONFIG_APM_DEMUXER) += apm.o riffdec.o
> +OBJS-$(CONFIG_APM_DEMUXER) += apm.o
> OBJS-$(CONFIG_APNG_DEMUXER) += apngdec.o
> OBJS-$(CONFIG_APNG_MUXER) += apngenc.o
> OBJS-$(CONFIG_APTX_DEMUXER) += aptxdec.o rawdec.o
> diff --git a/libavformat/apm.c b/libavformat/apm.c
> index dc59c16562..57d23200b0 100644
> --- a/libavformat/apm.c
> +++ b/libavformat/apm.c
> @@ -21,12 +21,13 @@
> */
> #include "avformat.h"
> #include "internal.h"
> -#include "riff.h"
> #include "libavutil/internal.h"
> #include "libavutil/intreadwrite.h"
>
> -#define APM_FILE_HEADER_SIZE 20
> -#define APM_VS12_CHUNK_SIZE 76
> +#define APM_FILE_HEADER_SIZE 18
> +#define APM_FILE_EXTRADATA_SIZE 80
> +#define APM_EXTRADATA_SIZE 28
> +
> #define APM_MAX_READ_SIZE 4096
>
> #define APM_TAG_CODEC 0x2000
> @@ -43,34 +44,37 @@ typedef struct APMState {
> int32_t saved_l;
> } APMState;
>
> -typedef struct APMVS12Chunk {
> +typedef struct APMExtraData {
> uint32_t magic;
> uint32_t file_size;
> uint32_t data_size;
> uint32_t unk1;
> uint32_t unk2;
> APMState state;
> - uint32_t pad[7];
> -} APMVS12Chunk;
> + uint32_t unk3[7];
> + uint32_t data;
> +} APMExtraData;
>
> -static void apm_parse_vs12(APMVS12Chunk *vs12, const uint8_t *buf)
> +static void apm_parse_extradata(APMExtraData *ed, const uint8_t *buf)
renaming the struct and variables should be in a seperate patch from
functional changes, so as to keep the changes easy readable
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200627/a0e6f1c9/attachment.sig>
More information about the ffmpeg-devel
mailing list