On Thu, Apr 14, 2011 at 01:32:41PM +0200, Luca Barbato wrote:
> Use the metadata to signal its presence
> ---
>  libavformat/flvdec.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> index e7ec0b1..0bdc57f 100644
> --- a/libavformat/flvdec.c
> +++ b/libavformat/flvdec.c
> @@ -280,6 +280,15 @@ static int amf_parse_object(AVFormatContext *s, AVStream 
> *astream, AVStream *vst
>                  vcodec->bit_rate = num_val * 1024.0;
>              else if(!strcmp(key, "audiodatarate") && acodec && 0 <= 
> (int)(num_val * 1024.0))
>                  acodec->bit_rate = num_val * 1024.0;
> +            else if(!strcmp(key, "data-stream")) {
> +                AVStream *st = av_new_stream(s, 2);
> +                if (!st)
> +                    return -1;
> +                st->codec->codec_type = AVMEDIA_TYPE_DATA;
> +                st->codec->codec_id = num_val;

maybe vertically align a bit?

> +                av_set_pts_info(st, 32, 1, 1000);
> +                av_log(s, AV_LOG_INFO, "Found metadata stream, %d\n", 
> num_val);
> +            }
>          } else if (amf_type == AMF_DATA_TYPE_STRING)
>              av_metadata_set2(&s->metadata, key, str_val, 0);
>      }
> -- 

otherwise looks ok
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to