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
160b51a3
Commit
160b51a3
authored
Nov 01, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: simplify picture references
parent
3159c34c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
18 deletions
+4
-18
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+4
-18
No files found.
modules/codec/avcodec/video.c
View file @
160b51a3
...
...
@@ -988,18 +988,11 @@ static int lavc_va_GetFrame(struct AVCodecContext *ctx, AVFrame *frame,
return
0
;
}
typedef
struct
{
decoder_t
*
decoder
;
picture_t
*
picture
;
}
lavc_pic_ref_t
;
static
void
lavc_dr_ReleaseFrame
(
void
*
opaque
,
uint8_t
*
data
)
{
lavc_pic_ref_t
*
ref
=
opaque
;
picture_t
*
picture
=
opaque
;
picture_Release
(
ref
->
picture
);
free
(
ref
);
picture_Release
(
picture
);
(
void
)
data
;
}
...
...
@@ -1062,21 +1055,14 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx,
/* Allocate buffer references */
for
(
int
i
=
0
;
i
<
pic
->
i_planes
;
i
++
)
{
lavc_pic_ref_t
*
ref
=
malloc
(
sizeof
(
*
ref
));
if
(
ref
==
NULL
)
goto
error
;
ref
->
decoder
=
dec
;
ref
->
picture
=
pic
;
picture_Hold
(
pic
);
uint8_t
*
data
=
pic
->
p
[
i
].
p_pixels
;
int
size
=
pic
->
p
[
i
].
i_pitch
*
pic
->
p
[
i
].
i_lines
;
frame
->
buf
[
i
]
=
av_buffer_create
(
data
,
size
,
lavc_dr_ReleaseFrame
,
ref
,
0
);
picture_Hold
(
pic
)
,
0
);
if
(
unlikely
(
frame
->
buf
[
i
]
==
NULL
))
{
lavc_dr_ReleaseFrame
(
ref
,
data
);
lavc_dr_ReleaseFrame
(
pic
,
data
);
goto
error
;
}
}
...
...
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