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
ccc672c7
Commit
ccc672c7
authored
Sep 26, 2007
by
Jean-Paul Saman
Committed by
Jean-Paul Saman
Mar 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rendering of TEXT subtitles.
parent
c122052b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
27 deletions
+37
-27
src/video_output/vout_subpictures.c
src/video_output/vout_subpictures.c
+37
-27
No files found.
src/video_output/vout_subpictures.c
View file @
ccc672c7
...
...
@@ -507,8 +507,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
}
/* Load the text rendering module */
if
(
!
p_spu
->
p_text
&&
p_region
&&
(
p_region
->
fmt
.
i_chroma
==
VLC_FOURCC
(
'T'
,
'E'
,
'X'
,
'T'
)
)
)
if
(
!
p_spu
->
p_text
&&
p_region
)
{
char
*
psz_modulename
=
NULL
;
...
...
@@ -529,7 +528,8 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
if
(
psz_modulename
&&
*
psz_modulename
)
{
p_spu
->
p_text
->
p_module
=
module_Need
(
p_spu
->
p_text
,
"text renderer"
,
psz_modulename
,
VLC_TRUE
);
module_Need
(
p_spu
->
p_text
,
"text renderer"
,
psz_modulename
,
VLC_TRUE
);
}
if
(
!
p_spu
->
p_text
->
p_module
)
{
...
...
@@ -541,17 +541,22 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
if
(
p_spu
->
p_text
)
{
if
(
p_subpic
->
i_original_picture_height
>
0
&&
p_subpic
->
i_original_picture_width
>
0
)
subpicture_region_t
*
p_text_region
=
p_subpic
->
p_region
;
/* Only overwrite the size fields if the region is still in pre-rendered
* TEXT format. We have to traverse the subregion list because if more
* than one subregion is present, the text region isn't guarentteed to
* be the first in the list, and only text regions use this flag.
* All of this effort assists with the rescaling of text that has been
* rendered at native resolution, rather than video resolution.
*/
while
(
p_text_region
&&
(
p_text_region
->
fmt
.
i_chroma
!=
VLC_FOURCC
(
'T'
,
'E'
,
'X'
,
'T'
)
)
)
{
p_spu
->
p_text
->
fmt_out
.
video
.
i_width
=
p_spu
->
p_text
->
fmt_out
.
video
.
i_visible_width
=
p_subpic
->
i_original_picture_width
;
p_spu
->
p_text
->
fmt_out
.
video
.
i_height
=
p_spu
->
p_text
->
fmt_out
.
video
.
i_visible_height
=
p_subpic
->
i_original_picture_height
;
p_text_region
=
p_text_region
->
p_next
;
}
else
if
(
p_text_region
)
{
p_spu
->
p_text
->
fmt_out
.
video
.
i_width
=
p_spu
->
p_text
->
fmt_out
.
video
.
i_visible_width
=
...
...
@@ -653,7 +658,8 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
}
/* Scale SPU if necessary */
if
(
p_region
->
p_cache
)
if
(
p_region
->
p_cache
&&
(
p_region
->
fmt
.
i_chroma
!=
VLC_FOURCC
(
'T'
,
'E'
,
'X'
,
'T'
)
)
)
{
if
(
(
i_scale_width
*
p_region
->
fmt
.
i_width
/
1000
!=
p_region
->
p_cache
->
fmt
.
i_width
)
||
...
...
@@ -668,7 +674,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
if
(
(
(
i_scale_width
!=
1000
)
||
(
i_scale_height
!=
1000
)
)
&&
p_spu
->
p_scale
&&
!
p_region
->
p_cache
&&
(
VLC_FOURCC
(
'R'
,
'G'
,
'B'
,
'A'
)
!=
p_region
->
fmt
.
i_chroma
/* FIXME */
)
)
(
p_region
->
fmt
.
i_chroma
!=
VLC_FOURCC
(
'T'
,
'E'
,
'X'
,
'T'
)
)
)
{
picture_t
*
p_pic
;
...
...
@@ -708,8 +714,10 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
free
(
p_pic
);
}
}
if
(
(
(
i_scale_width
!=
1000
)
||
(
i_scale_height
!=
1000
)
)
&&
p_spu
->
p_scale
&&
p_region
->
p_cache
)
p_spu
->
p_scale
&&
p_region
->
p_cache
&&
(
p_region
->
fmt
.
i_chroma
!=
VLC_FOURCC
(
'T'
,
'E'
,
'X'
,
'T'
)
)
)
{
p_region
=
p_region
->
p_cache
;
}
...
...
@@ -798,14 +806,6 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
}
}
/* Update the output picture size */
p_spu
->
p_blend
->
fmt_out
.
video
.
i_width
=
p_spu
->
p_blend
->
fmt_out
.
video
.
i_visible_width
=
p_fmt
->
i_width
;
p_spu
->
p_blend
->
fmt_out
.
video
.
i_height
=
p_spu
->
p_blend
->
fmt_out
.
video
.
i_visible_height
=
p_fmt
->
i_height
;
if
(
p_subpic
->
b_fade
)
{
mtime_t
i_fade_start
=
(
p_subpic
->
i_stop
+
...
...
@@ -821,10 +821,20 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
i_x_offset
=
__MAX
(
i_x_offset
,
0
);
i_y_offset
=
__MAX
(
i_y_offset
,
0
);
p_spu
->
p_blend
->
pf_video_blend
(
p_spu
->
p_blend
,
p_pic_dst
,
p_pic_src
,
&
p_region
->
picture
,
i_x_offset
,
i_y_offset
,
i_fade_alpha
*
p_subpic
->
i_alpha
/
255
);
if
(
p_region
->
fmt
.
i_chroma
!=
VLC_FOURCC
(
'T'
,
'E'
,
'X'
,
'T'
)
)
{
/* Update the output picture size */
p_spu
->
p_blend
->
fmt_out
.
video
.
i_width
=
p_spu
->
p_blend
->
fmt_out
.
video
.
i_visible_width
=
p_fmt
->
i_width
;
p_spu
->
p_blend
->
fmt_out
.
video
.
i_height
=
p_spu
->
p_blend
->
fmt_out
.
video
.
i_visible_height
=
p_fmt
->
i_height
;
p_spu
->
p_blend
->
pf_video_blend
(
p_spu
->
p_blend
,
p_pic_dst
,
p_pic_src
,
&
p_region
->
picture
,
i_x_offset
,
i_y_offset
,
i_fade_alpha
*
p_subpic
->
i_alpha
/
255
);
}
p_region
=
p_region
->
p_next
;
}
...
...
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