Perform some cleanups based on the dtsdec code such as using the boilerplate macro and static pad template functions. Add some documentation. Don't register a change in flags until we synch on another frame successfully.