[FFmpeg-devel] [PATCH ]FLV Metadata

Aurelien Jacobs aurel
Sat Aug 14 21:21:01 CEST 2010


On Sat, Aug 14, 2010 at 12:50:06PM -0300, Tom?s Touceda wrote:
> 2010/8/6 Anton Khirnov <wyskas at gmail.com>:
> [snip]
> > this is wrong, you're not supposed to access stuff in AVMetadata
> > directly. to iterate over all tags call av_metadata_get with empty
> > string and AVMETADATA_IGNORE_SUFFIX flag in a loop (look at how all the
> > other demuxers do it).
> >
> > Anton Khirnov
> >
> 
> Ok.
> How about now?
> 
> Cheers,
> Tomas

> diff -Naur ffmpeg-9999.old/libavformat/flvenc.c ffmpeg-9999/libavformat/flvenc.c
> --- ffmpeg-9999.old/libavformat/flvenc.c	2010-08-12 23:55:16.000000000 -0300
> +++ ffmpeg-9999/libavformat/flvenc.c	2010-08-12 23:56:15.000000000 -0300
> @@ -22,6 +22,7 @@
>  #include "flv.h"
>  #include "internal.h"
>  #include "avc.h"
> +#include "metadata.h"
>  
>  #undef NDEBUG
>  #include <assert.h>
> @@ -257,6 +258,15 @@
>          put_amf_double(pb, audio_enc->codec_tag);
>      }
>  
> +    if(s->metadata) {

This test is useless. Just remove it.

> +        AVMetadataTag *tag = NULL;
> +        while((tag = av_metadata_get(s->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) {

Add a space between while and (.

Aurel



More information about the ffmpeg-devel mailing list