Legacy v6 and v7 UMC libraries have sample code to encode single track MPEG-4 files [video only]. I built a C++ class calling that code, worked fine. Then enhanced the C++ class to contain both a video and audio track, and now it's broken. In audio-video-codecs\codec\mpeg4_mux\src\umc_mp4_mux.cpp, function MuxData, there's a call to function FindMinTrackEnd, which MuxData then uses to decide which track to write to. Initially, FindMinTrackEnd returns 0 which is the video track. Soon after, FiindMinTrackEnd returns 1 which is the audio track, but there is no audio data to write. This confuses code calling MuxData, causes memory leaks, failures to call UnlockOutputBuffer from PutVideoData, and eventually everything breaks.
Has anyone any examples of writing multiple track MPEG-4 files?