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
8ef0fdaa
Commit
8ef0fdaa
authored
Dec 03, 2018
by
hwrenx
Committed by
Steven Liu
Dec 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/libdavs2: fix function return value error
Signed-off-by:
hwrenx
<
hwrenx@126.com
>
parent
42597d6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
libdavs2.c
libavcodec/libdavs2.c
+10
-6
No files found.
libavcodec/libdavs2.c
View file @
8ef0fdaa
...
@@ -58,7 +58,7 @@ static av_cold int davs2_init(AVCodecContext *avctx)
...
@@ -58,7 +58,7 @@ static av_cold int davs2_init(AVCodecContext *avctx)
return
0
;
return
0
;
}
}
static
int
davs2_dump_frames
(
AVCodecContext
*
avctx
,
davs2_picture_t
*
pic
,
static
int
davs2_dump_frames
(
AVCodecContext
*
avctx
,
davs2_picture_t
*
pic
,
int
*
got_frame
,
davs2_seq_info_t
*
headerset
,
int
ret_type
,
AVFrame
*
frame
)
davs2_seq_info_t
*
headerset
,
int
ret_type
,
AVFrame
*
frame
)
{
{
DAVS2Context
*
cad
=
avctx
->
priv_data
;
DAVS2Context
*
cad
=
avctx
->
priv_data
;
...
@@ -66,8 +66,10 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic,
...
@@ -66,8 +66,10 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic,
int
plane
=
0
;
int
plane
=
0
;
int
line
=
0
;
int
line
=
0
;
if
(
!
headerset
)
if
(
!
headerset
)
{
*
got_frame
=
0
;
return
0
;
return
0
;
}
if
(
!
pic
||
ret_type
==
DAVS2_GOT_HEADER
)
{
if
(
!
pic
||
ret_type
==
DAVS2_GOT_HEADER
)
{
avctx
->
width
=
headerset
->
width
;
avctx
->
width
=
headerset
->
width
;
...
@@ -76,6 +78,7 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic,
...
@@ -76,6 +78,7 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic,
AV_PIX_FMT_YUV420P10
:
AV_PIX_FMT_YUV420P
;
AV_PIX_FMT_YUV420P10
:
AV_PIX_FMT_YUV420P
;
avctx
->
framerate
=
av_d2q
(
headerset
->
frame_rate
,
4096
);
avctx
->
framerate
=
av_d2q
(
headerset
->
frame_rate
,
4096
);
*
got_frame
=
0
;
return
0
;
return
0
;
}
}
...
@@ -122,7 +125,8 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic,
...
@@ -122,7 +125,8 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic,
frame
->
pts
=
cad
->
out_frame
.
pts
;
frame
->
pts
=
cad
->
out_frame
.
pts
;
frame
->
format
=
avctx
->
pix_fmt
;
frame
->
format
=
avctx
->
pix_fmt
;
return
1
;
*
got_frame
=
1
;
return
0
;
}
}
static
int
send_delayed_frame
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
int
*
got_frame
)
static
int
send_delayed_frame
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
int
*
got_frame
)
...
@@ -136,7 +140,7 @@ static int send_delayed_frame(AVCodecContext *avctx, AVFrame *frame, int *got_fr
...
@@ -136,7 +140,7 @@ static int send_delayed_frame(AVCodecContext *avctx, AVFrame *frame, int *got_fr
return
AVERROR_EXTERNAL
;
return
AVERROR_EXTERNAL
;
}
}
if
(
ret
==
DAVS2_GOT_FRAME
)
{
if
(
ret
==
DAVS2_GOT_FRAME
)
{
*
got_frame
=
davs2_dump_frames
(
avctx
,
&
cad
->
ou
t_frame
,
&
cad
->
headerset
,
ret
,
frame
);
ret
=
davs2_dump_frames
(
avctx
,
&
cad
->
out_frame
,
go
t_frame
,
&
cad
->
headerset
,
ret
,
frame
);
davs2_decoder_frame_unref
(
cad
->
decoder
,
&
cad
->
out_frame
);
davs2_decoder_frame_unref
(
cad
->
decoder
,
&
cad
->
out_frame
);
}
}
return
ret
;
return
ret
;
...
@@ -185,11 +189,11 @@ static int davs2_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -185,11 +189,11 @@ static int davs2_decode_frame(AVCodecContext *avctx, void *data,
ret
=
davs2_decoder_recv_frame
(
cad
->
decoder
,
&
cad
->
headerset
,
&
cad
->
out_frame
);
ret
=
davs2_decoder_recv_frame
(
cad
->
decoder
,
&
cad
->
headerset
,
&
cad
->
out_frame
);
if
(
ret
!=
DAVS2_DEFAULT
)
{
if
(
ret
!=
DAVS2_DEFAULT
)
{
*
got_frame
=
davs2_dump_frames
(
avctx
,
&
cad
->
ou
t_frame
,
&
cad
->
headerset
,
ret
,
frame
);
ret
=
davs2_dump_frames
(
avctx
,
&
cad
->
out_frame
,
go
t_frame
,
&
cad
->
headerset
,
ret
,
frame
);
davs2_decoder_frame_unref
(
cad
->
decoder
,
&
cad
->
out_frame
);
davs2_decoder_frame_unref
(
cad
->
decoder
,
&
cad
->
out_frame
);
}
}
return
buf_size
;
return
ret
==
0
?
buf_size
:
ret
;
}
}
AVCodec
ff_libdavs2_decoder
=
{
AVCodec
ff_libdavs2_decoder
=
{
...
...
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