Commit f45bf037 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Dash: Simplify Dash detection

It should be faster and matches better the other stream filters
parent e202b76c
...@@ -141,20 +141,13 @@ Profile DOMParser::getProfile (dash::xml::Node *node) ...@@ -141,20 +141,13 @@ Profile DOMParser::getProfile (dash::xml::Node *node)
} }
bool DOMParser::isDash (stream_t *stream) bool DOMParser::isDash (stream_t *stream)
{ {
const uint8_t *peek, *peek_end; const uint8_t *peek;
int64_t i_size = stream_Peek(stream, &peek, 2048); const char* psz_namespace = "urn:mpeg:mpegB:schema:DASH:MPD:DIS2011";
if(i_size < 1) if(stream_Peek(stream, &peek, 1024) < (int)strlen(psz_namespace))
return false; return false;
peek_end = peek + i_size; const char *p = strstr((const char*)peek, psz_namespace );
while(peek <= peek_end)
{
const char *p = strstr((const char*)peek, "urn:mpeg:mpegB:schema:DASH:MPD:DIS2011");
if (p != NULL)
return true;
peek++;
};
return false; return p != NULL;
} }
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