[FFmpeg-devel] [PATCH] ffprobe: fix validity error with tags and data.

Stefano Sabatini stefasab at gmail.com
Tue Jul 31 15:03:27 CEST 2012


On date Tuesday 2012-07-31 14:48:39 +0200, Nicolas George encoded:
> Add "data" and "extradata" attributes to the sshema.

sshema -> schema

> Add "tag" element in "streams".
> Print extradata before tags to avoid closing the element.
> 
> Fix trac ticket #1588.
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  doc/ffprobe.xsd |    6 ++++++
>  ffprobe.c       |    2 +-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
> index 3a4a8cc..185b642 100644
> --- a/doc/ffprobe.xsd
> +++ b/doc/ffprobe.xsd
> @@ -44,6 +44,7 @@
>        <xsd:attribute name="size"          type="xsd:long" use="required" />
>        <xsd:attribute name="pos"           type="xsd:long"  />
>        <xsd:attribute name="flags"         type="xsd:string" use="required" />
> +      <xsd:attribute name="data"          type="xsd:string" />
>      </xsd:complexType>
>  
>      <xsd:complexType name="frameType">
> @@ -84,6 +85,10 @@
>      </xsd:complexType>
>  
>      <xsd:complexType name="streamType">
> +      <xsd:sequence>
> +        <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
> +      </xsd:sequence>
> +
>        <xsd:attribute name="index"            type="xsd:int" use="required"/>
>        <xsd:attribute name="codec_name"       type="xsd:string" />
>        <xsd:attribute name="codec_long_name"  type="xsd:string" />
> @@ -92,6 +97,7 @@
>        <xsd:attribute name="codec_time_base"  type="xsd:string" use="required"/>
>        <xsd:attribute name="codec_tag"        type="xsd:string" use="required"/>
>        <xsd:attribute name="codec_tag_string" type="xsd:string" use="required"/>
> +      <xsd:attribute name="extradata"        type="xsd:string" />
>  
>        <!-- video attributes -->
>        <xsd:attribute name="width"                type="xsd:int"/>
> diff --git a/ffprobe.c b/ffprobe.c
> index e14de3b..6bef115 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -1836,10 +1836,10 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
>      else                                print_str_opt("nb_read_frames", "N/A");
>      if (nb_streams_packets[stream_idx]) print_fmt    ("nb_read_packets", "%"PRIu64, nb_streams_packets[stream_idx]);
>      else                                print_str_opt("nb_read_packets", "N/A");
> -    show_tags(stream->metadata);
>      if (do_show_data)
>          writer_print_data(w, "extradata", dec_ctx->extradata,
>                                            dec_ctx->extradata_size);
> +    show_tags(stream->metadata);
>  
>      print_section_footer("stream");
>      av_bprint_finalize(&pbuf, NULL);

Should be OK if tested, thanks.
-- 
FFmpeg = Fundamental and Free Marvellous Purposeless Ephemeral Geisha


More information about the ffmpeg-devel mailing list