Oh, I missed that pmp_videoSource and pmp_nBlocks are globals, and you indeed write to them here. Never mind.

Wonder what the name of this function might be. SetVideoSourceAndScanForEnd? :P