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
42597d6f
Commit
42597d6f
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: output delayed frames
Signed-off-by:
hwrenx
<
hwrenx@126.com
>
parent
701cbbb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
libdavs2.c
libavcodec/libdavs2.c
+19
-1
No files found.
libavcodec/libdavs2.c
View file @
42597d6f
...
...
@@ -125,6 +125,23 @@ static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic,
return
1
;
}
static
int
send_delayed_frame
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
,
int
*
got_frame
)
{
DAVS2Context
*
cad
=
avctx
->
priv_data
;
int
ret
=
DAVS2_DEFAULT
;
ret
=
davs2_decoder_flush
(
cad
->
decoder
,
&
cad
->
headerset
,
&
cad
->
out_frame
);
if
(
ret
==
DAVS2_ERROR
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Decoder error: can't flush delayed frame
\n
"
);
return
AVERROR_EXTERNAL
;
}
if
(
ret
==
DAVS2_GOT_FRAME
)
{
*
got_frame
=
davs2_dump_frames
(
avctx
,
&
cad
->
out_frame
,
&
cad
->
headerset
,
ret
,
frame
);
davs2_decoder_frame_unref
(
cad
->
decoder
,
&
cad
->
out_frame
);
}
return
ret
;
}
static
av_cold
int
davs2_end
(
AVCodecContext
*
avctx
)
{
DAVS2Context
*
cad
=
avctx
->
priv_data
;
...
...
@@ -147,8 +164,9 @@ static int davs2_decode_frame(AVCodecContext *avctx, void *data,
AVFrame
*
frame
=
data
;
int
ret
=
DAVS2_DEFAULT
;
/* end of stream, output what is still in the buffers */
if
(
!
buf_size
)
{
return
0
;
return
send_delayed_frame
(
avctx
,
frame
,
got_frame
)
;
}
cad
->
packet
.
data
=
buf_ptr
;
...
...
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