Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
7eb92928
Commit
7eb92928
authored
Oct 07, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics (decoder)
parent
20aa3c15
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
37 deletions
+60
-37
src/input/decoder.c
src/input/decoder.c
+47
-33
src/input/es_out.c
src/input/es_out.c
+6
-2
src/input/input_decoder.h
src/input/input_decoder.h
+7
-2
No files found.
src/input/decoder.c
View file @
7eb92928
...
...
@@ -53,8 +53,9 @@ static decoder_t *CreateDecoder( input_thread_t *, es_format_t *, int, sout_inst
static
void
DeleteDecoder
(
decoder_t
*
);
static
void
*
DecoderThread
(
vlc_object_t
*
);
static
int
DecoderProcess
(
decoder_t
*
p_dec
,
block_t
*
p_block
);
static
void
DecoderOutputChangePause
(
decoder_t
*
p_dec
,
bool
b_paused
,
mtime_t
i_date
);
static
int
DecoderProcess
(
decoder_t
*
,
block_t
*
);
static
void
DecoderOutputChangePause
(
decoder_t
*
,
bool
b_paused
,
mtime_t
i_date
);
static
void
DecoderFlush
(
decoder_t
*
);
/* Buffers allocation callbacks for the decoders */
static
aout_buffer_t
*
aout_new_buffer
(
decoder_t
*
,
int
);
...
...
@@ -489,43 +490,19 @@ void input_DecoderChangeDelay( decoder_t *p_dec, mtime_t i_delay )
vlc_mutex_unlock
(
&
p_owner
->
lock
);
}
void
input_Decoder
Flush
(
decoder_t
*
p_dec
)
void
input_Decoder
StartBuffering
(
decoder_t
*
p_dec
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
block_t
*
p_null
;
if
(
p_owner
->
b_own_thread
)
{
/* Empty the fifo */
block_FifoEmpty
(
p_owner
->
p_fifo
);
vlc_mutex_lock
(
&
p_owner
->
lock
);
/* Monitor for flush end */
vlc_mutex_lock
(
&
p_owner
->
lock
);
p_owner
->
b_flushing
=
true
;
vlc_cond_signal
(
&
p_owner
->
wait
);
vlc_mutex_unlock
(
&
p_owner
->
lock
);
}
DecoderFlush
(
p_dec
);
/* Send a special block */
p_null
=
block_New
(
p_dec
,
128
);
if
(
!
p_null
)
return
;
p_null
->
i_flags
|=
BLOCK_FLAG_DISCONTINUITY
;
p_null
->
i_flags
|=
BLOCK_FLAG_CORE_FLUSH
;
if
(
!
p_dec
->
fmt_in
.
b_packetized
)
p_null
->
i_flags
|=
BLOCK_FLAG_CORRUPTED
;
memset
(
p_null
->
p_buffer
,
0
,
p_null
->
i_buffer
);
input_DecoderDecode
(
p_dec
,
p_null
);
vlc_mutex_unlock
(
&
p_owner
->
lock
);
}
/* */
if
(
p_owner
->
b_own_thread
)
{
vlc_mutex_lock
(
&
p_owner
->
lock
);
while
(
p_owner
->
b_flushing
)
vlc_cond_wait
(
&
p_owner
->
wait
,
&
p_owner
->
lock
);
vlc_mutex_unlock
(
&
p_owner
->
lock
);
}
void
input_DecoderStopBuffering
(
decoder_t
*
p_dec
)
{
}
/**
...
...
@@ -715,6 +692,43 @@ static void *DecoderThread( vlc_object_t *p_this )
return
NULL
;
}
static
void
DecoderFlush
(
decoder_t
*
p_dec
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
block_t
*
p_null
;
if
(
p_owner
->
b_own_thread
)
{
vlc_assert_locked
(
&
p_owner
->
lock
);
/* Empty the fifo */
block_FifoEmpty
(
p_owner
->
p_fifo
);
/* Monitor for flush end */
p_owner
->
b_flushing
=
true
;
vlc_cond_signal
(
&
p_owner
->
wait
);
}
/* Send a special block */
p_null
=
block_New
(
p_dec
,
128
);
if
(
!
p_null
)
return
;
p_null
->
i_flags
|=
BLOCK_FLAG_DISCONTINUITY
;
p_null
->
i_flags
|=
BLOCK_FLAG_CORE_FLUSH
;
if
(
!
p_dec
->
fmt_in
.
b_packetized
)
p_null
->
i_flags
|=
BLOCK_FLAG_CORRUPTED
;
memset
(
p_null
->
p_buffer
,
0
,
p_null
->
i_buffer
);
input_DecoderDecode
(
p_dec
,
p_null
);
/* */
if
(
p_owner
->
b_own_thread
)
{
while
(
p_owner
->
b_flushing
)
vlc_cond_wait
(
&
p_owner
->
wait
,
&
p_owner
->
lock
);
}
}
static
void
DecoderWaitUnpause
(
decoder_t
*
p_dec
,
bool
*
pb_reject
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
...
...
src/input/es_out.c
View file @
7eb92928
...
...
@@ -533,9 +533,13 @@ void input_EsOutChangePosition( es_out_t *out )
* there is a discontinuity */
if
(
es
->
p_dec
)
{
input_DecoderFlush
(
es
->
p_dec
);
input_DecoderStartBuffering
(
es
->
p_dec
);
input_DecoderStopBuffering
(
es
->
p_dec
);
if
(
es
->
p_dec_record
)
input_DecoderFlush
(
es
->
p_dec_record
);
{
input_DecoderStartBuffering
(
es
->
p_dec_record
);
input_DecoderStopBuffering
(
es
->
p_dec_record
);
}
}
}
...
...
src/input/input_decoder.h
View file @
7eb92928
...
...
@@ -47,9 +47,14 @@ void input_DecoderChangePause( decoder_t *, bool b_paused, mtime_t i_date );
void
input_DecoderChangeDelay
(
decoder_t
*
,
mtime_t
i_delay
);
/**
* This function
will cause a flush of the decoder
.
* This function
starts the buffering mode
.
*/
void
input_DecoderFlush
(
decoder_t
*
);
void
input_DecoderStartBuffering
(
decoder_t
*
);
/**
* This function stops the buffering mode.
*/
void
input_DecoderStopBuffering
(
decoder_t
*
);
/**
* This function returns true if the decoder fifo is empty and false otherwise.
...
...
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