5.1 AC3 files with 2.0 inside for random commercials can't be decoded and recompressed properly. I don't need large 5.1 AC3 files for my purposes, but I do need the random commercials. What I've been doing is using a doom9 tool called SplitAC3 in conjunction with eac3to to strip out the 2.0 sections and add silence in its place. This works and preserves the sync, but of course having silent commercials is weird. SplitAC3 specifies the frames that should be kept, so I could use Trim() in AviSynth to keep only those...but as I said, I need those stupid commercials.

I've read that tools like ProjectX or TSDoctor can fix this by inserting fake surround frames in the areas that have only 2.0 audio. TSDoctor didn't seem to do anything about this, though it did detect the points where the audio switched over from 5.1 to 2.0 and back. It seems that ProjectX has an option that will replace the 2.0 frames with 5.1 silence: "replace all non-3/2 AC-3 by 3/2lfe silence". But after demuxing the AC3 file from the ts generated by ProjectX, the 2.0 frames still appear to be in there untouched, according to splitac3, so it doesn't even automate that for me.

Is there any way to actually modify the 2.0 section of the AC3 streams to add missing center, surround, and LFE channels such that it can be decoded properly by eac3to or NicAudio or whatever before reencoding?

My source is a WTV file converted to ts/m2ts with VideoReDo 5, which also doesn't appear to have anything that could help me (QuickStream fix did not add in the extra silent channels or anything, though it did remove extraneous frames and such).