[MPlayer-dev-eng] [PATCH] ae_lavc: set nBlockAlign like libavformat
Nicolas George
nicolas.george at normalesup.org
Sun Aug 28 20:22:42 CEST 2011
Le decadi 10 fructidor, an CCXIX, Reimar Döffinger a écrit :
> The muxer mostly takes the values as they come from the demuxer, sight
> unseen.
> This works with the mkv demuxer that keeps the dwScale/dwRate as they
> are, based on bitrate.
> For demuxer lavf I guess there are two ways to fix it: Also keeping
> dwScale/dwRate (will break other things) or by using the same logic
> as you suggest for ae_lavc - but then that IMO should not be duplicated
> but go into some shared file.
For stream copy from demux_lavf, the base problem is the same (AVI has a
mess of fields with overlapping semantic that are used chaotically by
various implementations) but the exact problem is different: the culprit
here is dwSampleSize, not nBlockAlign.
You can see how ffmpeg handles the problem in ffmpeg.c near lines 2275 (and
do not be fooled, icodec->block_align is dwSampleSize, not nBlockAlign).
The attached patch does the same thing to mencoder.c. It fixes stream copy
for the sample case I made, with AC3. I am downloading the sample from bug
#1958 you mentioned yesterday (AC3) to see if it fixes it.
The MP3 case does not work very well, there is a different problem there,
with a lot of "1 duplicate frame" that should not be there. But there is a
lot I do not understand in the AV-sync system of mencoder (I spent half the
day trying to understand why ae_lame causes three frames to be skipped while
ae_lavc does not, in vain).
This is not perfect, but it is still an improvement.
I also attach a slightly updated version of the patch for ae_lavc.
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-mencoder-set-dwSampleSize-to-0-for-MP3-and-AC3-strea.patch
Type: text/x-diff
Size: 1442 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110828/12d7f292/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ae_lavc-set-nBlockAlign-like-libavformat.patch
Type: text/x-diff
Size: 1373 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110828/12d7f292/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110828/12d7f292/attachment.asc>
More information about the MPlayer-dev-eng
mailing list