Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
87720524
Commit
87720524
authored
Aug 13, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed audio_date_t in favor to date_t.
parent
a882fa8a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
100 deletions
+18
-100
include/vlc_aout.h
include/vlc_aout.h
+1
-18
src/audio_output/common.c
src/audio_output/common.c
+9
-68
src/audio_output/mixer.c
src/audio_output/mixer.c
+8
-9
src/libvlccore.sym
src/libvlccore.sym
+0
-5
No files found.
include/vlc_aout.h
View file @
87720524
...
@@ -163,16 +163,6 @@ struct aout_buffer_t
...
@@ -163,16 +163,6 @@ struct aout_buffer_t
/* Max input rate factor (1/4 -> 4) */
/* Max input rate factor (1/4 -> 4) */
#define AOUT_MAX_INPUT_RATE (4)
#define AOUT_MAX_INPUT_RATE (4)
/** date incrementation helper structure without long-term
* rounding errors
*/
struct
audio_date_t
{
mtime_t
date
;
uint32_t
i_divider
;
uint32_t
i_remainder
;
};
/** allocation of memory in the audio output */
/** allocation of memory in the audio output */
typedef
struct
aout_alloc_t
typedef
struct
aout_alloc_t
{
{
...
@@ -208,7 +198,7 @@ struct aout_fifo_t
...
@@ -208,7 +198,7 @@ struct aout_fifo_t
{
{
aout_buffer_t
*
p_first
;
aout_buffer_t
*
p_first
;
aout_buffer_t
**
pp_last
;
aout_buffer_t
**
pp_last
;
audio_date_t
end_date
;
date_t
end_date
;
};
};
/* */
/* */
...
@@ -382,13 +372,6 @@ static const uint32_t pi_vlc_chan_order_wg4[] =
...
@@ -382,13 +372,6 @@ static const uint32_t pi_vlc_chan_order_wg4[] =
* Prototypes
* Prototypes
*****************************************************************************/
*****************************************************************************/
/* From common.c : */
VLC_EXPORT
(
void
,
aout_DateInit
,
(
audio_date_t
*
,
uint32_t
)
);
VLC_EXPORT
(
void
,
aout_DateSet
,
(
audio_date_t
*
,
mtime_t
)
);
VLC_EXPORT
(
void
,
aout_DateMove
,
(
audio_date_t
*
,
mtime_t
)
);
VLC_EXPORT
(
mtime_t
,
aout_DateGet
,
(
const
audio_date_t
*
)
LIBVLC_USED
);
VLC_EXPORT
(
mtime_t
,
aout_DateIncrement
,
(
audio_date_t
*
,
uint32_t
)
);
VLC_EXPORT
(
aout_buffer_t
*
,
aout_OutputNextBuffer
,
(
aout_instance_t
*
,
mtime_t
,
bool
)
LIBVLC_USED
);
VLC_EXPORT
(
aout_buffer_t
*
,
aout_OutputNextBuffer
,
(
aout_instance_t
*
,
mtime_t
,
bool
)
LIBVLC_USED
);
/**
/**
...
...
src/audio_output/common.c
View file @
87720524
...
@@ -350,7 +350,7 @@ void aout_FifoInit( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
...
@@ -350,7 +350,7 @@ void aout_FifoInit( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
p_fifo
->
p_first
=
NULL
;
p_fifo
->
p_first
=
NULL
;
p_fifo
->
pp_last
=
&
p_fifo
->
p_first
;
p_fifo
->
pp_last
=
&
p_fifo
->
p_first
;
aout_DateInit
(
&
p_fifo
->
end_date
,
i_rate
);
date_Init
(
&
p_fifo
->
end_date
,
i_rate
,
1
);
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -366,15 +366,15 @@ void aout_FifoPush( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
...
@@ -366,15 +366,15 @@ void aout_FifoPush( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
p_fifo
->
pp_last
=
&
p_buffer
->
p_next
;
p_fifo
->
pp_last
=
&
p_buffer
->
p_next
;
*
p_fifo
->
pp_last
=
NULL
;
*
p_fifo
->
pp_last
=
NULL
;
/* Enforce the continuity of the stream. */
/* Enforce the continuity of the stream. */
if
(
aout_Date
Get
(
&
p_fifo
->
end_date
)
)
if
(
date_
Get
(
&
p_fifo
->
end_date
)
)
{
{
p_buffer
->
start_date
=
aout_Date
Get
(
&
p_fifo
->
end_date
);
p_buffer
->
start_date
=
date_
Get
(
&
p_fifo
->
end_date
);
p_buffer
->
end_date
=
aout_Date
Increment
(
&
p_fifo
->
end_date
,
p_buffer
->
end_date
=
date_
Increment
(
&
p_fifo
->
end_date
,
p_buffer
->
i_nb_samples
);
p_buffer
->
i_nb_samples
);
}
}
else
else
{
{
aout_Date
Set
(
&
p_fifo
->
end_date
,
p_buffer
->
end_date
);
date_
Set
(
&
p_fifo
->
end_date
,
p_buffer
->
end_date
);
}
}
}
}
...
@@ -389,7 +389,7 @@ void aout_FifoSet( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
...
@@ -389,7 +389,7 @@ void aout_FifoSet( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
(
void
)
p_aout
;
(
void
)
p_aout
;
AOUT_ASSERT_FIFO_LOCKED
;
AOUT_ASSERT_FIFO_LOCKED
;
aout_Date
Set
(
&
p_fifo
->
end_date
,
date
);
date_
Set
(
&
p_fifo
->
end_date
,
date
);
p_buffer
=
p_fifo
->
p_first
;
p_buffer
=
p_fifo
->
p_first
;
while
(
p_buffer
!=
NULL
)
while
(
p_buffer
!=
NULL
)
{
{
...
@@ -411,7 +411,7 @@ void aout_FifoMoveDates( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
...
@@ -411,7 +411,7 @@ void aout_FifoMoveDates( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
(
void
)
p_aout
;
(
void
)
p_aout
;
AOUT_ASSERT_FIFO_LOCKED
;
AOUT_ASSERT_FIFO_LOCKED
;
aout_Date
Move
(
&
p_fifo
->
end_date
,
difference
);
date_
Move
(
&
p_fifo
->
end_date
,
difference
);
p_buffer
=
p_fifo
->
p_first
;
p_buffer
=
p_fifo
->
p_first
;
while
(
p_buffer
!=
NULL
)
while
(
p_buffer
!=
NULL
)
{
{
...
@@ -428,7 +428,7 @@ mtime_t aout_FifoNextStart( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
...
@@ -428,7 +428,7 @@ mtime_t aout_FifoNextStart( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
{
{
(
void
)
p_aout
;
(
void
)
p_aout
;
AOUT_ASSERT_FIFO_LOCKED
;
AOUT_ASSERT_FIFO_LOCKED
;
return
aout_Date
Get
(
&
p_fifo
->
end_date
);
return
date_
Get
(
&
p_fifo
->
end_date
);
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -483,65 +483,6 @@ void aout_FifoDestroy( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
...
@@ -483,65 +483,6 @@ void aout_FifoDestroy( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
p_fifo
->
pp_last
=
&
p_fifo
->
p_first
;
p_fifo
->
pp_last
=
&
p_fifo
->
p_first
;
}
}
/*
* Date management (internal and external)
*/
/*****************************************************************************
* aout_DateInit : set the divider of an audio_date_t
*****************************************************************************/
void
aout_DateInit
(
audio_date_t
*
p_date
,
uint32_t
i_divider
)
{
p_date
->
date
=
0
;
p_date
->
i_divider
=
i_divider
;
p_date
->
i_remainder
=
0
;
}
/*****************************************************************************
* aout_DateSet : set the date of an audio_date_t
*****************************************************************************/
void
aout_DateSet
(
audio_date_t
*
p_date
,
mtime_t
new_date
)
{
p_date
->
date
=
new_date
;
p_date
->
i_remainder
=
0
;
}
/*****************************************************************************
* aout_DateMove : move forwards or backwards the date of an audio_date_t
*****************************************************************************/
void
aout_DateMove
(
audio_date_t
*
p_date
,
mtime_t
difference
)
{
p_date
->
date
+=
difference
;
}
/*****************************************************************************
* aout_DateGet : get the date of an audio_date_t
*****************************************************************************/
mtime_t
aout_DateGet
(
const
audio_date_t
*
p_date
)
{
return
p_date
->
date
;
}
/*****************************************************************************
* aout_DateIncrement : increment the date and return the result, taking
* into account rounding errors
*****************************************************************************/
mtime_t
aout_DateIncrement
(
audio_date_t
*
p_date
,
uint32_t
i_nb_samples
)
{
mtime_t
i_dividend
=
INT64_C
(
1000000
)
*
i_nb_samples
;
assert
(
p_date
->
i_divider
>
0
);
/* uninitialized audio_data_t ? */
p_date
->
date
+=
i_dividend
/
p_date
->
i_divider
;
p_date
->
i_remainder
+=
(
int
)(
i_dividend
%
p_date
->
i_divider
);
if
(
p_date
->
i_remainder
>=
p_date
->
i_divider
)
{
/* This is Bresenham algorithm. */
p_date
->
date
++
;
p_date
->
i_remainder
-=
p_date
->
i_divider
;
}
return
p_date
->
date
;
}
/*****************************************************************************
/*****************************************************************************
* aout_CheckChannelReorder : Check if we need to do some channel re-ordering
* aout_CheckChannelReorder : Check if we need to do some channel re-ordering
*****************************************************************************/
*****************************************************************************/
...
...
src/audio_output/mixer.c
View file @
87720524
...
@@ -75,7 +75,7 @@ static int MixBuffer( aout_instance_t * p_aout )
...
@@ -75,7 +75,7 @@ static int MixBuffer( aout_instance_t * p_aout )
int
i
,
i_first_input
=
0
;
int
i
,
i_first_input
=
0
;
aout_buffer_t
*
p_output_buffer
;
aout_buffer_t
*
p_output_buffer
;
mtime_t
start_date
,
end_date
;
mtime_t
start_date
,
end_date
;
audio_date_t
exact_start_date
;
date_t
exact_start_date
;
if
(
p_aout
->
mixer
.
b_error
)
if
(
p_aout
->
mixer
.
b_error
)
{
{
...
@@ -102,9 +102,8 @@ static int MixBuffer( aout_instance_t * p_aout )
...
@@ -102,9 +102,8 @@ static int MixBuffer( aout_instance_t * p_aout )
aout_lock_input_fifos
(
p_aout
);
aout_lock_input_fifos
(
p_aout
);
/* Retrieve the date of the next buffer. */
/* Retrieve the date of the next buffer. */
memcpy
(
&
exact_start_date
,
&
p_aout
->
output
.
fifo
.
end_date
,
exact_start_date
=
p_aout
->
output
.
fifo
.
end_date
;
sizeof
(
audio_date_t
)
);
start_date
=
date_Get
(
&
exact_start_date
);
start_date
=
aout_DateGet
(
&
exact_start_date
);
if
(
start_date
!=
0
&&
start_date
<
mdate
()
)
if
(
start_date
!=
0
&&
start_date
<
mdate
()
)
{
{
...
@@ -114,7 +113,7 @@ static int MixBuffer( aout_instance_t * p_aout )
...
@@ -114,7 +113,7 @@ static int MixBuffer( aout_instance_t * p_aout )
msg_Warn
(
p_aout
,
"output PTS is out of range (%"
PRId64
"), clearing out"
,
msg_Warn
(
p_aout
,
"output PTS is out of range (%"
PRId64
"), clearing out"
,
mdate
()
-
start_date
);
mdate
()
-
start_date
);
aout_FifoSet
(
p_aout
,
&
p_aout
->
output
.
fifo
,
0
);
aout_FifoSet
(
p_aout
,
&
p_aout
->
output
.
fifo
,
0
);
aout_Date
Set
(
&
exact_start_date
,
0
);
date_
Set
(
&
exact_start_date
,
0
);
start_date
=
0
;
start_date
=
0
;
}
}
...
@@ -152,7 +151,7 @@ static int MixBuffer( aout_instance_t * p_aout )
...
@@ -152,7 +151,7 @@ static int MixBuffer( aout_instance_t * p_aout )
if
(
!
start_date
||
start_date
<
p_buffer
->
start_date
)
if
(
!
start_date
||
start_date
<
p_buffer
->
start_date
)
{
{
aout_Date
Set
(
&
exact_start_date
,
p_buffer
->
start_date
);
date_
Set
(
&
exact_start_date
,
p_buffer
->
start_date
);
start_date
=
p_buffer
->
start_date
;
start_date
=
p_buffer
->
start_date
;
}
}
}
}
...
@@ -164,8 +163,8 @@ static int MixBuffer( aout_instance_t * p_aout )
...
@@ -164,8 +163,8 @@ static int MixBuffer( aout_instance_t * p_aout )
return
-
1
;
return
-
1
;
}
}
}
}
aout_Date
Increment
(
&
exact_start_date
,
p_aout
->
output
.
i_nb_samples
);
date_
Increment
(
&
exact_start_date
,
p_aout
->
output
.
i_nb_samples
);
end_date
=
aout_Date
Get
(
&
exact_start_date
);
end_date
=
date_
Get
(
&
exact_start_date
);
/* Check that start_date and end_date are available for all input
/* Check that start_date and end_date are available for all input
* streams. */
* streams. */
...
@@ -280,7 +279,7 @@ static int MixBuffer( aout_instance_t * p_aout )
...
@@ -280,7 +279,7 @@ static int MixBuffer( aout_instance_t * p_aout )
/* Is it really the best way to do it ? */
/* Is it really the best way to do it ? */
aout_lock_output_fifo
(
p_aout
);
aout_lock_output_fifo
(
p_aout
);
aout_FifoSet
(
p_aout
,
&
p_aout
->
output
.
fifo
,
0
);
aout_FifoSet
(
p_aout
,
&
p_aout
->
output
.
fifo
,
0
);
aout_Date
Set
(
&
exact_start_date
,
0
);
date_
Set
(
&
exact_start_date
,
0
);
aout_unlock_output_fifo
(
p_aout
);
aout_unlock_output_fifo
(
p_aout
);
break
;
break
;
}
}
...
...
src/libvlccore.sym
View file @
87720524
...
@@ -11,11 +11,6 @@ aout_ChannelReorder
...
@@ -11,11 +11,6 @@ aout_ChannelReorder
aout_ChannelsRestart
aout_ChannelsRestart
aout_CheckChannelExtraction
aout_CheckChannelExtraction
aout_CheckChannelReorder
aout_CheckChannelReorder
aout_DateGet
aout_DateIncrement
aout_DateInit
aout_DateMove
aout_DateSet
aout_EnableFilter
aout_EnableFilter
aout_FifoFirstDate
aout_FifoFirstDate
aout_FifoPop
aout_FifoPop
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment