Good catch. That should probably be duration < 0, not <=. On some platforms RTMP and HDS live can report -1 which is why I put that in there.