[MPlayer-dev-eng] af layer STILL broken
D Richard Felker III
dalias at aerifal.cx
Mon Jan 13 20:09:00 CET 2003
Something is totally wrong in the af layer still. I just tried
modifying ad_libvorbis.c with the attached patch to output float
instead of converting to int, so that fast float->int could be done in
the filter layer once it's implemented. However, even if I use -format
or explicitly load a filter chain to convert to s16le, mplayer STILL
tries to configure the AO device for float, and outputs garbage!! This
really needs to be fixed for 0.90 IMO. Should be easy to reproduce; if
not I'll send you my exact command line and stuff.
Rich
-------------- next part --------------
Index: libmpcodecs/ad_libvorbis.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_libvorbis.c,v
retrieving revision 1.10
diff -u -r1.10 ad_libvorbis.c
--- libmpcodecs/ad_libvorbis.c 4 Dec 2002 20:50:53 -0000 1.10
+++ libmpcodecs/ad_libvorbis.c 13 Jan 2003 18:59:20 -0000
@@ -151,6 +151,10 @@
// assume 128kbit if bitrate not specified in the header
sh->i_bps=((ov->vi.bitrate_nominal>0) ? ov->vi.bitrate_nominal : 128000)/8;
sh->context = ov;
+#ifndef TREMOR
+ sh->samplesize=4;
+ sh->sample_format=AFMT_FLOAT;
+#endif
/// Finish the decoder init
vorbis_synthesis_init(&ov->vd,&ov->vi);
@@ -204,6 +208,7 @@
if(bout<=0) break;
+#ifdef TREMOR
/* convert floats to 16 bit signed ints (host order) and
interleave */
for(i=0;i<ov->vi.channels;i++){
@@ -231,6 +236,17 @@
ptr+=ov->vi.channels;
}
}
+#else
+ for(i=0;i<ov->vi.channels;i++){
+ uint32_t *convbuffer=(uint32_t *)(&buf[len]);
+ uint32_t *ptr=convbuffer+i;
+ uint32_t *mono=pcm[i];
+ for (j=0;j<bout;j++){
+ *ptr = mono[j];
+ ptr += ov->vi.channels;
+ }
+ }
+#endif
if(clipflag)
mp_msg(MSGT_DECAUDIO,MSGL_DBG2,"Clipping in frame %ld\n",(long)(ov->vd.sequence));
More information about the MPlayer-dev-eng
mailing list