Commit c4fd51df authored by Julian Rother's avatar Julian Rother
Browse files

probe: Fixed xmp_chapters value if no chapters are found

parent be4cc756
...@@ -28,20 +28,20 @@ char *get_xmpchapters(char *xmp) ...@@ -28,20 +28,20 @@ char *get_xmpchapters(char *xmp)
xmlNodePtr node; xmlNodePtr node;
double framerate, start; double framerate, start;
if (!(doc = xmlParseMemory(xmp, strlen(xmp)))) if (!(doc = xmlParseMemory(xmp, strlen(xmp))))
return ""; return "[]";
if (!(xpath = xmlXPathNewContext(doc))) if (!(xpath = xmlXPathNewContext(doc)))
return ""; return "[]";
xmlXPathRegisterNs(xpath, "x", "adobe:ns:meta/"); xmlXPathRegisterNs(xpath, "x", "adobe:ns:meta/");
xmlXPathRegisterNs(xpath, "rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); xmlXPathRegisterNs(xpath, "rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
xmlXPathRegisterNs(xpath, "xmpDM", "http://ns.adobe.com/xmp/1.0/DynamicMedia/"); xmlXPathRegisterNs(xpath, "xmpDM", "http://ns.adobe.com/xmp/1.0/DynamicMedia/");
res = xmlXPathEvalExpression("/x:xmpmeta/rdf:RDF/rdf:Description/@xmpDM:videoFrameRate", xpath); res = xmlXPathEvalExpression("/x:xmpmeta/rdf:RDF/rdf:Description/@xmpDM:videoFrameRate", xpath);
if (!res || !res->nodesetval->nodeNr) if (!res || !res->nodesetval->nodeNr)
return ""; return "[]";
framerate = strtod(res->nodesetval->nodeTab[0]->children->content, 0); framerate = strtod(res->nodesetval->nodeTab[0]->children->content, 0);
xmlXPathFreeObject(res); xmlXPathFreeObject(res);
res = xmlXPathEvalExpression("/x:xmpmeta/rdf:RDF/rdf:Description/xmpDM:Tracks/rdf:Bag/rdf:li/rdf:Description/xmpDM:markers/rdf:Seq/rdf:li/rdf:Description", xpath); res = xmlXPathEvalExpression("/x:xmpmeta/rdf:RDF/rdf:Description/xmpDM:Tracks/rdf:Bag/rdf:li/rdf:Description/xmpDM:markers/rdf:Seq/rdf:li/rdf:Description", xpath);
if (!res || !res->nodesetval) if (!res || !res->nodesetval)
return ""; return "[]";
ptr = 0; ptr = 0;
size = 0; size = 0;
if (!(stream = open_memstream(&ptr, &size))) if (!(stream = open_memstream(&ptr, &size)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment