id,summary,reporter,owner,description,type,status,priority,component,version,resolution,keywords,cc,blockedby,blocking,reproduced,analyzed
2210,AC3 channel layout change midstream causes severe errors,agni451,,"Summary of the bug:
How to reproduce:
{{{
% ffmpeg -v verbose -y -i ""C:\PATH\ORIG.ts"" -c:v mpeg2video -q:vscale 0 -flags +ilme+ildct -top 1 -c:a ac3 -ab 384k -ac 6 -async 48000 ""C:\PATH\FIX.ts""
ffmpeg version N-46469-gc995644
built on Nov 5 2012
}}}

The input I'm using is a TV program recorded in Media Center, so it has an MPEG2 stream and a 6ch ac3 stream.  I use the commandline above in an effort to correct for missing audio/video frames, and it works great if I've already removed the commercials from the stream (using DGIndexNV to copy the pieces I want).  However, I've noticed that DGIndexNV does not compensate for the initial audio delay in the stream, so the end of the audio cuts out before the video.  I want to start trimming at specific frames, and the only way to do that is to fix the stream first using the above commandline.  Then I find the frames at which I need to cut, and use tsmuxer to do it.  Since the commandline above also fixes the initial delay, I don't have to worry about the audio being off.  

However, some of the recorded shows with commercials experience an audio channel number and layout change around the commercials, going from 6ch 48000 --> 2ch stereo, then switching back.  This causes extreme problems with the fixed stream using the above commandline, as I suddenly start getting messages like "" st:0 PTS: 100320 DTS: 100320 < 64387716 invalid, clipping"" and adding very large segments of silent audio (like 10 minutes).

In the log I am attaching, you will see that the audio changes from 6ch to stereo or vice versa a total of 6 times.  The one that takes place at 44:17.120 results in the entire rest of the clip being silent.  I don't think I'm missing any features that might fix this, so I'm posting it as a bug.",defect,closed,normal,undetermined,git-master,fixed,async,agni451,,,1,0
