[MPlayer-dev-eng] [PATCH] -oac copy with ac3 sound and lavf ts demuxer issues (Was: Re: [MEncoder-users] Video/Audio asynchronous)

Nico Sabbi nsabbi at email.it
Tue Feb 20 15:59:05 CET 2007


Matthias Hopf wrote:

>
>So the remaining question is basically twofold:
>
>- Why is nBlockAlign, wBitsPerSample not set correctly?
>
>- Why is dwRate/dwScale/dwStart/dwLength/dwSuggestedBufferSize wrong?
>  What are the right values?
>  I assume codec->frame_size and/or codec->sample_rate are wrong.
>  lavf gets it right for constant bit rate, but an unknown ac3 stream is
>  inherrently variable, so a VBR approach is the right thing (TM) to do.
>
>Can anyone with a deeper understanding how demuxing in mplayer actually
>works comment on my findings?
>
>  
>

those parameters must be set by decoders, not demuxers.
More: those parameters are avi-specific; mplayer's core
shouldn't even use them.
In the case of ac3:
- dwRate is srate
- dwScale is 1536 (samples per frame)
- nBlockAlign is 0

- dwLength/dwSuggestedBufferSize?? boh!

I wonder what utility can they ever have

>Index: libmpdemux/demux_lavf.c
>===================================================================
>--- libmpdemux/demux_lavf.c	(revision 22261)
>+++ libmpdemux/demux_lavf.c	(working copy)
>@@ -295,7 +295,7 @@
>             }
>             sh_audio->wf= wf;
>             sh_audio->audio.dwSampleSize= codec->block_align;
>-            if(codec->frame_size && codec->sample_rate){
>+            if(0 && codec->frame_size && codec->sample_rate){
>                 sh_audio->audio.dwScale=codec->frame_size;
>                 sh_audio->audio.dwRate= codec->sample_rate;
>             }else{
>Index: libavformat/mpegts.c
>===================================================================
>--- libavformat/mpegts.c	(revision 8020)
>+++ libavformat/mpegts.c	(working copy)
>@@ -961,6 +961,12 @@
>         st->priv_data = pes;
>         st->codec->codec_type = codec_type;
>         st->codec->codec_id = codec_id;
>+	switch (codec_id) {
>+	case CODEC_ID_AAC:
>+	case CODEC_ID_AC3:
>+	case CODEC_ID_DTS:
>+	    st->codec->block_align = 1;
>+	}
>         st->need_parsing = 1;
>         pes->st = st;
>     }
>  
>
>------------------------------------------------------------------------
>

as above, this stuff belongs to decoders, not to demuxers
 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Logos Finanziaria SPA. Società di credito ad erogazione diretta. Fino a 30.000 euro in 24 ore! Clicca e scopri come
* 
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2909&d=20-2



More information about the MPlayer-dev-eng mailing list