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
dff6197d
Commit
dff6197d
authored
Jan 30, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nuv: do not rely on get_buffer() initializing the frame.
parent
39a9fdd0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
nuv.c
libavcodec/nuv.c
+9
-2
nuv-rtjpeg-fh
tests/ref/fate/nuv-rtjpeg-fh
+7
-7
No files found.
libavcodec/nuv.c
View file @
dff6197d
...
...
@@ -149,7 +149,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVFrame
*
picture
=
data
;
int
orig_size
=
buf_size
;
int
keyframe
;
int
result
;
int
result
,
init_frame
=
!
avctx
->
frame_number
;
enum
{
NUV_UNCOMPRESSED
=
'0'
,
NUV_RTJPEG
=
'1'
,
...
...
@@ -221,8 +221,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
buf_size
-=
RTJPEG_HEADER_SIZE
;
}
if
(
keyframe
&&
c
->
pic
.
data
[
0
])
if
(
keyframe
&&
c
->
pic
.
data
[
0
])
{
avctx
->
release_buffer
(
avctx
,
&
c
->
pic
);
init_frame
=
1
;
}
c
->
pic
.
reference
=
3
;
c
->
pic
.
buffer_hints
=
FF_BUFFER_HINTS_VALID
|
FF_BUFFER_HINTS_READABLE
|
FF_BUFFER_HINTS_PRESERVE
|
FF_BUFFER_HINTS_REUSABLE
;
...
...
@@ -231,6 +233,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
av_log
(
avctx
,
AV_LOG_ERROR
,
"get_buffer() failed
\n
"
);
return
result
;
}
if
(
init_frame
)
{
memset
(
c
->
pic
.
data
[
0
],
0
,
avctx
->
height
*
c
->
pic
.
linesize
[
0
]);
memset
(
c
->
pic
.
data
[
1
],
0x80
,
avctx
->
height
*
c
->
pic
.
linesize
[
1
]
/
2
);
memset
(
c
->
pic
.
data
[
2
],
0x80
,
avctx
->
height
*
c
->
pic
.
linesize
[
2
]
/
2
);
}
c
->
pic
.
pict_type
=
keyframe
?
AV_PICTURE_TYPE_I
:
AV_PICTURE_TYPE_P
;
c
->
pic
.
key_frame
=
keyframe
;
...
...
tests/ref/fate/nuv-rtjpeg-fh
View file @
dff6197d
#tb 0: 1/1000
0, 0, 0, 0, 221184, 0x
f48c94f6
0, 40, 40, 0, 221184, 0x
89b625b2
0, 60, 60, 0, 221184, 0x
37e04714
0, 80, 80, 0, 221184, 0x
4f4c5224
0, 100, 100, 0, 221184, 0x
9193c9f1
0, 120, 120, 0, 221184, 0x
5d1a6
197
0, 140, 140, 0, 221184, 0x
40cd5
1e7
0, 0, 0, 0, 221184, 0x
daf54f83
0, 40, 40, 0, 221184, 0x
eea3e3b4
0, 60, 60, 0, 221184, 0x
5f1a8525
0, 80, 80, 0, 221184, 0x
950bb170
0, 100, 100, 0, 221184, 0x
6262e94c
0, 120, 120, 0, 221184, 0x
28752
197
0, 140, 140, 0, 221184, 0x
0c281
1e7
0, 160, 160, 0, 221184, 0xb2c1a729
0, 200, 200, 0, 221184, 0x998d6144
0, 220, 220, 0, 221184, 0xf5d52311
...
...
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