]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/esd.c
new growl plugin: local only, supports album art (you'll need the Growl Framework)
[vlc] / modules / audio_output / esd.c
index 131139381a8c3f0feb4c98a5b5e1f69e8f955144..b2e6aef098c54b5359b6b45eed1fec3b2a1b9f77 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * esd.c : EsounD module
  *****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN
+ * Copyright (C) 2000, 2001 the VideoLAN team
  * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
 #include <errno.h>                                                 /* ENOMEM */
-#include <fcntl.h>                                       /* open(), O_WRONLY */
-#include <string.h>                                            /* strerror() */
 #include <unistd.h>                                      /* write(), close() */
-#include <stdlib.h>                            /* calloc(), malloc(), free() */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <vlc/vlc.h>
-#include <vlc/aout.h>
-#include "aout_internal.h"
+#include <vlc_aout.h>
 
 #include <sys/socket.h>
 
@@ -169,7 +169,7 @@ static int Open( vlc_object_t *p_this )
     {
         p_sys->latency = 0;
     }
-        
+
     /* ESD latency is calculated for 44100 Hz. We don't have any way to get the
      * number of buffered samples, so I assume ESD_BUF_SIZE/2 */
     p_sys->latency +=
@@ -199,16 +199,16 @@ static void Play( aout_instance_t *p_aout )
 
     if ( p_buffer != NULL )
     {
-        int pos;
-        char *data = p_buffer->p_buffer;
+        unsigned int pos;
+        unsigned char *data = p_buffer->p_buffer;
 
-        for( pos = 0; pos + ESD_BUF_SIZE <= p_buffer->i_nb_bytes; 
+        for( pos = 0; pos + ESD_BUF_SIZE <= p_buffer->i_nb_bytes;
              pos += ESD_BUF_SIZE )
         {
             i_tmp = write( p_sys->i_fd, data + pos, ESD_BUF_SIZE );
             if( i_tmp < 0 )
             {
-                msg_Err( p_aout, "write failed (%s)", strerror(errno) );
+                msg_Err( p_aout, "write failed (%m)" );
             }
         }
         aout_BufferFree( p_buffer );