Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
8229eff4
Commit
8229eff4
authored
Mar 21, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h2645_parse: add a function for uninitializing the packet
parent
fa936a30
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
8 deletions
+16
-8
h2645_parse.c
libavcodec/h2645_parse.c
+9
-0
h2645_parse.h
libavcodec/h2645_parse.h
+5
-0
hevc.c
libavcodec/hevc.c
+1
-4
hevc_parser.c
libavcodec/hevc_parser.c
+1
-4
No files found.
libavcodec/h2645_parse.c
View file @
8229eff4
...
...
@@ -226,3 +226,12 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
return
0
;
}
void
ff_h2645_packet_uninit
(
H2645Packet
*
pkt
)
{
int
i
;
for
(
i
=
0
;
i
<
pkt
->
nals_allocated
;
i
++
)
av_freep
(
&
pkt
->
nals
[
i
].
rbsp_buffer
);
av_freep
(
&
pkt
->
nals
);
pkt
->
nals_allocated
=
0
;
}
libavcodec/h2645_parse.h
View file @
8229eff4
...
...
@@ -61,4 +61,9 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
int
ff_h2645_packet_split
(
H2645Packet
*
pkt
,
const
uint8_t
*
buf
,
int
length
,
AVCodecContext
*
avctx
,
int
is_nalff
,
int
nal_length_size
);
/**
* Free all the allocated memory in the packet.
*/
void
ff_h2645_packet_uninit
(
H2645Packet
*
pkt
);
#endif
/* AVCODEC_H2645_PARSE_H */
libavcodec/hevc.c
View file @
8229eff4
...
...
@@ -2798,10 +2798,7 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
ps
.
pps_list
);
i
++
)
av_buffer_unref
(
&
s
->
ps
.
pps_list
[
i
]);
for
(
i
=
0
;
i
<
s
->
pkt
.
nals_allocated
;
i
++
)
av_freep
(
&
s
->
pkt
.
nals
[
i
].
rbsp_buffer
);
av_freep
(
&
s
->
pkt
.
nals
);
s
->
pkt
.
nals_allocated
=
0
;
ff_h2645_packet_uninit
(
&
s
->
pkt
);
return
0
;
}
...
...
libavcodec/hevc_parser.c
View file @
8229eff4
...
...
@@ -227,10 +227,7 @@ static void hevc_parser_close(AVCodecParserContext *s)
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
ctx
->
ps
.
pps_list
);
i
++
)
av_buffer_unref
(
&
ctx
->
ps
.
pps_list
[
i
]);
for
(
i
=
0
;
i
<
ctx
->
pkt
.
nals_allocated
;
i
++
)
av_freep
(
&
ctx
->
pkt
.
nals
[
i
].
rbsp_buffer
);
av_freep
(
&
ctx
->
pkt
.
nals
);
ctx
->
pkt
.
nals_allocated
=
0
;
ff_h2645_packet_uninit
(
&
ctx
->
pkt
);
av_freep
(
&
ctx
->
pc
.
buffer
);
}
...
...
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