[MPlayer-dev-eng] [PATCH] update ad_mpg123 in preparation to replace mp3lib

Thomas Orgis thomas-forum at orgis.org
Wed Feb 29 13:57:54 CET 2012


Hi folks,

I did quite some hacking, testing, measuring, hairpulling on the issue
of replacing the dating mp3lib code for good. Grab a cup of your
favourite beverage and have a read at

http://mpg123.org/beating_mp3lib_in_mplayer/

The essence is that on modern systems the switch to mpg123 is a
clear benefit in performance, while it is not so clear on a certain
machine, namely my Duron test rig. But getting proper performance
diagnostics of mp3lib vs. mpg123 in MPlayer is a royal PITA. This is a
nimbly moving target ruled by side effects.

Anyhow, here is my updated patch to get the most out of upcoming
mpg123 1.14.0 (the 1.14-beta1 just being released) with MPlayer and
also to play safe with older releases. On x86-64, also the old mpg123
brings performance benefits.

Test, discuss, and hopefully apply;-)

Sidestepping:

There is one related issue: I noticed that MPlayer does not play free
format streams, like http://mpg123.org/drum-free133.mp3 . While mpg123
can handle that fine, the demuxer code doesn't hand this over to
ad_mpg123 but invokes something else:

mplayer-svn$  ./mplayer http://mpg123.org/drum-free133.mp3
MPlayer SVN-r34780-4.6.2 (C) 2000-2012 MPlayer Team

Playing http://mpg123.org/drum-free133.mp3.
Resolving mpg123.org for AF_INET6...
Connecting to server mpg123.org[2a01:238:20a:202:1086::86]: 80...

Failed to connect to server with AF_INET6
Resolving mpg123.org for AF_INET...
Connecting to server mpg123.org[81.169.145.71]: 80...

Cache size set to 320 KBytes
Cache fill:  0.00% (0 bytes)   



Exiting... (End of file)
13:53|dunkelstern:mplayer-svn$ mpg123 http://mpg123.org/drum-free133.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.13.4; written and copyright by Michael Hipp and others
        free software (LGPL/GPL) without any warranty but with best wishes

Directory: http://mpg123.org/
Playing MPEG stream 1 of 1: drum-free133.mp3 ...
MPEG 1.0 layer III, 133 kbit/s (free format), 48000 Hz joint-stereo

[0:29] Decoding of drum-free133.mp3 finished.


When playing the file locally, it's a bit different, but not much:
mplayer-svn$  ./mplayer ./drum-free133.mp3
MPlayer SVN-r34780-4.6.2 (C) 2000-2012 MPlayer Team

Playing ./drum-free133.mp3.
libavformat version 54.1.100 (internal)


Exiting... (End of file)


So this does not care about what MPEG decoder you use, but at least it
might be good to know that using ad_mpg123, you should be able to
decode those streams. But you cannot derive the packet size from a
frame header, you have to search for a followup header in the stream.
This is what libmpg123 does internally.

Mind, free format streams are not a must and I never seen one in the
wild that I didn't create myself using LAME.


Alrighty then,

Thomas.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpg123-ready-to-obsolete-mp3lib.patch
Type: text/x-patch
Size: 13756 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120229/4d3c4366/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120229/4d3c4366/attachment.asc>


More information about the MPlayer-dev-eng mailing list