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
e20c4069
Commit
e20c4069
authored
May 06, 2003
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release buffer cleanup
Originally committed as revision 1839 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
61873c4a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
16 deletions
+27
-16
cyuv.c
libavcodec/cyuv.c
+3
-2
dv.c
libavcodec/dv.c
+3
-2
huffyuv.c
libavcodec/huffyuv.c
+3
-3
indeo3.c
libavcodec/indeo3.c
+3
-2
mpegvideo.c
libavcodec/mpegvideo.c
+15
-7
No files found.
libavcodec/cyuv.c
View file @
e20c4069
...
@@ -98,6 +98,9 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
...
@@ -98,6 +98,9 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
/* pixel data starts 48 bytes in, after 3x16-byte tables */
/* pixel data starts 48 bytes in, after 3x16-byte tables */
stream_ptr
=
48
;
stream_ptr
=
48
;
if
(
s
->
frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
frame
);
s
->
frame
.
reference
=
0
;
s
->
frame
.
reference
=
0
;
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
)
<
0
)
{
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
)
<
0
)
{
fprintf
(
stderr
,
"get_buffer() failed
\n
"
);
fprintf
(
stderr
,
"get_buffer() failed
\n
"
);
...
@@ -159,8 +162,6 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
...
@@ -159,8 +162,6 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
*
data_size
=
sizeof
(
AVFrame
);
*
data_size
=
sizeof
(
AVFrame
);
*
(
AVFrame
*
)
data
=
s
->
frame
;
*
(
AVFrame
*
)
data
=
s
->
frame
;
avctx
->
release_buffer
(
avctx
,
&
s
->
frame
);
return
buf_size
;
return
buf_size
;
}
}
...
...
libavcodec/dv.c
View file @
e20c4069
...
@@ -580,6 +580,9 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
...
@@ -580,6 +580,9 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
else
else
avctx
->
aspect_ratio
=
4
.
0
/
3
.
0
;
avctx
->
aspect_ratio
=
4
.
0
/
3
.
0
;
if
(
s
->
picture
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
picture
);
s
->
picture
.
reference
=
0
;
s
->
picture
.
reference
=
0
;
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
picture
)
<
0
)
{
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
picture
)
<
0
)
{
fprintf
(
stderr
,
"get_buffer() failed
\n
"
);
fprintf
(
stderr
,
"get_buffer() failed
\n
"
);
...
@@ -617,8 +620,6 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
...
@@ -617,8 +620,6 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
*
data_size
=
sizeof
(
AVFrame
);
*
data_size
=
sizeof
(
AVFrame
);
*
(
AVFrame
*
)
data
=
s
->
picture
;
*
(
AVFrame
*
)
data
=
s
->
picture
;
avctx
->
release_buffer
(
avctx
,
&
s
->
picture
);
return
packet_size
;
return
packet_size
;
}
}
...
...
libavcodec/huffyuv.c
View file @
e20c4069
...
@@ -737,6 +737,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
...
@@ -737,6 +737,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
init_get_bits
(
&
s
->
gb
,
s
->
bitstream_buffer
,
buf_size
*
8
);
init_get_bits
(
&
s
->
gb
,
s
->
bitstream_buffer
,
buf_size
*
8
);
if
(
p
->
data
[
0
])
avctx
->
release_buffer
(
avctx
,
p
);
p
->
reference
=
0
;
p
->
reference
=
0
;
if
(
avctx
->
get_buffer
(
avctx
,
p
)
<
0
){
if
(
avctx
->
get_buffer
(
avctx
,
p
)
<
0
){
fprintf
(
stderr
,
"get_buffer() failed
\n
"
);
fprintf
(
stderr
,
"get_buffer() failed
\n
"
);
...
@@ -943,9 +946,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
...
@@ -943,9 +946,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
emms_c
();
emms_c
();
*
picture
=
*
p
;
*
picture
=
*
p
;
avctx
->
release_buffer
(
avctx
,
p
);
*
data_size
=
sizeof
(
AVFrame
);
*
data_size
=
sizeof
(
AVFrame
);
return
(
get_bits_count
(
&
s
->
gb
)
+
31
)
/
32
*
4
;
return
(
get_bits_count
(
&
s
->
gb
)
+
31
)
/
32
*
4
;
...
...
libavcodec/indeo3.c
View file @
e20c4069
...
@@ -1056,6 +1056,9 @@ static int indeo3_decode_frame(AVCodecContext *avctx,
...
@@ -1056,6 +1056,9 @@ static int indeo3_decode_frame(AVCodecContext *avctx,
iv_decode_frame
(
s
,
buf
,
buf_size
);
iv_decode_frame
(
s
,
buf
,
buf_size
);
if
(
s
->
frame
.
data
[
0
])
avctx
->
release_buffer
(
avctx
,
&
s
->
frame
);
s
->
frame
.
reference
=
0
;
s
->
frame
.
reference
=
0
;
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
)
<
0
)
{
if
(
avctx
->
get_buffer
(
avctx
,
&
s
->
frame
)
<
0
)
{
fprintf
(
stderr
,
"get_buffer() failed
\n
"
);
fprintf
(
stderr
,
"get_buffer() failed
\n
"
);
...
@@ -1089,8 +1092,6 @@ static int indeo3_decode_frame(AVCodecContext *avctx,
...
@@ -1089,8 +1092,6 @@ static int indeo3_decode_frame(AVCodecContext *avctx,
*
data_size
=
sizeof
(
AVFrame
);
*
data_size
=
sizeof
(
AVFrame
);
*
(
AVFrame
*
)
data
=
s
->
frame
;
*
(
AVFrame
*
)
data
=
s
->
frame
;
avctx
->
release_buffer
(
avctx
,
&
s
->
frame
);
return
buf_size
;
return
buf_size
;
}
}
...
...
libavcodec/mpegvideo.c
View file @
e20c4069
...
@@ -929,7 +929,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
...
@@ -929,7 +929,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
s
->
mb_skiped
=
0
;
s
->
mb_skiped
=
0
;
assert
(
s
->
last_picture_ptr
==
NULL
||
s
->
out_format
!=
FMT_H264
);
assert
(
s
->
last_picture_ptr
==
NULL
||
s
->
out_format
!=
FMT_H264
);
/* mark&release old frames */
/* mark&release old frames */
if
(
s
->
pict_type
!=
B_TYPE
&&
s
->
last_picture_ptr
)
{
if
(
s
->
pict_type
!=
B_TYPE
&&
s
->
last_picture_ptr
)
{
avctx
->
release_buffer
(
avctx
,
(
AVFrame
*
)
s
->
last_picture_ptr
);
avctx
->
release_buffer
(
avctx
,
(
AVFrame
*
)
s
->
last_picture_ptr
);
...
@@ -945,9 +945,15 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
...
@@ -945,9 +945,15 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
}
}
}
}
}
}
alloc
:
alloc
:
if
(
!
s
->
encoding
){
if
(
!
s
->
encoding
){
/* release non refernce frames */
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
){
if
(
s
->
picture
[
i
].
data
[
0
]
&&
!
s
->
picture
[
i
].
reference
/*&& s->picture[i].type!=FF_BUFFER_TYPE_SHARED*/
){
s
->
avctx
->
release_buffer
(
s
->
avctx
,
(
AVFrame
*
)
&
s
->
picture
[
i
]);
}
}
i
=
find_unused_picture
(
s
,
0
);
i
=
find_unused_picture
(
s
,
0
);
pic
=
(
AVFrame
*
)
&
s
->
picture
[
i
];
pic
=
(
AVFrame
*
)
&
s
->
picture
[
i
];
...
@@ -1041,12 +1047,14 @@ void MPV_frame_end(MpegEncContext *s)
...
@@ -1041,12 +1047,14 @@ void MPV_frame_end(MpegEncContext *s)
assert(i<MAX_PICTURE_COUNT);
assert(i<MAX_PICTURE_COUNT);
#endif
#endif
/* release non refernce frames */
if
(
s
->
encoding
){
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
){
/* release non refernce frames */
if
(
s
->
picture
[
i
].
data
[
0
]
&&
!
s
->
picture
[
i
].
reference
/*&& s->picture[i].type!=FF_BUFFER_TYPE_SHARED*/
)
for
(
i
=
0
;
i
<
MAX_PICTURE_COUNT
;
i
++
){
s
->
avctx
->
release_buffer
(
s
->
avctx
,
(
AVFrame
*
)
&
s
->
picture
[
i
]);
if
(
s
->
picture
[
i
].
data
[
0
]
&&
!
s
->
picture
[
i
].
reference
/*&& s->picture[i].type!=FF_BUFFER_TYPE_SHARED*/
){
s
->
avctx
->
release_buffer
(
s
->
avctx
,
(
AVFrame
*
)
&
s
->
picture
[
i
]);
}
}
}
}
// clear copies, to avoid confusion
// clear copies, to avoid confusion
#if 0
#if 0
memset(&s->last_picture, 0, sizeof(Picture));
memset(&s->last_picture, 0, sizeof(Picture));
...
...
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