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
a3cb8280
Commit
a3cb8280
authored
Aug 29, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dirac: use block_Init() and block_Release() as appropriate
parent
1fc44c76
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
modules/packetizer/dirac.c
modules/packetizer/dirac.c
+19
-12
No files found.
modules/packetizer/dirac.c
View file @
a3cb8280
...
...
@@ -215,23 +215,24 @@ enum {
typedef
struct
{
block_t
fake
;
block_t
*
p_orig
;
void
*
p_priv
;
dirac_block_encap_t
*
p_dbe
;
}
fake_block_t
;
static
dirac_block_encap_t
*
dirac_RemoveBlockEncap
(
block_t
*
p_block
)
{
fake_block_t
*
p_fake
=
(
fake_block_t
*
)
p_block
;
dirac_block_encap_t
*
p_dbe
=
p_fake
->
p_
priv
;
dirac_block_encap_t
*
p_dbe
=
p_fake
->
p_
dbe
;
p_fake
->
p_
priv
=
NULL
;
p_fake
->
p_
dbe
=
NULL
;
return
p_dbe
;
}
static
void
dirac_ReleaseBlockAndEncap
(
block_t
*
p_block
)
{
fake_block_t
*
p_fake
=
(
fake_block_t
*
)
p_block
;
free
(
dirac_RemoveBlockEncap
(
p_block
)
);
p_fake
->
p_orig
->
pf_r
elease
(
p_fake
->
p_orig
);
block_R
elease
(
p_fake
->
p_orig
);
free
(
p_fake
);
}
...
...
@@ -239,13 +240,19 @@ static void dirac_AddBlockEncap( block_t **pp_block, dirac_block_encap_t *p_dbe
{
/* must not fail, fixby: adding a p_priv to block_t */
fake_block_t
*
p_fake
=
xcalloc
(
1
,
sizeof
(
*
p_fake
)
);
p_fake
->
p_orig
=
*
pp_block
;
memcpy
(
&
p_fake
->
fake
,
*
pp_block
,
sizeof
(
block_t
)
);
*
pp_block
=
&
p_fake
->
fake
;
p_fake
->
p_priv
=
p_dbe
;
p_fake
->
fake
.
pf_release
=
dirac_ReleaseBlockAndEncap
;
block_t
*
in
=
*
pp_block
,
*
out
=
&
p_fake
->
fake
;
block_Init
(
out
,
in
->
p_buffer
,
in
->
i_buffer
);
out
->
i_flags
=
in
->
i_flags
;
out
->
i_nb_samples
=
in
->
i_nb_samples
;
out
->
i_pts
=
in
->
i_pts
;
out
->
i_dts
=
in
->
i_dts
;
out
->
i_length
=
in
->
i_length
;
out
->
pf_release
=
dirac_ReleaseBlockAndEncap
;
p_fake
->
p_orig
=
in
;
p_fake
->
p_dbe
=
p_dbe
;
*
pp_block
=
out
;
}
static
dirac_block_encap_t
*
dirac_NewBlockEncap
(
block_t
**
pp_block
)
...
...
@@ -257,7 +264,7 @@ static dirac_block_encap_t *dirac_NewBlockEncap( block_t **pp_block )
static
dirac_block_encap_t
*
dirac_GetBlockEncap
(
block_t
*
p_block
)
{
return
(
dirac_block_encap_t
*
)
((
fake_block_t
*
)
p_block
)
->
p_priv
;
return
(
(
fake_block_t
*
)
p_block
)
->
p_dbe
;
}
/***
...
...
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