]> git.sesse.net Git - vlc/blobdiff - src/input/control.c
Replace remaining call sites of aout_BufferFree()
[vlc] / src / input / control.c
index e93b6dc10a4d30b47ac7071382565455e2eb7f42..d50ea973eed0c897c035ac14f9df5dc3ab1c4f88 100644 (file)
@@ -1,24 +1,24 @@
 /*****************************************************************************
  * control.c
  *****************************************************************************
- * Copyright (C) 1999-2004 the VideoLAN team
+ * Copyright (C) 1999-2004 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Gildas Bazin <gbazin@videolan.org>
  *
- * 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.
  *****************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -332,9 +332,9 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
 
             vlc_mutex_lock( &p_input->p->p_item->lock );
 
-            /* current title if -1 */
-            if ( *pi_req_title_offset < 0 )
-                *pi_req_title_offset = p_input->p->i_title_offset;
+            int i_current_title = var_GetInteger( p_input, "title" );
+            if ( *pi_req_title_offset < 0 ) /* return current title if -1 */
+                *pi_req_title_offset = i_current_title;
 
             if( p_input->p->i_title && p_input->p->i_title > *pi_req_title_offset )
             {
@@ -349,22 +349,6 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
             }
         }
 
-        case INPUT_ADD_OPTION:
-        {
-            const char *psz_option = va_arg( args, const char * );
-            const char *psz_value = va_arg( args, const char * );
-            char *str;
-            int i;
-
-            if( asprintf( &str, "%s=%s", psz_option, psz_value ) == -1 )
-                return VLC_ENOMEM;
-
-            i = input_item_AddOption( p_input->p->p_item, str,
-                                      VLC_INPUT_OPTION_UNIQUE );
-            free( str );
-            return i;
-        }
-
         case INPUT_GET_VIDEO_FPS:
             pf = (double*)va_arg( args, double * );
 
@@ -456,11 +440,11 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
 
         case INPUT_GET_AOUT:
         {
-            aout_instance_t *p_aout = input_resource_HoldAout( p_input->p->p_resource );
+            audio_output_t *p_aout = input_resource_HoldAout( p_input->p->p_resource );
             if( !p_aout )
                 return VLC_EGENERIC;
 
-            aout_instance_t **pp_aout = (aout_instance_t**)va_arg( args, aout_instance_t** );
+            audio_output_t **pp_aout = (audio_output_t**)va_arg( args, audio_output_t** );
             *pp_aout = p_aout;
             return VLC_SUCCESS;
         }
@@ -481,7 +465,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
             const int i_id = va_arg( args, int );
             vlc_object_t    **pp_decoder = va_arg( args, vlc_object_t ** );
             vout_thread_t   **pp_vout    = va_arg( args, vout_thread_t ** );
-            aout_instance_t **pp_aout    = va_arg( args, aout_instance_t ** );
+            audio_output_t **pp_aout    = va_arg( args, audio_output_t ** );
 
             return es_out_Control( p_input->p->p_es_out_display, ES_OUT_GET_ES_OBJECTS_BY_ID, i_id,
                                    pp_decoder, pp_vout, pp_aout );