lavf: move generic index generation code to a later point