[MPlayer-dev-eng] [PATCH] ad_mpg123: runtime format switch and not closing stream during decodeh

Thomas Orgis thomas-forum at orgis.org
Mon Sep 23 21:50:02 CEST 2013


Am Mon, 23 Sep 2013 21:16:18 +0200
schrieb Reimar Döffinger <Reimar.Doeffinger at gmx.de>: 

> > even mixing MP2 and MP3 pieces. There, ad_mpg123 is more tolerant than
> > ffmp3 or ffmp3float.
> 
> I'm quite sure I explained it somewhere... Anyway this isn't more tolerant,
> the only issue when using ffmp3 is that ad_ffmpeg prefers the container framerate
> over the one in the audio stream.
> Unfortunately for raw mp3 that is complete nonsense, however for mp3 in avi for example it can be necessary to play correctly.

Well, should ad_mpg123 avoid format changes for the same reason? That
would mean allowing libmpg123 to decode, but ignoring output until
format matches the proper one again (whichever that is). Actually,
since MPlayer pre-parses the stream anyway (like, removing ID3), I'd
assume it has the correct stream fed to ad_mpg123. But you're the
MPlayer expert.

> > PS: I would like to offer default (16 bit) and floating point output,
> > the difference being this line in ad_mpg123:
> > 
> > mpg123_param(con->handle, MPG123_ADD_FLAGS, MPG123_FORCE_FLOAT, 0.);

> Just to be clear, you are asking about how to add this to mpg123, not MPlayer?

No. It is an inherent feature of libmpg123 that it can produce
differing formats. In case of s16 vs. f32 this means using different
synth functions, in assembly for SSE and x86-64 SSE, that remove the
need for any extra format conversion afterwards (at least on my Core2,
it is really quicker to work with s16 in the synth, less difference on
more modern CPUs).

What I am asking is how to best integrate this option. Would be best
way indeed be to offer ad_mpg123.c and ad_mpg123float.c which enable
`mplayer -ac mpg123` for default format s16 and `mplayer -ac
mpg123float` for floating point format, without adding postprocessing
filters (like ffmp3 and ffmp3float)? Of course, what I'd do in that
case is to write one "template" and have the c files include it.
I just wondered if there is another way to communicate preference for
s16 or f32 before decoding. Aside performance, you could prefer f32
also for s16 output, if MPlayer wants to do high-quality conversion to
s16 itself ...


Alrighty then,

Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20130923/791d5f53/attachment.asc>


More information about the MPlayer-dev-eng mailing list