mpg123.dll for pm123 1.2 based on mpg123 0.59m
Samuel Audet <guardia@step.polymtl.ca> 1998-2003

Notes on features
=================

This is some old text that might still be interesting...

Dynamic priority boost
----------------------

What it does, is that it checks if the second ahead buffer is filled, if it
is not, it boosts the decoder priority.  When the decoder realizes it has
the third ahead buffer filled, it drops to normal priority. The second
buffer ahead is important here.  During a boost, priority should normally
be in time critical class, where the decoder can get all the CPU attention
it needs.  Up there, if the CPU is fast enough to decode and fill the
second ahead buffer before the first ahead buffer is played (which is
always the case if your CPU can play MP3s in realtime in the first place),
you can easily imagine it's impossible for mpg123/2 to skip in those
conditions.  I have played *2* MP3s on my P150 and watched a "dir /s"
smooothly and happily scrolling in the foreground without either MP3
skipping... I think that's pretty convincing.

I know hardware level bottlenecks which could make mpg123/2 skip, but they
are the same ones that can make a Zmodem transfer give "CRC32 errors", and
a PPP connection complains about "Invalid FCS":

- You have a polling device (like for example old old 2x CD-ROMs, and
  PRINT01.SYS without /IRQ).
- You have a video card that supports "automatic PCI bus retry", but your
  motherboard stops processing during those retries.  Disable that feature.
- You have an ATI Barf64 and you are experiencing a bug in the video driver
  using software mouse pointers (ie.: colored mouse pointers).
- Your motherboard or controller card plain sucks.

I recommend the default values that are class Time Critical delta 0 for
boost and Regular delta 31 for normal.  The former leaves higher priority
tasks like multimedia do their job.  The latter permits mpg123/2 to have
priority over hogging DOS and Win-OS/2 sessions while leaving foreground
OS/2 application responsive.

However, I recently found out that dynamically resizing a heavy window
(like a webbrowser or wordprocessor) hogs the CPU beyong belief.  Rest
calm, this is not a failure of the Dynamic Priority Boost.  You can try it
with mpg123 running with -b 5 -B 330 -N 330 and it will still skip.

The format for the priority parameters -B and -N is [class number][delta number]

class number in order of priority: 1,2,4,3
delta number varies from -31 to 31

For example:  use normal priority Foreground delta -31

[C:\]mpg123 -N 4-31

If you don't want to use dynamic priority boost, just set -B and -N to the
same value.


Buffers
-------

You can specify the number of audio buffer to fill in advance.  The default
is 32, and since each buffer is 16KB, this gives about 3 seconds decoder
independancy to the audio engine before a priority boost or a skip occurs
with 44.1kHz, 16bit and stereo output.

The recommended minimum is 5, and maximum is 200.


Rewind, Fast Forward, Position Jump
-----------------------------------

These are only "kludges".  They kind of work fine on consistent MPEG stream,
but MPEG streams are not like straight PCM files.  They contain packets all
over the place.  To make it work properly, I'd have to read all of them,
and it would make the player seek a lot slower.

The Jump to accepts seconds, or minutes and seconds separated by a colon.

ie.: Jump to: 1:50  or Jump to: 110


The Played, Remaining and Total timers
--------------------------------------

None of them relies on the system timer.  It only counts the number of
frames that have passed by (that is, played by the audio device, so in a
certain sense, the audio device determines where we are).  The calculation
seems to work fine on the MPEG streams I tried, but because of the above,
the timers might get lost on inconsistent MPEG streams.

It should also be noted that the Total time is recalculated each frame, so
if you are currently playing an MP3 being d/led, the total time will
increase with it.

Of course, they make mpg123 use a tiny bit more CPU time...


