[MPlayer-dev-eng] [PATCH][Preversion]flac support

Dmitry Baryshkov mitya at school.ioffe.ru
Tue Sep 2 19:00:28 CEST 2003


On Mon, 2003-09-01 at 18:31, Arpi wrote:
> > On Mon, 2003-09-01 at 16:12, Arpi wrote:
> > > Hi,
> > > > > 1) Is it enough to return -1 in decode_audio to stop decoding of current 
> > > > file? (It's written so, but is
> > > >  doesn't always work)
> > > > it keeps reading (and decoding) the stream until eof is reached.
> > Then how can I return decoding error to stop decoding process? (reading,
> > but not decoding sound like a hack)
> 
> you can't ;(
> its not supposed that a decoder can get into a such broken state where
> it cannot recover at all.
> an ugly hack may be setting sh_audio->ds->eof to 1
> but it would be better to fix the decoder, by adding ability to resync after
> stream error to next frame or sth. see libfaad or liba52 wrappers.
Ok. I will. BTW. libflac already does this in most cases :)
> 
> > > > 2) Can I set timing of current fragment not in demuxer?
> > > > not in g1
> > > you can in g2
> > So, to set *->pts  to right values I must add partial decoding to
> > demuxer (I mean demux_audio.c)?
> > setting pts should be done by the demuxers, as pts is usually stored in the
> container format. if you mean audio-only flac files, it may set
> sh_audio->pts but i'm not sure if it will work ok.
IIUC it works in such way for wav & mp3 demuxing.
> > > > > > 3) There is problem with flac-integrated-in-ogg. If I use dump_ogg from 
> > > > G2, it sucessfully dumps
> > > >   flac stream, but demux_ogg return eof afeter some first packets. Could 
> > > > somebody help with this
> > > >   problem?
> > > > probably requires some changes to demux_ogg
> > > ogm is quite silly format, requires demuxer support for each codec type :(
> > So could you (or anybody else help me in this problem)? Thing are even
> >   more complicated: It gets some packets from beginning of stream, and
> > then demux_fill_buffer returns eof.
> 
> i dont know the old ogg demuxer. probably Moritz Bunkus can help you.
> i wrote a new from srcatch for g2, i can help in g2 case only.
I will try to port it to g2 after finishing integrating part of libflac.
(BTW: Its integrating part of the lib OK for g2?)
> > > > > 4) With flac is possible to have bits-per-sample from 4 to 32. However 
> > > > MPlayer (IIUC) allow bps to be
> > > >    only 8, 16, or 32 bits per s. How should I deal with this? How should 
> > > > I deal with this problem? (E.g. is
> > > >    recoding in the codec acceptable?)
> > > 
> > > either add 4-to-any converter to libaf, or add conversion code to codec
> > > the later is not nice, but allowed and already done in many of them
> > > (it probably will not be allowed in g2, though)
> > Then g2 can have troubles: it must (maybe it already does, but I didn't
> >  look in sources) support _all_ bps from 4 bits ps to 4 bytes ps:)
> > yes
> or there must be a filter to convert 4bps to 8bps
I'm integrating part of plugin_common. BTW: filter for 4->8 is probably
 good idea, but for flac there must be filter for 5->, 6->, etc :)
> > > Also (after looking into plugin_common from flac sources) seems, that
> > replay_gain must be supported in player, not libflac! So there will be
> >  some manipulations in ad_flac.c.
> yes
> like in the case of vorbis/tremor
ok
-- With best wishes
Dmitry Baryshkov




More information about the MPlayer-dev-eng mailing list