]> git.sesse.net Git - vlc/blobdiff - modules/access/oss.c
Use same string in definition as in ui
[vlc] / modules / access / oss.c
index 69f403ac757773591eff2c10a90a2f3a2a8adde1..04d06d0f5f794377e9fb1b8e11b6b941f9c0bee1 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * oss.c : OSS input module for vlc
  *****************************************************************************
- * Copyright (C) 2002-2009 the VideoLAN team
+ * Copyright (C) 2002-2009 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Benjamin Pracht <bigben at videolan dot org>
@@ -9,19 +9,19 @@
  *          Antoine Cellerier <dionoea at videolan d.t org>
  *          Dennis Lou <dlou99 at yahoo dot com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -68,11 +68,6 @@ static void DemuxClose( vlc_object_t * );
 #define SAMPLERATE_LONGTEXT N_( \
     "Samplerate of the captured audio stream, in Hz (eg: 11025, 22050, 44100, 48000)" )
 
-#define CACHING_TEXT N_("Caching value in ms")
-#define CACHING_LONGTEXT N_( \
-    "Caching value for OSS captures. This " \
-    "value should be set in milliseconds." )
-
 #define OSS_DEFAULT "/dev/dsp"
 
 #define CFG_PREFIX "oss-"
@@ -91,8 +86,6 @@ vlc_module_begin ()
                 true )
     add_integer( CFG_PREFIX "samplerate", 48000, SAMPLERATE_TEXT,
                 SAMPLERATE_LONGTEXT, true )
-    add_integer( CFG_PREFIX "caching", DEFAULT_PTS_DELAY / 1000,
-                CACHING_TEXT, CACHING_LONGTEXT, true )
 vlc_module_end ()
 
 /*****************************************************************************
@@ -122,7 +115,6 @@ struct demux_sys_t
     int  i_fd;
 
     /* Audio */
-    int i_cache;
     unsigned int i_sample_rate;
     bool b_stereo;
     size_t i_max_frame_size;
@@ -173,7 +165,6 @@ static int DemuxOpen( vlc_object_t *p_this )
 
     p_sys->i_sample_rate = var_InheritInteger( p_demux, CFG_PREFIX "samplerate" );
     p_sys->b_stereo = var_InheritBool( p_demux, CFG_PREFIX "stereo" );
-    p_sys->i_cache = var_InheritInteger( p_demux, CFG_PREFIX "caching" );
     p_sys->i_fd = -1;
     p_sys->p_es = NULL;
     p_sys->p_block = NULL;
@@ -228,7 +219,8 @@ static int DemuxControl( 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)p_sys->i_cache * 1000;
+            *pi64 = INT64_C(1000)
+                  * var_InheritInteger( p_demux, "live-caching" );
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
@@ -302,7 +294,7 @@ static block_t* GrabAudio( demux_t *p_demux )
     block_t *p_block;
 
     if( p_sys->p_block ) p_block = p_sys->p_block;
-    else p_block = block_New( p_demux, p_sys->i_max_frame_size );
+    else p_block = block_Alloc( p_sys->i_max_frame_size );
 
     if( !p_block )
     {