The quality of 2to1 and 4to1 decoding is good and it even saves work.
Win-win.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4651 35dc7657-300d-0410-a2e5-dc2837fedb53
This is about preventing unnecessary work where the downsampling in
libmpg123 (factor 2 or 4) can be used. The external resampler is
only called when we would have to resort to NtoM decoding.
A major change is that libmpg123 now considers floating point encoding
by itself, at all.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4649 35dc7657-300d-0410-a2e5-dc2837fedb53
This now forces the proper resampler with --rate and --resample with
non-zero value.
TODO:
- Avoid the resampler when unnecessary. This is some more complex
setup code, but doable. Loose filter history on re-enabling
the resampler.
- Finish integration with pitching.
Have a look at that:
for s in 0 1 2
do src/mpg123 -vv -r 48000 --resample $s -w sweep$s.wav src/tests/sweep.mp3
sox sweep$s.wav -n spectrogram
mv spectrogram.png sweep$s.png
done
Some graphs that drive the point home.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4644 35dc7657-300d-0410-a2e5-dc2837fedb53
This only affects one output module that wasn't built since a long time,
I guess.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4641 35dc7657-300d-0410-a2e5-dc2837fedb53
This adds some bits for supporting the syn123 resampler, but not putting
it to work yet.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4640 35dc7657-300d-0410-a2e5-dc2837fedb53
This now filters strings from libmpg123 metadata and the user/web input for useless/nasty
control/non-printable characters when the output is a terminal. It covers all relevant
printouts except the ones I forgot. Metadata, user-provided command-line arguments and
file names in the playlist are covered. I guess really relevant is the data that the
user did not enter explicitly (metadata in streams, playlist from URL).
The proper way would be to fully use locales and a curses library to sanitize terminal
output, but I really would like to avoid that mess, having my personal mess as a compromise
that should mostly work OK. Future may correct me. When we want to do it properly, we should
re-write the whole mpg123 application from scratch, using the mpg123 libraries for audio and
other libraries for the interface.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4636 35dc7657-300d-0410-a2e5-dc2837fedb53
This early free() of the buffer in safe_exit() occured while the output
may still be during execution of out123_play() to use that buffer. Now
it's after output stopped.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4635 35dc7657-300d-0410-a2e5-dc2837fedb53
This catches whitespace characters like line breaks and turns sequences
of those into a single normal space character before filtering for
nasties in terminal output. So
Some
Strange
Title
turns into Some Strange Title for print, not SomeStrangeTitle.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4633 35dc7657-300d-0410-a2e5-dc2837fedb53
This introduces a check to only filter the non-printing characters
when actually printing to a terminal. The print_outstr() function
shall be used in future.
The test mp3 file got a line break introduced in the album name.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4631 35dc7657-300d-0410-a2e5-dc2837fedb53
This takes the code out if id3_gap() to be able to make UTF-8 from any encoding
that mpg123 encounters elsewhere (assuming everything is ASCII-based there).
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4630 35dc7657-300d-0410-a2e5-dc2837fedb53
This makes --STDOUT for out123 more official and robust using
newly introduced unintr_fwrite(). The other unintr functions got
fixes for actual interrupts that result in negative return vaues.
For mpg123, --STDOUT has been removed. It was an alias to --stdout
anyway, and it it actually not that easy to get right with the
live playback semantics.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4626 35dc7657-300d-0410-a2e5-dc2837fedb53
This finally enables proper operation on concatenated files appearing as
one big stream with multiple embedded ID3v2 tags. The mode of actually
updating exiting data instead of replacing it has been tested by me before
this commit, but will lay dormant now until someone presents a file that
actually features an ID3v2.4 update tag.
There are parts of the spec that are just theoretical. I even looked at
a competing implementaton in taglib and didn't notice any extended header
parsing besides skipping it. So I guess hardly anyone ever bothered
implementing that part of the spec.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4609 35dc7657-300d-0410-a2e5-dc2837fedb53
This implements proper behaviour for the assumption that multiple encountered
ID3v2 tags shall be applied as updates, adding only to the stored elements
if existing entries should not be overwritten according to the uniqueness
rules of the standard.
An easy way to test this is to decode a track with --seek-index 0 and
repeatedly seek back to the beginning (and add a line to print out
the number of collected ID3 texts/comments). The old libmpg123 would
steadily append the same entries again and again to the id3 data
structures as the leading ID3v2 tag is parsed repeatedly. This is
strictly speaking no memory leak as the pointers are still properly
managed, but of course it is a leak in practice as data accumulates
needlessly.
Note that this accumulation only happened when the user explicitly
disabled the seek index for regular files, which would prevent repeated
parsing of a leading ID3v2 tag, or in the case of concatenated files
in one big stream, where libmpg123 would remember all ID3v2 data
ever encountered. It is not easy to judge the bugginess of this behaviour.
It could actually be a feature to accumulate all ID3 data. And users
could call mpg123_meta_free() after each extraction to minimize memory
usage. Nevertheless, this ends now in the sense that ID3v2 frames/fields
that are supposed to be unique are also unique in storage.
The next step will be to add parsing of the update flag and clearing
of existing ID3v2 data when a non-update tag is parsed.
git-svn-id: svn://scm.orgis.org/mpg123/trunk@4608 35dc7657-300d-0410-a2e5-dc2837fedb53