[FFmpeg-devel] [PATCH v2] avformat/wavdec.c: copy id3 metadata to format metadata and stream side data

Jun Li junli1026 at gmail.com
Thu Oct 24 04:25:30 EEST 2019


On Sun, Oct 20, 2019 at 4:14 PM Jun Li <junli1026 at gmail.com> wrote:

> Enhancement #7803
> Copy id3 metadata to format meta data and stream side data.
>
> Signed-off-by: Jun Li <junli1026 at gmail.com>
> ---
>  libavformat/Makefile |  4 ++--
>  libavformat/wavdec.c | 10 ++++++++++
>  2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 615156c120..0ab6fe0793 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -535,9 +535,9 @@ OBJS-$(CONFIG_VOC_MUXER)                 += vocenc.o
> voc.o
>  OBJS-$(CONFIG_VPK_DEMUXER)               += vpk.o
>  OBJS-$(CONFIG_VPLAYER_DEMUXER)           += vplayerdec.o subtitles.o
>  OBJS-$(CONFIG_VQF_DEMUXER)               += vqf.o
> -OBJS-$(CONFIG_W64_DEMUXER)               += wavdec.o w64.o pcm.o
> +OBJS-$(CONFIG_W64_DEMUXER)               += wavdec.o w64.o pcm.o
> replaygain.o
>  OBJS-$(CONFIG_W64_MUXER)                 += wavenc.o w64.o
> -OBJS-$(CONFIG_WAV_DEMUXER)               += wavdec.o pcm.o
> +OBJS-$(CONFIG_WAV_DEMUXER)               += wavdec.o pcm.o replaygain.o
>  OBJS-$(CONFIG_WAV_MUXER)                 += wavenc.o
>  OBJS-$(CONFIG_WC3_DEMUXER)               += wc3movie.o
>  OBJS-$(CONFIG_WEBM_MUXER)                += matroskaenc.o matroska.o \
> diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
> index 52194f54ef..d82bdaaa66 100644
> --- a/libavformat/wavdec.c
> +++ b/libavformat/wavdec.c
> @@ -41,6 +41,7 @@
>  #include "riff.h"
>  #include "w64.h"
>  #include "spdif.h"
> +#include "replaygain.h"
>
>  typedef struct WAVDemuxContext {
>      const AVClass *class;
> @@ -537,6 +538,15 @@ break_loop:
>
>      avio_seek(pb, data_ofs, SEEK_SET);
>
> +    if (s->internal->id3v2_meta) {
> +        ret = av_dict_copy(&s->metadata, s->internal->id3v2_meta, 0);
> +        if (ret < 0)
> +            return ret;
> +        ret = ff_replaygain_export(st, s->internal->id3v2_meta);
> +        if (ret < 0)
> +            return ret;
> +    }
> +
>      if (data_size > (INT64_MAX>>3)) {
>          av_log(s, AV_LOG_WARNING, "Data size %"PRId64" is too large\n",
> data_size);
>          data_size = 0;
> --
> 2.17.1
>
>
Ping


More information about the ffmpeg-devel mailing list