Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
1b7ce269
Commit
1b7ce269
authored
Dec 06, 2002
by
Sam Hocevar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ./src/*, ./include/*: fixed a bunch of badly initialized structures, a few
signed/unsigned comparisons, and removed trailing spaces here and there.
parent
426a6dc5
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
163 additions
and
155 deletions
+163
-155
include/aout_internal.h
include/aout_internal.h
+3
-3
include/audio_output.h
include/audio_output.h
+8
-8
include/configuration.h
include/configuration.h
+19
-19
include/input_ext-intf.h
include/input_ext-intf.h
+3
-4
include/modules_inner.h
include/modules_inner.h
+4
-2
src/audio_output/common.c
src/audio_output/common.c
+11
-10
src/audio_output/dec.c
src/audio_output/dec.c
+2
-2
src/audio_output/filters.c
src/audio_output/filters.c
+14
-16
src/audio_output/input.c
src/audio_output/input.c
+2
-2
src/audio_output/intf.c
src/audio_output/intf.c
+3
-3
src/audio_output/mixer.c
src/audio_output/mixer.c
+7
-6
src/audio_output/output.c
src/audio_output/output.c
+6
-5
src/input/input.c
src/input/input.c
+2
-4
src/input/input_clock.c
src/input/input_clock.c
+8
-10
src/input/input_ext-dec.c
src/input/input_ext-dec.c
+2
-2
src/input/input_ext-plugins.c
src/input/input_ext-plugins.c
+8
-6
src/libvlc.h
src/libvlc.h
+13
-7
src/misc/modules_plugin.h.in
src/misc/modules_plugin.h.in
+7
-7
src/misc/objects.c
src/misc/objects.c
+4
-4
src/misc/threads.c
src/misc/threads.c
+12
-12
src/misc/variables.c
src/misc/variables.c
+18
-18
src/playlist/playlist.c
src/playlist/playlist.c
+3
-3
src/video_output/video_text.c
src/video_output/video_text.c
+4
-2
No files found.
include/aout_internal.h
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* aout_internal.h : internal defines for audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aout_internal.h,v 1.3
4
2002/1
1/14 22:38:46 massiot
Exp $
* $Id: aout_internal.h,v 1.3
5
2002/1
2/06 10:10:40 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
...
...
@@ -275,7 +275,7 @@ void aout_OutputDelete( aout_instance_t * p_aout );
VLC_EXPORT
(
aout_buffer_t
*
,
aout_OutputNextBuffer
,
(
aout_instance_t
*
,
mtime_t
,
vlc_bool_t
)
);
/* From common.c : */
VLC_EXPORT
(
int
,
aout_FormatNbChannels
,
(
const
audio_sample_format_t
*
p_format
)
);
VLC_EXPORT
(
unsigned
int
,
aout_FormatNbChannels
,
(
const
audio_sample_format_t
*
p_format
)
);
VLC_EXPORT
(
void
,
aout_FormatPrepare
,
(
audio_sample_format_t
*
p_format
)
);
VLC_EXPORT
(
void
,
aout_FormatPrint
,
(
aout_instance_t
*
p_aout
,
const
char
*
psz_text
,
const
audio_sample_format_t
*
p_format
)
);
VLC_EXPORT
(
void
,
aout_FormatsPrint
,
(
aout_instance_t
*
p_aout
,
const
char
*
psz_text
,
const
audio_sample_format_t
*
p_format1
,
const
audio_sample_format_t
*
p_format2
)
);
...
...
include/audio_output.h
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* audio_output.h : audio output interface
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: audio_output.h,v 1.7
2
2002/1
1/28 23:24:14 massiot
Exp $
* $Id: audio_output.h,v 1.7
3
2002/1
2/06 10:10:40 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
...
...
@@ -32,10 +32,10 @@ struct audio_sample_format_t
unsigned
int
i_rate
;
/* Describes the channels configuration of the samples (ie. number of
* channels which are available in the buffer, and positions). */
u
32
i_physical_channels
;
u
int32_t
i_physical_channels
;
/* Describes from which original channels, before downmixing, the
* buffer is derived. */
u
32
i_original_channels
;
u
int32_t
i_original_channels
;
/* Optional - for A/52, SPDIF and DTS types : */
/* Bytes used by one compressed frame, depends on bitrate. */
unsigned
int
i_bytes_per_frame
;
...
...
@@ -77,7 +77,7 @@ struct audio_sample_format_t
/*
* Fixed-point format: 0xABBBBBBB
* A == whole part (sign + 3 bits)
* B == fractional part (28 bits)
* B == fractional part (28 bits)
*
* Values are signed two's complement, so the effective range is:
* 0x80000000 to 0x7fffffff
...
...
@@ -88,7 +88,7 @@ struct audio_sample_format_t
*
* 28 bits of fractional accuracy represent about
* 8.6 digits of decimal accuracy.
*
*
* Fixed-point numbers can be added or subtracted as normal
* integers, but multiplication requires shifting the 64-bit result
* from 56 fractional bits back to 28 (and rounding.)
...
...
@@ -130,7 +130,7 @@ struct aout_buffer_t
/* i_size is the real size of the buffer (used for debug ONLY), i_nb_bytes
* is the number of significative bytes in it. */
size_t
i_size
,
i_nb_bytes
;
int
i_nb_samples
;
unsigned
int
i_nb_samples
;
mtime_t
start_date
,
end_date
;
struct
aout_buffer_t
*
p_next
;
...
...
@@ -140,7 +140,7 @@ struct aout_buffer_t
#define AOUT_SPDIF_SIZE 6144
/* Number of samples in an A/52 frame. */
#define A52_FRAME_NB 1536
#define A52_FRAME_NB 1536
/*****************************************************************************
* audio_date_t : date incrementation without long-term rounding errors
...
...
include/configuration.h
View file @
1b7ce269
...
...
@@ -4,7 +4,7 @@
* It includes functions allowing to declare, get or set configuration options.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: configuration.h,v 1.1
8
2002/
07/31 22:54:21
sam Exp $
* $Id: configuration.h,v 1.1
9
2002/
12/06 10:10:40
sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
...
...
@@ -12,7 +12,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
...
...
@@ -115,42 +115,42 @@ VLC_EXPORT( void, config_UnsetCallbacks, ( module_config_t * ) );
*****************************************************************************/
#define add_category_hint( text, longtext ) \
{ module_config_t tmp = { CONFIG_HINT_CATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_HINT_CATEGORY, NULL, NULL, '\0', text, longtext
, NULL, 0, 0.0, NULL, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_subcategory_hint( text, longtext ) \
{ module_config_t tmp = { CONFIG_HINT_SUBCATEGORY, NULL, NULL, '\0', text, longtext }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_HINT_SUBCATEGORY, NULL, NULL, '\0', text, longtext
, NULL, 0, 0.0, NULL, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define end_subcategory_hint \
{ module_config_t tmp = { CONFIG_HINT_SUBCATEGORY_END, NULL, NULL, '\0' }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_HINT_SUBCATEGORY_END, NULL, NULL, '\0'
, NULL, NULL, NULL, 0, 0.0, NULL, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_usage_hint( text ) \
{ module_config_t tmp = { CONFIG_HINT_USAGE, NULL, NULL, '\0', text }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_HINT_USAGE, NULL, NULL, '\0', text
, NULL, NULL, 0, 0.0, NULL, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_string( name, psz_value, p_callback, text, longtext ) \
{ module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_string_from_list( name, psz_value, ppsz_list, p_callback, text, \
longtext ) \
{ module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback, ppsz_list }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback, ppsz_list
, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_file( name, psz_value, p_callback, text, longtext ) \
{ module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, '\0', text, longtext, psz_value, 0, 0, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_module( name, psz_caps, psz_value, p_callback, text, longtext ) \
{ module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, '\0', text, longtext, psz_value, 0, 0, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, '\0', text, longtext, psz_value, 0, 0, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_integer( name, i_value, p_callback, text, longtext ) \
{ module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value, 0, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, '\0', text, longtext, NULL, i_value, 0, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_float( name, f_value, p_callback, text, longtext ) \
{ module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, '\0', text, longtext, NULL, 0, f_value, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_bool( name, b_value, p_callback, text, longtext ) \
{ module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value, 0, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value, 0, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
/* These should be seldom used. They were added just to provide easy shortcuts
* for the command line interface */
#define add_string_with_short( name, ch, psz_value, p_callback, text, ltext ) \
{ module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, ch, text, ltext, psz_value, 0, 0, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_STRING, NULL, name, ch, text, ltext, psz_value, 0, 0, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_file_with_short( name, ch, psz_value, p_callback, text, ltext ) \
{ module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, ch, text, ltext, psz_value, 0, 0, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_FILE, NULL, name, ch, text, ltext, psz_value, 0, 0, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_module_with_short( name, ch, psz_caps, psz_value, p_callback, \
text, ltext) \
{ module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, ch, text, ltext, psz_value, 0, 0, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_MODULE, psz_caps, name, ch, text, ltext, psz_value, 0, 0, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_integer_with_short( name, ch, i_value, p_callback, text, ltext ) \
{ module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, ch, text, ltext, NULL, i_value, 0, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_INTEGER, NULL, name, ch, text, ltext, NULL, i_value, 0, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_float_with_short( name, ch, f_value, p_callback, text, ltext ) \
{ module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, ch, text, ltext, NULL, 0, f_value, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_FLOAT, NULL, name, ch, text, ltext, NULL, 0, f_value, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
#define add_bool_with_short( name, ch, b_value, p_callback, text, ltext ) \
{ module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, ch, text, ltext, NULL, b_value, 0, p_callback }; p_config[ i_config ] = tmp; } i_config++
{ module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, ch, text, ltext, NULL, b_value, 0, p_callback
, NULL, NULL, VLC_FALSE
}; p_config[ i_config ] = tmp; } i_config++
include/input_ext-intf.h
View file @
1b7ce269
...
...
@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.7
8
2002/1
1/11 14:39:11
sam Exp $
* $Id: input_ext-intf.h,v 1.7
9
2002/1
2/06 10:10:40
sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -367,9 +367,8 @@ struct input_thread_t
/*****************************************************************************
* Prototypes
*****************************************************************************/
#define input_CreateThread(a,b,c) __input_CreateThread(VLC_OBJECT(a),b,c)
input_thread_t
*
__input_CreateThread
(
vlc_object_t
*
,
playlist_item_t
*
,
int
*
);
#define input_CreateThread(a,b) __input_CreateThread(VLC_OBJECT(a),b)
input_thread_t
*
__input_CreateThread
(
vlc_object_t
*
,
playlist_item_t
*
);
void
input_StopThread
(
input_thread_t
*
);
void
input_DestroyThread
(
input_thread_t
*
);
...
...
include/modules_inner.h
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* modules_inner.h : Macros used from within a module.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules_inner.h,v 1.3
3
2002/1
1/18 18:05:13
sam Exp $
* $Id: modules_inner.h,v 1.3
4
2002/1
2/06 10:10:40
sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -113,7 +113,9 @@
p_submodule->pp_shortcuts[ i_shortcut ] = NULL; \
} \
{ \
module_config_t tmp = { CONFIG_HINT_END, NULL, NULL, '\0' }; \
module_config_t tmp = { CONFIG_HINT_END, NULL, NULL, '\0', \
NULL, NULL, NULL, 0, 0.0, NULL, \
NULL, NULL, VLC_FALSE }; \
p_config[ i_config ] = tmp; \
} \
config_Duplicate( p_module, p_config ); \
...
...
src/audio_output/common.c
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* common.c : audio output management of common data structures
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: common.c,v 1.
9
2002/1
1/14 22:38:48 massiot
Exp $
* $Id: common.c,v 1.
10
2002/1
2/06 10:10:39 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
...
...
@@ -95,15 +95,15 @@ void aout_Delete( aout_instance_t * p_aout )
/*****************************************************************************
* aout_FormatNbChannels : return the number of channels
*****************************************************************************/
int
aout_FormatNbChannels
(
const
audio_sample_format_t
*
p_format
)
unsigned
int
aout_FormatNbChannels
(
const
audio_sample_format_t
*
p_format
)
{
static
const
u
32
pi_channels
[]
=
static
const
u
int32_t
pi_channels
[]
=
{
AOUT_CHAN_CENTER
,
AOUT_CHAN_LEFT
,
AOUT_CHAN_RIGHT
,
AOUT_CHAN_REARCENTER
,
AOUT_CHAN_REARLEFT
,
AOUT_CHAN_REARRIGHT
,
AOUT_CHAN_LFE
};
int
i_nb
=
0
,
i
;
unsigned
int
i_nb
=
0
,
i
;
for
(
i
=
0
;
i
<
sizeof
(
pi_channels
)
/
sizeof
(
u
32
);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
pi_channels
)
/
sizeof
(
u
int32_t
);
i
++
)
{
if
(
p_format
->
i_physical_channels
&
pi_channels
[
i
]
)
i_nb
++
;
}
...
...
@@ -263,7 +263,7 @@ void aout_FormatsPrint( aout_instance_t * p_aout, const char * psz_text,
* aout_FifoInit : initialize the members of a FIFO
*****************************************************************************/
void
aout_FifoInit
(
aout_instance_t
*
p_aout
,
aout_fifo_t
*
p_fifo
,
u
32
i_rate
)
u
int32_t
i_rate
)
{
p_fifo
->
p_first
=
NULL
;
p_fifo
->
pp_last
=
&
p_fifo
->
p_first
;
...
...
@@ -284,7 +284,7 @@ void aout_FifoPush( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
{
p_buffer
->
start_date
=
aout_DateGet
(
&
p_fifo
->
end_date
);
p_buffer
->
end_date
=
aout_DateIncrement
(
&
p_fifo
->
end_date
,
p_buffer
->
i_nb_samples
);
p_buffer
->
i_nb_samples
);
}
else
{
...
...
@@ -354,6 +354,7 @@ mtime_t aout_FifoFirstDate( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
aout_buffer_t
*
aout_FifoPop
(
aout_instance_t
*
p_aout
,
aout_fifo_t
*
p_fifo
)
{
aout_buffer_t
*
p_buffer
;
p_buffer
=
p_fifo
->
p_first
;
if
(
p_buffer
==
NULL
)
return
NULL
;
p_fifo
->
p_first
=
p_buffer
->
p_next
;
...
...
@@ -389,7 +390,7 @@ void aout_FifoDestroy( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
/*****************************************************************************
* aout_DateInit : set the divider of an audio_date_t
*****************************************************************************/
void
aout_DateInit
(
audio_date_t
*
p_date
,
u
32
i_divider
)
void
aout_DateInit
(
audio_date_t
*
p_date
,
u
int32_t
i_divider
)
{
p_date
->
date
=
0
;
p_date
->
i_divider
=
i_divider
;
...
...
@@ -425,7 +426,7 @@ mtime_t aout_DateGet( const audio_date_t * p_date )
* aout_DateIncrement : increment the date and return the result, taking
* into account rounding errors
*****************************************************************************/
mtime_t
aout_DateIncrement
(
audio_date_t
*
p_date
,
u
32
i_nb_samples
)
mtime_t
aout_DateIncrement
(
audio_date_t
*
p_date
,
u
int32_t
i_nb_samples
)
{
mtime_t
i_dividend
=
(
mtime_t
)
i_nb_samples
*
1000000
;
p_date
->
date
+=
i_dividend
/
p_date
->
i_divider
;
...
...
src/audio_output/dec.c
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* dec.c : audio output API towards decoders
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: dec.c,v 1.
2
2002/1
1/14 22:38:48 massiot
Exp $
* $Id: dec.c,v 1.
3
2002/1
2/06 10:10:39 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
...
...
src/audio_output/filters.c
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* filters.c : audio output filters management
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: filters.c,v 1.1
4
2002/1
1/14 22:38:48 massiot
Exp $
* $Id: filters.c,v 1.1
5
2002/1
2/06 10:10:39 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
...
...
@@ -30,7 +30,7 @@
#include <vlc/vlc.h>
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# include <alloca.h>
#endif
#include "audio_output.h"
...
...
@@ -66,7 +66,7 @@ static aout_filter_t * FindFilter( aout_instance_t * p_aout,
}
/*****************************************************************************
* SplitConversion: split a conversion in two parts
* SplitConversion: split a conversion in two parts
*****************************************************************************
* Returns the number of conversions required by the first part - 0 if only
* one conversion was asked.
...
...
@@ -74,10 +74,9 @@ static aout_filter_t * FindFilter( aout_instance_t * p_aout,
* developer passed SplitConversion( toto, titi, titi, ... ). That is legal.
* SplitConversion( toto, titi, toto, ... ) isn't.
*****************************************************************************/
static
int
SplitConversion
(
aout_instance_t
*
p_aout
,
const
audio_sample_format_t
*
p_input_format
,
const
audio_sample_format_t
*
p_output_format
,
audio_sample_format_t
*
p_middle_format
)
static
int
SplitConversion
(
const
audio_sample_format_t
*
p_input_format
,
const
audio_sample_format_t
*
p_output_format
,
audio_sample_format_t
*
p_middle_format
)
{
vlc_bool_t
b_format
=
(
p_input_format
->
i_format
!=
p_output_format
->
i_format
);
...
...
@@ -150,7 +149,7 @@ int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
/* We'll have to split the conversion. We always do the downmixing
* before the resampling, because the audio decoder can probably do it
* for us. */
i_nb_conversions
=
SplitConversion
(
p_aout
,
p_input_format
,
i_nb_conversions
=
SplitConversion
(
p_input_format
,
p_output_format
,
&
temp_format
);
if
(
!
i_nb_conversions
)
{
...
...
@@ -163,10 +162,8 @@ int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
if
(
pp_filters
[
0
]
==
NULL
&&
i_nb_conversions
==
2
)
{
/* Try with only one conversion. */
SplitConversion
(
p_aout
,
p_input_format
,
&
temp_format
,
&
temp_format
);
pp_filters
[
0
]
=
FindFilter
(
p_aout
,
p_input_format
,
&
temp_format
);
SplitConversion
(
p_input_format
,
&
temp_format
,
&
temp_format
);
pp_filters
[
0
]
=
FindFilter
(
p_aout
,
p_input_format
,
&
temp_format
);
}
if
(
pp_filters
[
0
]
==
NULL
)
{
...
...
@@ -182,9 +179,8 @@ int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
if
(
pp_filters
[
1
]
==
NULL
)
{
/* Try to split the conversion. */
i_nb_conversions
=
SplitConversion
(
p_aout
,
&
pp_filters
[
0
]
->
output
,
p_output_format
,
&
temp_format
);
i_nb_conversions
=
SplitConversion
(
&
pp_filters
[
0
]
->
output
,
p_output_format
,
&
temp_format
);
if
(
!
i_nb_conversions
)
{
vlc_object_detach
(
pp_filters
[
0
]
);
...
...
@@ -254,6 +250,8 @@ void aout_FiltersHintBuffers( aout_instance_t * p_aout,
{
int
i
;
(
void
)
p_aout
;
/* unused */
for
(
i
=
i_nb_filters
-
1
;
i
>=
0
;
i
--
)
{
aout_filter_t
*
p_filter
=
pp_filters
[
i
];
...
...
src/audio_output/input.c
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* input.c : internal management of input streams for the audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: input.c,v 1.2
5
2002/1
1/26 12:09:20 massiot
Exp $
* $Id: input.c,v 1.2
6
2002/1
2/06 10:10:39 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
...
...
src/audio_output/intf.c
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* intf.c : audio output API towards the interface modules
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: intf.c,v 1.
8
2002/1
1/14 22:38:48 massiot
Exp $
* $Id: intf.c,v 1.
9
2002/1
2/06 10:10:39 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
...
...
@@ -41,7 +41,7 @@
* mixer is running, so we need the mixer lock (too).
*
* Here is a schematic of the i_volume range :
*
*
* |------------------------------+---------------------------------------|
* 0 pi_soft 1024
*
...
...
src/audio_output/mixer.c
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* mixer.c : audio output mixing operations
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: mixer.c,v 1.2
0
2002/1
1/13 20:51:04
sam Exp $
* $Id: mixer.c,v 1.2
1
2002/1
2/06 10:10:39
sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
...
...
@@ -30,7 +30,7 @@
#include <vlc/vlc.h>
#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# include <alloca.h>
#endif
#include "audio_output.h"
...
...
@@ -118,7 +118,7 @@ static int MixBuffer( aout_instance_t * p_aout )
aout_FifoSet
(
p_aout
,
&
p_aout
->
output
.
fifo
,
0
);
aout_DateSet
(
&
exact_start_date
,
0
);
start_date
=
0
;
}
}
vlc_mutex_unlock
(
&
p_aout
->
output_fifo_lock
);
...
...
@@ -140,7 +140,8 @@ static int MixBuffer( aout_instance_t * p_aout )
{
msg_Warn
(
p_aout
,
"input PTS is out of range ("
I64Fd
"), "
"trashing"
,
mdate
()
-
p_buffer
->
start_date
);
aout_BufferFree
(
aout_FifoPop
(
p_aout
,
p_fifo
)
);
p_buffer
=
aout_FifoPop
(
p_aout
,
p_fifo
);
aout_BufferFree
(
p_buffer
);
p_buffer
=
p_fifo
->
p_first
;
}
...
...
@@ -288,7 +289,7 @@ static int MixBuffer( aout_instance_t * p_aout )
/* Run the mixer. */
aout_BufferAlloc
(
&
p_aout
->
mixer
.
output_alloc
,
((
u
64
)
p_aout
->
output
.
i_nb_samples
*
1000000
)
((
u
int64_t
)
p_aout
->
output
.
i_nb_samples
*
1000000
)
/
p_aout
->
output
.
output
.
i_rate
,
/* This is a bit kludgy, but is actually only used
* for the S/PDIF dummy mixer : */
...
...
src/audio_output/output.c
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* output.c : internal management of output streams for the audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: output.c,v 1.2
4
2002/1
1/14 22:38:48 massiot
Exp $
* $Id: output.c,v 1.2
5
2002/1
2/06 10:10:39 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -10,7 +10,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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
...
...
@@ -111,9 +111,9 @@ int aout_OutputNew( aout_instance_t * p_aout,
var_AddCallback
(
p_aout
,
"audio-channels"
,
aout_ChannelsRestart
,
NULL
);
}
else
if
(
p_aout
->
output
.
output
.
i_physical_channels
==
else
if
(
p_aout
->
output
.
output
.
i_physical_channels
==
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
)
&&
p_aout
->
output
.
output
.
i_original_channels
==
&&
p_aout
->
output
.
output
.
i_original_channels
==
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
)
)
{
/* Stereo - create the audio-channels variable. */
...
...
@@ -138,7 +138,8 @@ int aout_OutputNew( aout_instance_t * p_aout,
aout_FormatPrepare
(
&
p_aout
->
output
.
output
);
/* Prepare FIFO. */
aout_FifoInit
(
p_aout
,
&
p_aout
->
output
.
fifo
,
p_aout
->
output
.
output
.
i_rate
);
aout_FifoInit
(
p_aout
,
&
p_aout
->
output
.
fifo
,
p_aout
->
output
.
output
.
i_rate
);
vlc_mutex_unlock
(
&
p_aout
->
output_fifo_lock
);
...
...
src/input/input.c
View file @
1b7ce269
...
...
@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: input.c,v 1.21
6
2002/12/0
3 23:36:41 gitan
Exp $
* $Id: input.c,v 1.21
7
2002/12/0
6 10:10:39 sam
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -61,11 +61,9 @@ static void EndThread ( input_thread_t *p_input );
*****************************************************************************
* This function creates a new input, and returns a pointer
* to its description. On error, it returns NULL.
* If pi_status is NULL, then the function will block until the thread is ready.
* If not, it will be updated using one of the THREAD_* constants.
*****************************************************************************/
input_thread_t
*
__input_CreateThread
(
vlc_object_t
*
p_parent
,
playlist_item_t
*
p_item
,
int
*
pi_status
)
playlist_item_t
*
p_item
)
{
input_thread_t
*
p_input
;
/* thread descriptor */
input_info_category_t
*
p_info
;
...
...
src/input/input_clock.c
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* input_clock.c: Clock/System date convertions, stream management
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_clock.c,v 1.3
4
2002/1
1/11 14:39:12
sam Exp $
* $Id: input_clock.c,v 1.3
5
2002/1
2/06 10:10:39
sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -77,8 +77,6 @@
/*****************************************************************************
* ClockToSysdate: converts a movie clock to system date
*****************************************************************************/
static
void
ClockNewRef
(
input_thread_t
*
p_input
,
pgrm_descriptor_t
*
p_pgrm
,
mtime_t
i_clock
,
mtime_t
i_sysdate
);
static
mtime_t
ClockToSysdate
(
input_thread_t
*
p_input
,
pgrm_descriptor_t
*
p_pgrm
,
mtime_t
i_clock
)
{
...
...
@@ -113,7 +111,7 @@ static mtime_t ClockCurrent( input_thread_t * p_input,
/*****************************************************************************
* ClockNewRef: writes a new clock reference
*****************************************************************************/
static
void
ClockNewRef
(
input_thread_t
*
p_input
,
pgrm_descriptor_t
*
p_pgrm
,
static
void
ClockNewRef
(
pgrm_descriptor_t
*
p_pgrm
,
mtime_t
i_clock
,
mtime_t
i_sysdate
)
{
p_pgrm
->
cr_ref
=
i_clock
;
...
...
@@ -159,19 +157,19 @@ int input_ClockManageControl( input_thread_t * p_input,
i_old_status
=
p_input
->
stream
.
control
.
i_status
;
p_input
->
stream
.
control
.
i_status
=
PAUSE_S
;
vlc_mutex_unlock
(
&
p_input
->
stream
.
control
.
control_lock
);
vlc_cond_wait
(
&
p_input
->
stream
.
stream_wait
,
&
p_input
->
stream
.
stream_lock
);
p_pgrm
->
last_syscr
=
0
;
ClockNewRef
(
p_input
,
p_pgrm
,
i_clock
,
mdate
()
);
ClockNewRef
(
p_pgrm
,
i_clock
,
mdate
()
);
if
(
p_input
->
stream
.
i_new_status
==
PAUSE_S
)
{
{
/* PAUSE_S undoes the pause state: Return to old state. */
vlc_mutex_lock
(
&
p_input
->
stream
.
control
.
control_lock
);
p_input
->
stream
.
control
.
i_status
=
i_old_status
;
vlc_mutex_unlock
(
&
p_input
->
stream
.
control
.
control_lock
);
p_input
->
stream
.
i_new_status
=
UNDEF_S
;
p_input
->
stream
.
i_new_rate
=
UNDEF_S
;
}
...
...
@@ -187,7 +185,7 @@ int input_ClockManageControl( input_thread_t * p_input,
p_input
->
stream
.
control
.
i_status
=
p_input
->
stream
.
i_new_status
;
ClockNewRef
(
p_input
,
p_pgrm
,
i_clock
,
ClockNewRef
(
p_pgrm
,
i_clock
,
ClockToSysdate
(
p_input
,
p_pgrm
,
i_clock
)
);
if
(
p_input
->
stream
.
control
.
i_status
==
PLAYING_S
)
...
...
@@ -231,7 +229,7 @@ void input_ClockManageRef( input_thread_t * p_input,
if
(
(
p_pgrm
->
i_synchro_state
!=
SYNCHRO_OK
)
||
(
i_clock
==
0
)
)
{
/* Feed synchro with a new reference point. */
ClockNewRef
(
p_input
,
p_pgrm
,
i_clock
,
mdate
()
);
ClockNewRef
(
p_pgrm
,
i_clock
,
mdate
()
);
p_pgrm
->
i_synchro_state
=
SYNCHRO_OK
;
if
(
p_input
->
stream
.
b_pace_control
...
...
src/input/input_ext-dec.c
View file @
1b7ce269
...
...
@@ -2,7 +2,7 @@
* input_ext-dec.c: services to the decoders
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_ext-dec.c,v 1.4
2
2002/1
1/13 20:51:05
sam Exp $
* $Id: input_ext-dec.c,v 1.4
3
2002/1
2/06 10:10:39
sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>