[MPlayer-users] using -ao pcm

Dave Lawrence dl at alphawave.net
Fri Oct 19 02:02:45 CEST 2001


On Wed, Oct 17, 2001 at 05:16:10PM +0200, Felix Buenemann wrote:
> On Wednesday, 17. October 2001 03:58, Dave Lawrence wrote:
> > Aha! That works just fine (apart from an apparent bug in ac3dec which
> > means it forgets to write the proper WAV header!).
> well I guess it's writing raw pcm data and now WAVE files-
in libao/audio_out_wav.c:

ao_open() is called at the start, this writes out a dummy WAV header,
the trivial ao_play() is called to write the data to the file and
ao_close() SHOULD be called on completion to write the correct
header. The problem is that ao_close is only called in response the
SIGINT as set up by ao_open() - there does not appear to be a call to
ao_close() in the normal run of things.

As a quick fix I patched ac3dec to call ao_close() thus:

--- ac3dec.c~   Fri Nov  3 23:00:54 2000
+++ ac3dec.c    Mon Oct 15 12:52:16 2001
@@ -130,7 +130,7 @@
 
        while((bytes_read = fread(buf,1,BLOCK_SIZE,in_file)) ==
	BLOCK_SIZE)
                ac3dec_decode_data(&ac3_config, audio_out, buf,buf +
		BLOCK_SIZE);
-
+       audio_out->close();
        fclose(in_file);
        return 0;
 }

the result: a WAV file, perfect in every way :)

-- 
Dave Lawrence



More information about the MPlayer-users mailing list