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
d12d90d0
Commit
d12d90d0
authored
Jan 26, 2016
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder: merge two functions
parent
511a8f07
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
42 deletions
+30
-42
src/input/decoder.c
src/input/decoder.c
+30
-42
No files found.
src/input/decoder.c
View file @
d12d90d0
...
@@ -827,18 +827,43 @@ static void DecoderGetCc( decoder_t *p_dec, decoder_t *p_dec_cc )
...
@@ -827,18 +827,43 @@ static void DecoderGetCc( decoder_t *p_dec, decoder_t *p_dec_cc )
block_Release
(
p_cc
);
block_Release
(
p_cc
);
}
}
static
void
DecoderPlayVideo
(
decoder_t
*
p_dec
,
picture_t
*
p_picture
,
static
int
DecoderPlayVideo
(
decoder_t
*
p_dec
,
picture_t
*
p_picture
,
int
*
pi_played_sum
,
int
*
pi_lost_sum
)
int
*
pi_played_sum
,
int
*
pi_lost_sum
)
{
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
vout_thread_t
*
p_vout
=
p_owner
->
p_vout
;
vout_thread_t
*
p_vout
=
p_owner
->
p_vout
;
bool
prerolled
;
vlc_mutex_lock
(
&
p_owner
->
lock
);
if
(
p_owner
->
i_preroll_end
>
p_picture
->
date
)
{
vlc_mutex_unlock
(
&
p_owner
->
lock
);
picture_Release
(
p_picture
);
return
-
1
;
}
prerolled
=
p_owner
->
i_preroll_end
>
INT64_MIN
;
p_owner
->
i_preroll_end
=
INT64_MIN
;
vlc_mutex_unlock
(
&
p_owner
->
lock
);
if
(
unlikely
(
prerolled
)
)
{
msg_Dbg
(
p_dec
,
"end of video preroll"
);
if
(
p_vout
)
vout_Flush
(
p_vout
,
VLC_TS_INVALID
+
1
);
}
if
(
p_dec
->
pf_get_cc
&&
(
!
p_owner
->
p_packetizer
||
!
p_owner
->
p_packetizer
->
pf_get_cc
)
)
DecoderGetCc
(
p_dec
,
p_dec
);
if
(
p_picture
->
date
<=
VLC_TS_INVALID
)
if
(
p_picture
->
date
<=
VLC_TS_INVALID
)
{
{
msg_Warn
(
p_dec
,
"non-dated video buffer received"
);
msg_Warn
(
p_dec
,
"non-dated video buffer received"
);
*
pi_lost_sum
+=
1
;
*
pi_lost_sum
+=
1
;
picture_Release
(
p_picture
);
picture_Release
(
p_picture
);
return
;
return
0
;
}
}
/* */
/* */
...
@@ -903,38 +928,6 @@ static void DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
...
@@ -903,38 +928,6 @@ static void DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
*
pi_played_sum
+=
i_tmp_display
;
*
pi_played_sum
+=
i_tmp_display
;
*
pi_lost_sum
+=
i_tmp_lost
;
*
pi_lost_sum
+=
i_tmp_lost
;
}
static
int
DecoderPreparePlayVideo
(
decoder_t
*
p_dec
,
picture_t
*
p_pic
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
vout_thread_t
*
p_vout
=
p_owner
->
p_vout
;
bool
prerolled
;
vlc_mutex_lock
(
&
p_owner
->
lock
);
if
(
p_owner
->
i_preroll_end
>
p_pic
->
date
)
{
vlc_mutex_unlock
(
&
p_owner
->
lock
);
picture_Release
(
p_pic
);
return
-
1
;
}
prerolled
=
p_owner
->
i_preroll_end
>
INT64_MIN
;
p_owner
->
i_preroll_end
=
INT64_MIN
;
vlc_mutex_unlock
(
&
p_owner
->
lock
);
if
(
unlikely
(
prerolled
)
)
{
msg_Dbg
(
p_dec
,
"end of video preroll"
);
if
(
p_vout
)
vout_Flush
(
p_vout
,
VLC_TS_INVALID
+
1
);
}
if
(
p_dec
->
pf_get_cc
&&
(
!
p_owner
->
p_packetizer
||
!
p_owner
->
p_packetizer
->
pf_get_cc
)
)
DecoderGetCc
(
p_dec
,
p_dec
);
return
0
;
return
0
;
}
}
...
@@ -961,13 +954,11 @@ static int DecoderQueueVideo( decoder_t *p_dec, picture_t *p_pic )
...
@@ -961,13 +954,11 @@ static int DecoderQueueVideo( decoder_t *p_dec, picture_t *p_pic )
assert
(
p_pic
);
assert
(
p_pic
);
int
i_lost
=
0
;
int
i_lost
=
0
;
int
i_displayed
=
0
;
int
i_displayed
=
0
;
int
i_ret
;
if
(
(
i_ret
=
DecoderPreparePlayVideo
(
p_dec
,
p_pic
)
)
==
0
)
int
ret
=
DecoderPlayVideo
(
p_dec
,
p_pic
,
&
i_displayed
,
&
i_lost
);
DecoderPlayVideo
(
p_dec
,
p_pic
,
&
i_displayed
,
&
i_lost
);
DecoderUpdateStatVideo
(
p_dec
,
1
,
i_lost
,
i_displayed
);
DecoderUpdateStatVideo
(
p_dec
,
1
,
i_lost
,
i_displayed
);
return
i_
ret
;
return
ret
;
}
}
static
void
DecoderDecodeVideo
(
decoder_t
*
p_dec
,
block_t
*
p_block
)
static
void
DecoderDecodeVideo
(
decoder_t
*
p_dec
,
block_t
*
p_block
)
...
@@ -982,9 +973,6 @@ static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
...
@@ -982,9 +973,6 @@ static void DecoderDecodeVideo( decoder_t *p_dec, block_t *p_block )
{
{
i_decoded
++
;
i_decoded
++
;
if
(
DecoderPreparePlayVideo
(
p_dec
,
p_pic
)
!=
0
)
continue
;
DecoderPlayVideo
(
p_dec
,
p_pic
,
&
i_displayed
,
&
i_lost
);
DecoderPlayVideo
(
p_dec
,
p_pic
,
&
i_displayed
,
&
i_lost
);
}
}
...
...
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