Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
93194970
Commit
93194970
authored
Jun 13, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
picture: deduplicate some code
parent
acf8f08b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
18 deletions
+10
-18
src/misc/picture.c
src/misc/picture.c
+10
-18
No files found.
src/misc/picture.c
View file @
93194970
...
...
@@ -46,16 +46,8 @@
* used exactly like a video buffer. The video output thread then manages
* how it gets displayed.
*/
static
int
AllocatePicture
(
picture_t
*
p_pic
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_sar_num
,
int
i_sar_den
)
static
int
AllocatePicture
(
picture_t
*
p_pic
)
{
/* Make sure the real dimensions are a multiple of 16 */
if
(
picture_Setup
(
p_pic
,
i_chroma
,
i_width
,
i_height
,
i_sar_num
,
i_sar_den
)
!=
VLC_SUCCESS
)
return
VLC_EGENERIC
;
/* Calculate how big the new image should be */
size_t
i_bytes
=
0
;
for
(
int
i
=
0
;
i
<
p_pic
->
i_planes
;
i
++
)
...
...
@@ -210,14 +202,16 @@ picture_t *picture_NewFromResource( const video_format_t *p_fmt, const picture_r
if
(
!
p_picture
)
return
NULL
;
/* Make sure the real dimensions are a multiple of 16 */
if
(
picture_Setup
(
p_picture
,
fmt
.
i_chroma
,
fmt
.
i_width
,
fmt
.
i_height
,
fmt
.
i_sar_num
,
fmt
.
i_sar_den
)
)
{
free
(
p_picture
);
return
NULL
;
}
if
(
p_resource
)
{
if
(
picture_Setup
(
p_picture
,
fmt
.
i_chroma
,
fmt
.
i_width
,
fmt
.
i_height
,
fmt
.
i_sar_num
,
fmt
.
i_sar_den
)
)
{
free
(
p_picture
);
return
NULL
;
}
p_picture
->
p_sys
=
p_resource
->
p_sys
;
assert
(
p_picture
->
gc
.
p_sys
==
NULL
);
...
...
@@ -230,9 +224,7 @@ picture_t *picture_NewFromResource( const video_format_t *p_fmt, const picture_r
}
else
{
if
(
AllocatePicture
(
p_picture
,
fmt
.
i_chroma
,
fmt
.
i_width
,
fmt
.
i_height
,
fmt
.
i_sar_num
,
fmt
.
i_sar_den
)
)
if
(
AllocatePicture
(
p_picture
)
)
{
free
(
p_picture
);
return
NULL
;
...
...
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