~ubuntu-branches/ubuntu/wily/pianobar/wily-proposed

« back to all changes in this revision

Viewing changes to src/player.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Faraone
  • Date: 2011-02-08 17:23:25 UTC
  • mfrom: (1.3.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110208172325-0qf3sxpsu37j5ez9
Tags: 2011.01.24-1
* New upstream version. 
* Switch to DEP5 copyright.
* Augment CFLAGS to use the c99 standard.
* Don't install the now-removed AUTHORS file into docs.
* Drop dep on cmake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
Copyright (c) 2008-2010
3
 
        Lars-Dominik Braun <PromyLOPh@lavabit.com>
 
3
        Lars-Dominik Braun <lars@6xq.net>
4
4
 
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
of this software and associated documentation files (the "Software"), to deal
56
56
 *      @param apply this gain
57
57
 *      @return this * yourvalue = newgain value
58
58
 */
59
 
static inline unsigned int computeReplayGainScale (float applyGain) {
 
59
unsigned int BarPlayerCalcScale (float applyGain) {
60
60
        return pow (10.0, applyGain / 20.0) * RG_SCALE_FACTOR;
61
61
}
62
62
 
199
199
                                        format.bits = 16;
200
200
                                        format.channels = player->channels;
201
201
                                        format.rate = player->samplerate;
202
 
                                        format.byte_format = AO_FMT_LITTLE;
 
202
                                        format.byte_format = AO_FMT_NATIVE;
203
203
                                        if ((player->audioOutDevice = ao_open_live (audioOutDriver,
204
204
                                                        &format, NULL)) == NULL) {
205
205
                                                /* we're not interested in the errno */
358
358
                        format.bits = 16;
359
359
                        format.channels = player->channels;
360
360
                        format.rate = player->samplerate;
361
 
                        format.byte_format = AO_FMT_LITTLE;
 
361
                        format.byte_format = AO_FMT_NATIVE;
362
362
                        if ((player->audioOutDevice = ao_open_live (audioOutDriver,
363
363
                                        &format, NULL)) == NULL) {
364
364
                                player->aoError = 1;
414
414
 
415
415
        /* init handles */
416
416
        pthread_mutex_init (&player->pauseMutex, NULL);
417
 
        player->scale = computeReplayGainScale (player->gain);
418
417
        player->waith.data = (void *) player;
419
418
        /* extraHeaders will be initialized later */
420
419
        player->waith.extraHeaders = extraHeaders;