summaryrefslogtreecommitdiff
path: root/src/main.c
AgeCommit message (Collapse)AuthorFilesLines
2020-08-09Allow choosing time formatLars-Dominik Braun1-6/+17
Introduce new format string for playback time, supporting formats like -remaining/total, elapsed/total, … Fixes #699.
2020-08-09Add optional debugging codeLars-Dominik Braun1-0/+4
Compile *without* -DNDEBUG. The environment variable PIANOBAR_DEBUG accepts a bitfield which enables (1) network (2) audio (4) UI debug messages.
2018-04-07Add network timeouts and retriesLars-Dominik Braun1-1/+1
All network operations can time out now. API requests are retried up to three times (default). Replaces setting max_player_errors with max_retries, which is used for player and API. Adds timeout setting. Partially reverts 436a1d4012553a2f33d0e3a5180b3b5ae0378bdd and fixes (at least) issue #657. Thanks to @exarkun for testing.
2018-03-15Properly protect player struct with mutexLars-Dominik Braun1-25/+23
The volatile keyword neither guarantees atomic access nor memory visibility[1]. Although this is usually not a problem on x86, it is incorrect to rely on this. Use mutex locks to protect all shared player variables and enforce memory visibility. [1] https://wiki.sei.cmu.edu/confluence/display/c/CON02-C.+Do+not+use+volatile+as+a+synchronization+primitive
2016-12-02Exit when no email/password was entered or ^C was pressedLars-Dominik Braun1-2/+7
Fixes #600.
2016-04-14Fix songfinish event when changing stationsLars-Dominik Braun1-15/+15
The event did not contain any song data (title, artist, …), because the playlist was destroyed by the ui command. Now the actual station switch is deferred by introducing nextStation and letting the main loop handle it. Fixes issue #584.
2016-03-05Quit upon reception of two SIGINTLars-Dominik Braun1-5/+10
If player is running one SIGINT restarts current track request, two SIGINT (or more) quit pianobar. Idle main loop (i.e. no player or submenu) quits on SIGINT. Fixes issue #564.
2015-10-23Interruptible requestsLars-Dominik Braun1-1/+25
^C now works as expected: It interrupts API requests, input prompts and audio streaming. Timeouts have been removed.
2015-08-10Move feature test macros to config.hLars-Dominik Braun1-6/+1
I removed most of the *BSD-related stuff, because I can’t test these. If this breaks your build, send me a patch please.
2015-08-10Add feature to change Pandora settingsLars-Dominik Braun1-0/+1
Currently exposed settings: Username, password and explicit content filter. New key for settings is ‘!’, changeable with “act_settings”. Fixes issues #524 and #506.
2015-04-06Switch back to libcurlLars-Dominik Braun1-36/+10
Drops libwaitress. Adds the new dependency libcurl and drops gnutls. I wouldn’t say writing my own HTTP library was a mistake – it was not and the experience gained was worth it. Instead I have to acknowledge that libcurl is just better than my own implementation. Sure, it does a lot more than HTTP – one could call that bloat. Yet if you just want to get the job done™ reusing code is the way to go. See #512 and #513.
2015-03-07player: Ignore volume change before playback startedLars-Dominik Braun1-1/+1
Fixes issue #508.
2014-06-16Re-init terminal when awaking from ^ZLars-Dominik Braun1-6/+2
And simplify code that nobody touched in a long long time… Fixes input issues reported in #458.
2014-06-04Print error message when proxy URL format is incorrectTej Chajed1-2/+10
2014-06-02Show username stored in config if asking for passwordLars-Dominik Braun1-2/+8
Thanks to Unit 193 for the suggestion.
2014-04-18player: Fix state-machineLars-Dominik Braun1-1/+1
Song timer was shown without song playing.
2014-03-31Use libav/ffmpeg for audio decodingLars-Dominik Braun1-38/+37
libav 9.12 and ffmpeg 2.2 have been tested. Here’s why: My mp4 “parser” *cough* never was a mp4 parser in the sense that it actually understood the file format. Instead it grepped the input stream for “magic” strings (section identifiers). That alone should be sufficient to throw away the code and rewrite it. Additionally libfaad2 has not been updated for ages. I guess it was abandoned in favor of libav/ffmpeg. With libav/ffmpeg, which we support both as long as the API’s don’t diverge too much, pianobar gains fast and reliable AAC and MP3 decoding without bothering too much about the details. Most users will have it installed already. On my own machine libav consumes about 2/3 CPU time compared to the previous solution when playing AAC. Unfortunately memory usage doubled and my attempts to disable unused protocols/formats/codec failed due to libav’s API limitations. While cleaning up a small detail regarding the eventcmd API has changed too: Song duration and position are measured in seconds instead of milliseconds now. Since libav/ffmpeg keeps track of accurate timing the precision pianobar keeps track of can be reduced, while still being sufficient for most users.
2014-03-14piano: Request track lengthLars-Dominik Braun1-2/+2
The returned length is used as first length estimate before enough audio data arrives to show the real length and for the eventcmd API. See #427 and #64.
2014-03-13fix warnings now noted due to format string checkingCody P Schafer1-1/+1
2013-08-07piano: Generic linked listsLars-Dominik Braun1-3/+3
Introduces generic linked list structure and functions (like append, delete, …). Removes a lot of copy&pasted code and improves code readability/reusability. Heads up: This change breaks libpiano’s ABI.
2013-07-02piano: Check for libgcrypt errorsLars-Dominik Braun1-2/+8
Fixes mysterious segfaults from issue #369 and #293.
2013-05-13Permit multiple HTTP errors in a rowLars-Dominik Braun1-2/+9
1) Make sure that multiple bad playlists in a row don’t result in a temporary ban 2) Ignore songs skipped because the playlist timed out after pausing for too long
2013-02-26Add play and pause commandsAdam Simpkins1-0/+2
Add commands that always play and always pause, in addition to the current toggle pause command. Closes #342.
2012-11-04New setting: Read RPC TLS portPierre Zurek1-0/+1
Useful for tuner-beta.savagebeast.com:8443. Closes #319.
2012-10-21New setting: Read password from external commandLars-Dominik Braun1-7/+70
Closes #314.
2012-09-22Save station and volume to statefileLars-Dominik Braun1-0/+3
… and restore both on startup. To disable run `ln -sv /dev/null ~/.config/pianobar/state`. Setting an invalid autostart_station in the config file prevents automatic station selection on startup. Closes #305.
2012-09-17Fix history memory leakLars-Dominik Braun1-0/+1
With `history = 0` playlist items are discarded, but not freed.
2012-07-05Initialize libgcryptLars-Dominik Braun1-0/+3
Closes #287
2012-06-14Ignore SIGPIPELars-Dominik Braun1-0/+4
We have all the error handling in place, no need to kill the program. See #274.
2012-06-09piano: Select quality instead of audio formatLars-Dominik Braun1-1/+1
Pandora limited the audio formats we can request explicitly. Don’t rely on this and use the formats available with the given partner credentials. Closes #271.
2012-05-26Move mutex initalization to main threadLars-Dominik Braun1-1/+3
Closes #250.
2012-05-26Revert "Remove pause mutex/add pthread cleanup function"Lars-Dominik Braun1-8/+12
This reverts commit 7df9371491e96a99c1e463f7787aede352ac5a37.
2012-05-14Remove pause mutex/add pthread cleanup functionLars-Dominik Braun1-12/+8
No more mutex locking/checking for quit condition. Should (slightly) increase responsiveness of the player thread. Closes #250.
2012-05-07Configureable RPC hostLars-Dominik Braun1-1/+1
In case someone wants to use internal-tuner.pandora.com. See #243.
2012-05-05Avoid player mode race conditionLars-Dominik Braun1-16/+13
Always run cleanup, ensure thread is joined and player struct is reset. See #250.
2012-05-01Don’t hardcode passwordsLars-Dominik Braun1-1/+3
It’s a bad idea to hardcode these, although playback does not work with non-android login yet.
2012-03-31Warn if ctl is not a fifoLars-Dominik Braun1-3/+13
Ordinary files are not supported and cause problems, so close the fd and print a warning instead. Thanks to Sergey Bronnikov for the initial patch.
2012-03-17Auto-select last remaining item of filtered listLars-Dominik Braun1-1/+2
See #231.
2012-01-12Eliminate concurrent use of (un-)buffered I/OLars-Dominik Braun1-1/+2
Closes #201
2012-01-11TLS is enabled per-request nowLars-Dominik Braun1-1/+0
2011-11-11waitress: Fingerprint checkLars-Dominik Braun1-14/+3
Reduces memory usage, protects against 0wned CA's and avoids ca-bundle confusion. Closes #175
2011-11-10Die if trust file load failsLars-Dominik Braun1-4/+16
2011-11-09TLS is not optional any moreLars-Dominik Braun1-11/+1
2011-11-09Added TLS settingsLars-Dominik Braun1-4/+8
2011-11-09Free Waitress handleLars-Dominik Braun1-0/+1
2011-11-09waitress: move credentials init to WaitressInitLars-Dominik Braun1-2/+2
Reusable.
2011-11-09waitress: Initial TLS implementation (using gnutls)Lars-Dominik Braun1-1/+9
2011-10-22Support seed stationsLars-Dominik Braun1-1/+1
Fixes #165
2011-08-23Configureable fifo pathLars-Dominik Braun1-4/+2
See #149.
2011-07-29Ask for email address instead of usernameOliver Graff1-1/+1
Fixes #144