~ubuntu-branches/ubuntu/saucy/mpd/saucy

« back to all changes in this revision

Viewing changes to src/output/solaris_output_plugin.c

  • Committer: Bazaar Package Importer
  • Author(s): Angel Abad
  • Date: 2011-02-02 12:26:30 UTC
  • mfrom: (1.5.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20110202122630-bdyx8w4k94doz4fs
Tags: 0.16.1-1ubuntu1
* Merge from debian unstable. Remaining changes:
  - debian/control:
    + Don't build-depend on libmikmod2-dev (Debian bug #510675).
    + Move avahi-daemon from Suggests field to Recommends field.
  - debian/mpd.init.d:
    + Read mpd user from mpd.conf.
  - debian/control, debian/rules:
    + Add libmp3lame-dev to the build dependencies and enable lame.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2003-2009 The Music Player Daemon Project
 
2
 * Copyright (C) 2003-2010 The Music Player Daemon Project
3
3
 * http://www.musicpd.org
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
17
17
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
18
 */
19
19
 
 
20
#include "config.h"
20
21
#include "output_api.h"
 
22
#include "fd_util.h"
21
23
 
22
24
#include <glib.h>
23
25
 
87
89
 
88
90
        /* support only 16 bit mono/stereo for now; nothing else has
89
91
           been tested */
90
 
        audio_format->bits = 16;
 
92
        audio_format->format = SAMPLE_FORMAT_S16;
91
93
 
92
94
        /* open the device in non-blocking mode */
93
95
 
94
 
        so->fd = open(so->device, O_WRONLY|O_NONBLOCK);
 
96
        so->fd = open_cloexec(so->device, O_WRONLY|O_NONBLOCK, 0);
95
97
        if (so->fd < 0) {
96
98
                g_set_error(error, solaris_output_quark(), errno,
97
99
                            "Failed to open %s: %s",
117
119
 
118
120
        info.play.sample_rate = audio_format->sample_rate;
119
121
        info.play.channels = audio_format->channels;
120
 
        info.play.precision = audio_format->bits;
 
122
        info.play.precision = 16;
121
123
        info.play.encoding = AUDIO_ENCODING_LINEAR;
122
124
 
123
125
        ret = ioctl(so->fd, AUDIO_SETINFO, &info);