Changeset 3622:21fc206e6ea0 in roaraudio for plugins/xmms


Ignore:
Timestamp:
03/02/10 21:24:17 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

sysio->vio

Location:
plugins/xmms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/xmms/all.h

    r3621 r3622  
    7676 struct roar_connection con; 
    7777 struct roar_stream     stream; 
    78  int                 data_fh; 
     78 struct roar_vio_calls  vio; 
    7979 long unsigned int   written; 
    8080 long unsigned int   bps; 
  • plugins/xmms/roar.c

    r3620 r3622  
    7878 
    7979void roar_write(void *ptr, int length) { 
    80  int r; 
     80 ssize_t r; 
    8181 
    8282 if ( g_inst.pause ) 
     
    8686 
    8787 while (length) { 
    88   if ( (r = write(g_inst.data_fh, ptr, length >= 17640 ? 17640 : length)) != -1 ) { 
     88  if ( (r = roar_vio_write(&(g_inst.vio), ptr, length >= 1764*2 ? 1764*2 : length)) != -1 ) { 
    8989   g_inst.written   += r; 
    9090   ptr              += r; 
     
    147147 roar_close(); 
    148148 
    149  if ( (g_inst.data_fh = roar_simple_new_stream_obj(&(g_inst.con), &(g_inst.stream), 
    150                               rate, nch, bits, codec, ROAR_DIR_PLAY)) == -1) { 
     149 if ( roar_vio_simple_new_stream_obj(&(g_inst.vio), &(g_inst.con), &(g_inst.stream), 
     150                                     rate, nch, bits, codec, ROAR_DIR_PLAY) == -1 ) { 
    151151  roar_disconnect(&(g_inst.con)); 
    152152  g_inst.state |= STATE_CONNECTED; 
     
    173173 
    174174void roar_close(void) { 
    175  if ( g_inst.data_fh != -1 ) 
    176   close(g_inst.data_fh); 
    177  g_inst.data_fh = -1; 
     175 int was_playing = g_inst.state & STATE_PLAYING; 
     176 
    178177 g_inst.state |= STATE_PLAYING; 
    179178 g_inst.state -= STATE_PLAYING; 
     179 
     180 if ( was_playing ) 
     181  roar_vio_close(&(g_inst.vio)); 
     182 
    180183 g_inst.written = 0; 
    181184 ROAR_DBG("roar_close(void) = (void)"); 
Note: See TracChangeset for help on using the changeset viewer.