]> git.sesse.net Git - vlc/blobdiff - modules/access/jack.c
Update LGPL license blurb, choosing v2.1+.
[vlc] / modules / access / jack.c
index ed87e881d39e751d7aa0d5f202e73f09ebc62406..b7fb6d62440639d5905bd13fed8719c3c2ea4b02 100644 (file)
 #include <vlc_plugin.h>
 #include <vlc_input.h>
 #include <vlc_demux.h>
-#include <vlc_vout.h>
-#include <vlc_codecs.h>
 #include <vlc_url.h>
 #include <vlc_strings.h>
 
 #include <jack/jack.h>
 #include <jack/ringbuffer.h>
 
-#include <errno.h>
 #include <sys/types.h>
 #include <unistd.h>
 
@@ -367,8 +364,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
     case DEMUX_GET_PTS_DELAY:
         pi64 = ( int64_t* )va_arg( args, int64_t * );
-        *pi64 = ( int64_t )var_GetInteger( p_demux, "jack-input-caching" )
-            * 1000;
+        *pi64 = var_GetInteger( p_demux, "jack-input-caching" ) * 1000;
         return VLC_SUCCESS;
 
     case DEMUX_GET_TIME:
@@ -445,7 +441,7 @@ int Process( jack_nframes_t i_frames, void *p_arg )
         }
     }
 
-    return 1;
+    return 0;
 }
 
 
@@ -463,6 +459,8 @@ static block_t *GrabJack( demux_t *p_demux )
 
     if( i_read < 100 ) /* avoid small read */
     {   /* vlc has too much free time on its hands? */
+#undef msleep
+#warning Hmm.... looks wrong
         msleep(1000);
         return NULL;
     }
@@ -540,7 +538,7 @@ static void Port_finder( demux_t *p_demux )
                 i_out_ports++;
             }
             /* alloc an array to store all the matched ports */
-            p_sys->pp_jack_port_table = realloc( p_sys->pp_jack_port_table,
+            p_sys->pp_jack_port_table = xrealloc( p_sys->pp_jack_port_table,
                 (i_out_ports * sizeof( char * ) + i_total_out_ports * sizeof( char * ) ) );
 
             for(int i=0; i<i_out_ports;i++)
@@ -563,7 +561,7 @@ static void Port_finder( demux_t *p_demux )
 static void Parse( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
-    char *psz_dup = strdup( p_demux->psz_path );
+    char *psz_dup = strdup( p_demux->psz_location );
     char *psz_parser = psz_dup;
 
     if( !strncmp( psz_parser, "channels=", strlen( "channels=" ) ) )