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
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
