[FFmpeg-devel] [PATCHv2] flac: ignore IDv3 tags if vorbis tags exist
Michael Niedermayer
michaelni at gmx.at
Tue Feb 3 01:23:55 CET 2015
On Mon, Feb 02, 2015 at 06:49:11PM -0500, Ben Boeckel wrote:
> FLAC doesn't really support IDv3 tags, so warn if they are found at all.
> If vorbis tags are found, toss out the IDv3 tags. They are kept if
> vorbis tags aren't found to at least have something there.
>
> Fixes #3799.
>
> Signed-off-by: Ben Boeckel <mathstuf at gmail.com>
> ---
> libavformat/flacdec.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
> index 1a8dc19..e33ab91 100644
> --- a/libavformat/flacdec.c
> +++ b/libavformat/flacdec.c
> @@ -33,6 +33,7 @@ static int flac_read_header(AVFormatContext *s)
> int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0;
> uint8_t header[4];
> uint8_t *buffer=NULL;
> + int has_idv3 = 0;
> AVStream *st = avformat_new_stream(s, NULL);
> if (!st)
> return AVERROR(ENOMEM);
> @@ -47,6 +48,19 @@ static int flac_read_header(AVFormatContext *s)
> return 0;
> }
>
> + if (av_dict_count(s->metadata)) {
> + /* XXX: Is there a better way to parse this out? IDv3 parsing is done
> + * all the way out in avformat_open_input. */
> + has_idv3 = 1;
> + }
> +
> + if (has_idv3) {
> + int level = AV_LOG_WARNING;
> + if (s->err_recognition & AV_EF_COMPLIANT)
> + level = AV_LOG_ERROR;
this doesnt build
libavformat/flacdec.c: In function ‘flac_read_header’:
libavformat/flacdec.c:59:14: error: ‘AVFormatContext’ has no member named ‘err_recognition’
make: *** [libavformat/flacdec.o] Error 1
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150203/def6d058/attachment.asc>
More information about the ffmpeg-devel
mailing list