Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
609baf74
Commit
609baf74
authored
Sep 21, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed overlap support with overlap length smaller than display period.
parent
4dccfee4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
24 deletions
+47
-24
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+47
-24
No files found.
src/video_output/vout_subpictures.c
View file @
609baf74
...
@@ -85,8 +85,11 @@ struct spu_private_t
...
@@ -85,8 +85,11 @@ struct spu_private_t
bool
b_force_palette
;
/**< force palette of subpicture */
bool
b_force_palette
;
/**< force palette of subpicture */
uint8_t
palette
[
4
][
4
];
/**< forced palette */
uint8_t
palette
[
4
][
4
];
/**< forced palette */
/* Su
pc
iture filters */
/* Su
bp
iture filters */
filter_chain_t
*
p_chain
;
filter_chain_t
*
p_chain
;
/* */
mtime_t
i_last_sort_date
;
};
};
/* */
/* */
...
@@ -223,6 +226,9 @@ spu_t *__spu_Create( vlc_object_t *p_this )
...
@@ -223,6 +226,9 @@ spu_t *__spu_Create( vlc_object_t *p_this )
SpuRenderCreateAndLoadText
(
p_spu
);
SpuRenderCreateAndLoadText
(
p_spu
);
SpuRenderCreateAndLoadScale
(
p_spu
);
SpuRenderCreateAndLoadScale
(
p_spu
);
/* */
p_sys
->
i_last_sort_date
=
-
1
;
return
p_spu
;
return
p_spu
;
}
}
...
@@ -563,14 +569,21 @@ subpicture_t *spu_SortSubpictures( spu_t *p_spu, mtime_t display_date,
...
@@ -563,14 +569,21 @@ subpicture_t *spu_SortSubpictures( spu_t *p_spu, mtime_t display_date,
* ends with NULL since p_subpic was initialized to NULL. */
* ends with NULL since p_subpic was initialized to NULL. */
for
(
i_channel
=
0
;
i_channel
<
p_sys
->
i_channel
;
i_channel
++
)
for
(
i_channel
=
0
;
i_channel
<
p_sys
->
i_channel
;
i_channel
++
)
{
{
subpicture_t
*
p_ephemer
=
NULL
;
subpicture_t
*
p_available_subpic
[
VOUT_MAX_SUBPICTURES
];
bool
pb_available_late
[
VOUT_MAX_SUBPICTURES
];
int
i_available
=
0
;
mtime_t
start_date
=
display_date
;
mtime_t
ephemer_date
=
0
;
mtime_t
ephemer_date
=
0
;
int
i_index
;
int
i_index
;
/* Select available pictures */
for
(
i_index
=
0
;
i_index
<
VOUT_MAX_SUBPICTURES
;
i_index
++
)
for
(
i_index
=
0
;
i_index
<
VOUT_MAX_SUBPICTURES
;
i_index
++
)
{
{
spu_heap_entry_t
*
p_entry
=
&
p_sys
->
heap
.
p_entry
[
i_index
];
spu_heap_entry_t
*
p_entry
=
&
p_sys
->
heap
.
p_entry
[
i_index
];
subpicture_t
*
p_current
=
p_entry
->
p_subpicture
;
subpicture_t
*
p_current
=
p_entry
->
p_subpicture
;
bool
b_stop_valid
;
bool
b_late
;
if
(
!
p_current
||
p_entry
->
b_reject
)
if
(
!
p_current
||
p_entry
->
b_reject
)
{
{
...
@@ -594,39 +607,49 @@ subpicture_t *spu_SortSubpictures( spu_t *p_spu, mtime_t display_date,
...
@@ -594,39 +607,49 @@ subpicture_t *spu_SortSubpictures( spu_t *p_spu, mtime_t display_date,
if
(
p_current
->
i_start
>
ephemer_date
)
if
(
p_current
->
i_start
>
ephemer_date
)
ephemer_date
=
p_current
->
i_start
;
ephemer_date
=
p_current
->
i_start
;
if
(
display_date
>
p_current
->
i_stop
&&
b_stop_valid
=
(
!
p_current
->
b_ephemer
||
p_current
->
i_stop
>
p_current
->
i_start
)
&&
(
!
p_current
->
b_ephemer
||
p_current
->
i_stop
>
p_current
->
i_start
)
&&
(
!
p_current
->
b_subtitle
||
!
b_paused
);
/* XXX Assume that subtitle are pausable */
!
(
p_current
->
b_subtitle
&&
b_paused
)
)
/* XXX Assume that subtitle are pausable */
{
b_late
=
b_stop_valid
&&
p_current
->
i_stop
<=
display_date
;
SpuHeapDeleteAt
(
&
p_sys
->
heap
,
i_index
);
}
/* start_date will be used for correct automatic overlap support
else
if
(
p_current
->
b_ephemer
)
* in case picture that should not be displayed anymore (display_time)
{
* overlap with a picture to be displayed (p_current->i_start) */
SubpictureChain
(
&
p_ephemer
,
p_current
);
if
(
!
b_late
&&
!
p_current
->
b_ephemer
)
}
start_date
=
p_current
->
i_start
;
else
{
/* */
SubpictureChain
(
&
p_subpic
,
p_current
);
p_available_subpic
[
i_available
]
=
p_current
;
}
pb_available_late
[
i_available
]
=
b_late
;
i_available
++
;
}
}
/* If we found ephemer subpictures, check if they have to be
/* Only forced old picture display at the transition */
* displayed or destroyed */
if
(
start_date
<
p_sys
->
i_last_sort_date
)
while
(
p_ephemer
!=
NULL
)
start_date
=
p_sys
->
i_last_sort_date
;
if
(
start_date
<=
0
)
start_date
=
INT64_MAX
;
/* Select pictures to be displayed */
for
(
i_index
=
0
;
i_index
<
i_available
;
i_index
++
)
{
{
subpicture_t
*
p_
tmp
=
p_ephemer
;
subpicture_t
*
p_
current
=
p_available_subpic
[
i_index
]
;
p_ephemer
=
p_ephemer
->
p_next
;
bool
b_late
=
pb_available_late
[
i_index
]
;
if
(
p_tmp
->
i_start
<
ephemer_date
)
if
(
(
b_late
&&
p_current
->
i_stop
<=
__MAX
(
start_date
,
p_sys
->
i_last_sort_date
)
)
||
(
p_current
->
b_ephemer
&&
p_current
->
i_start
<
ephemer_date
)
)
{
{
SpuHeapDeleteSubpicture
(
&
p_sys
->
heap
,
p_tmp
);
/* Destroy late and obsolete ephemer subpictures */
SpuHeapDeleteSubpicture
(
&
p_sys
->
heap
,
p_current
);
}
}
else
else
{
{
SubpictureChain
(
&
p_subpic
,
p_
tmp
);
SubpictureChain
(
&
p_subpic
,
p_
current
);
}
}
}
}
}
}
p_sys
->
i_last_sort_date
=
display_date
;
vlc_mutex_unlock
(
&
p_sys
->
lock
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
return
p_subpic
;
return
p_subpic
;
...
...
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