mxfenc: factorize samples per frame code