[FFmpeg-devel] [PATCH] ac3 parser incorrectly sets frame_size to samples*channel

Justin Ruggles justin.ruggles
Fri Feb 20 22:59:03 CET 2009

elupus wrote:
> Hi, 
> I noticed while playing a EAC3 file from an mpegts with only sporadic
> timestamps that the dts/pts output from libavformat would revert backwords
> every few samples.
> It seems get_audio_frame_size in utils.c uses AVCodecContext->frame_size to
> get the number of samples timewise in a packet (read no total per packet).
> However the ac3 parser sets frame_size to be AC3_FRAME_SIZE which includes
> all the 6 channels of samples.
> Setting the frame_size to 256 (ie 256 for each channel in the stream) fixes
> this stream's odd dts/pts output.
> The sample that would have shown this is HDDVD.DTSHD.DDPlus.ts which was
> uploaded to incoming a while back, but it seems justin didn't find that
> sample anymore. Maybe it was pruned or something.
> I seem to have ditched this sample aswell. But could probably cut up a new
> one from my rip.

Your assessment is incorrect, but it does need to be fixed. A normal AC3
frame is 6 blocks with 256 samples per block no matter how many channels
it has. An E-AC3 frame has 1, 2, 3, or 6 blocks. I suspect your
problematic E-AC3 sample has 1 block per frame.  I will apply a
different fix shortly.


More information about the ffmpeg-devel mailing list