[FFmpeg-devel] [PATCH v3] avformat/dashdec: add dash demuxer base version

Michael Niedermayer michael at niedermayer.cc
Mon Mar 20 23:50:42 EET 2017


On Mon, Mar 20, 2017 at 10:29:48PM +0800, Steven Liu wrote:
[...]
> +static int parse_mainifest_segmenttimeline(AVFormatContext *s, struct representation *rep,
> +                                           xmlNodePtr fragment_timeline_node)
> +{
> +    xmlAttrPtr attr = NULL;
> +    xmlChar *val  = NULL;
> +
> +    if (!xmlStrcmp(fragment_timeline_node->name, (const xmlChar *)"S")) {
> +        struct timeline *tml = av_mallocz(sizeof(struct timeline));
> +        if (!tml) {
> +            return AVERROR(ENOMEM);
> +        }
> +        attr = fragment_timeline_node->properties;
> +        while (attr) {
> +            val = xmlGetProp(fragment_timeline_node, attr->name);
> +            if (!xmlStrcmp(attr->name, (const xmlChar *)"t")) {
> +                tml->t = (int64_t)atoll((const char *)val);
> +            } else if (!xmlStrcmp(attr->name, (const xmlChar *)"r")) {
> +                tml->r =(int32_t) atoi((const char *)val);
> +            } else if (!xmlStrcmp(attr->name, (const xmlChar *)"d")) {
> +                tml->d = (int64_t)atoll((const char *)val);
> +                rep->fragment_duration = (int64_t) atoll((const char *)val);

atoll() should probably be some function that allows checking if its
argument is a valid number
unless iam missing something that does such check elsewhere

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170320/cce87fab/attachment.sig>


More information about the ffmpeg-devel mailing list