[FFmpeg-devel] Make FLV decoder expose meta-data

Aurelien Jacobs aurel
Tue Jul 7 00:01:12 CEST 2009


On Mon, Jul 06, 2009 at 02:13:20PM -0700, Art Clarke wrote:
> >
> > patch_0110_flvdec_removebadcode_addmetadata.txt
> > is unified diff.
> > patch_0120_flvdec_addmetadatacode_addmetadata.txt
> > patch_0130_flvdec_reenableamf_addmetadata.txt
> > are not.
> 
> 
> OK, that was embarrassing.  The joy of trying to build a series of patches
> out of the one automated patch we have :)  Let's try this for size.
> 
> Attempt #4

Still not perfect...

> Index: libavformat/flvdec.c
> ===================================================================
> --- libavformat/flvdec.c	(revision 19361)
> +++ libavformat/flvdec.c	(working copy)
> @@ -217,36 +217,10 @@
>          acodec = astream ? astream->codec : NULL;
>          vcodec = vstream ? vstream->codec : NULL;
>  
> -        if(amf_type == AMF_DATA_TYPE_BOOL) {

Here you shouldn't remove this line (you're adding it again in next patch).

> Index: libavformat/flvdec.c
> ===================================================================
> --- libavformat/flvdec.c	(revision 19361)
> +++ libavformat/flvdec.c	(working copy)
> @@ -217,11 +217,17 @@
>          acodec = astream ? astream->codec : NULL;
>          vcodec = vstream ? vstream->codec : NULL;
>  
> -        if(amf_type == AMF_DATA_TYPE_NUMBER) {
> +         if(amf_type == AMF_DATA_TYPE_BOOL) {
> +            av_strlcpy(str_val, num_val > 0 ? "true" : "false", sizeof(str_val));

You are missing the mandatory include for av_strlcpy().

And patch 3 should be applied before patch 2, as it allows for better
step by step testing (and potential future bisection in case of bug).

Anyway, I applied slightly modified versions of those patches.

Aurel



More information about the ffmpeg-devel mailing list