summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2012-05-04 20:53:29 +0200
committerLars-Dominik Braun <lars@6xq.net>2012-05-04 20:53:29 +0200
commitd24480e491075150634c04c52d2c9efef9244492 (patch)
tree9d14041cb141e35381a4d179e1d0c383562f8000
parent0fda775ebd32b230179c200b89ebd520d9a9e4a2 (diff)
downloadpianobar-d24480e491075150634c04c52d2c9efef9244492.tar.gz
pianobar-d24480e491075150634c04c52d2c9efef9244492.tar.bz2
pianobar-d24480e491075150634c04c52d2c9efef9244492.zip
Lofi AAC support
32kbit/s. Closes #233.
-rw-r--r--contrib/pianobar.12
-rw-r--r--src/libpiano/piano.h3
-rw-r--r--src/libpiano/request.c4
-rw-r--r--src/player.c2
-rw-r--r--src/settings.c2
5 files changed, 11 insertions, 2 deletions
diff --git a/contrib/pianobar.1 b/contrib/pianobar.1
index da87270..c9c4ee5 100644
--- a/contrib/pianobar.1
+++ b/contrib/pianobar.1
@@ -156,7 +156,7 @@ Increase volume.
Replacement for %@ in station format string. It's " @ " by default.
.TP
-.B audio_format = {aacplus,mp3,mp3-hifi}
+.B audio_format = {aacplus-lofi,aacplus,mp3,mp3-hifi}
Select audio format. aacplus is default if both libraries (faad, mad) are
available. mp3-hifi is available for Pandora One customers only.
diff --git a/src/libpiano/piano.h b/src/libpiano/piano.h
index c8c01db..249061b 100644
--- a/src/libpiano/piano.h
+++ b/src/libpiano/piano.h
@@ -65,7 +65,8 @@ typedef enum {
PIANO_AF_UNKNOWN = 0,
PIANO_AF_AACPLUS = 1,
PIANO_AF_MP3 = 2,
- PIANO_AF_MP3_HI = 3
+ PIANO_AF_MP3_HI = 3,
+ PIANO_AF_AACPLUS_LO = 4,
} PianoAudioFormat_t;
typedef struct PianoSong {
diff --git a/src/libpiano/request.c b/src/libpiano/request.c
index 427cc2d..2e17872 100644
--- a/src/libpiano/request.c
+++ b/src/libpiano/request.c
@@ -42,6 +42,10 @@ THE SOFTWARE.
*/
static const char *PianoAudioFormatToString (PianoAudioFormat_t format) {
switch (format) {
+ case PIANO_AF_AACPLUS_LO:
+ return "HTTP_32_AACPLUS";
+ break;
+
case PIANO_AF_AACPLUS:
return "HTTP_64_AACPLUS";
break;
diff --git a/src/player.c b/src/player.c
index 9a2306a..733a315 100644
--- a/src/player.c
+++ b/src/player.c
@@ -429,6 +429,7 @@ void *BarPlayerThread (void *data) {
switch (player->audioFormat) {
#ifdef ENABLE_FAAD
+ case PIANO_AF_AACPLUS_LO:
case PIANO_AF_AACPLUS:
player->aacHandle = NeAACDecOpen();
/* set aac conf */
@@ -472,6 +473,7 @@ void *BarPlayerThread (void *data) {
switch (player->audioFormat) {
#ifdef ENABLE_FAAD
+ case PIANO_AF_AACPLUS_LO:
case PIANO_AF_AACPLUS:
NeAACDecClose(player->aacHandle);
free (player->sampleSize);
diff --git a/src/settings.c b/src/settings.c
index 1eeec50..19c07f5 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -222,6 +222,8 @@ void BarSettingsRead (BarSettings_t *settings) {
} else if (streq ("audio_format", key)) {
if (streq (val, "aacplus")) {
settings->audioFormat = PIANO_AF_AACPLUS;
+ } else if (streq (val, "aacplus-lofi")) {
+ settings->audioFormat = PIANO_AF_AACPLUS_LO;
} else if (streq (val, "mp3")) {
settings->audioFormat = PIANO_AF_MP3;
} else if (streq (val, "mp3-hifi")) {