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

Arpi arpi at thot.banki.hu
Mon Sep 1 16:31:52 CEST 2003


Hi,

> Hello!
> 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.

> > > 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.

> > > > 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.

> > > 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

> 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

> Suppose, that I'll import some files from flac src's (stream_decoder
>  from libflac & samples processing from plugin_common) and send updated
>  version of patch in two or three days.

ok

the problem is that there are many kind of codec APIs out there, and it's
impossible to design a framework which 100% match all of them.


A'rpi / Astral & ESP-team

--
Developer of MPlayer G2, the Movie Framework for all - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list