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
cb48fdf6
Commit
cb48fdf6
authored
May 10, 2011
by
Alexander Strange
Committed by
Ronald S. Bultje
May 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: Simplify decode loop condition to not use next_pts
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
188dea1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
ffmpeg.c
ffmpeg.c
+8
-7
No files found.
ffmpeg.c
View file @
cb48fdf6
...
...
@@ -1417,7 +1417,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
AVFormatContext
*
os
;
AVOutputStream
*
ost
;
int
ret
,
i
;
int
got_
picture
;
int
got_
output
;
AVFrame
picture
;
void
*
buffer_to_free
;
static
unsigned
int
samples_size
=
0
;
...
...
@@ -1449,7 +1449,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
pkt_pts
=
av_rescale_q
(
pkt
->
pts
,
ist
->
st
->
time_base
,
AV_TIME_BASE_Q
);
//while we have more to decode or while the decoder did output something on EOF
while
(
avpkt
.
size
>
0
||
(
!
pkt
&&
ist
->
next_pts
!=
ist
->
pts
))
{
while
(
avpkt
.
size
>
0
||
(
!
pkt
&&
got_output
))
{
uint8_t
*
data_buf
,
*
decoded_data_buf
;
int
data_size
,
decoded_data_size
;
handle_eof
:
...
...
@@ -1485,9 +1485,10 @@ static int output_packet(AVInputStream *ist, int ist_index,
avpkt
.
data
+=
ret
;
avpkt
.
size
-=
ret
;
data_size
=
ret
;
got_output
=
decoded_data_size
>
0
;
/* Some bug in mpeg audio decoder gives */
/* decoded_data_size < 0, it seems they are overflows */
if
(
decoded_data_size
<=
0
)
{
if
(
!
got_output
)
{
/* no audio frame */
continue
;
}
...
...
@@ -1504,11 +1505,11 @@ static int output_packet(AVInputStream *ist, int ist_index,
pkt_pts
=
AV_NOPTS_VALUE
;
ret
=
avcodec_decode_video2
(
ist
->
st
->
codec
,
&
picture
,
&
got_
picture
,
&
avpkt
);
&
picture
,
&
got_
output
,
&
avpkt
);
ist
->
st
->
quality
=
picture
.
quality
;
if
(
ret
<
0
)
goto
fail_decode
;
if
(
!
got_
picture
)
{
if
(
!
got_
output
)
{
/* no picture yet */
goto
discard_packet
;
}
...
...
@@ -1523,10 +1524,10 @@ static int output_packet(AVInputStream *ist, int ist_index,
break
;
case
AVMEDIA_TYPE_SUBTITLE
:
ret
=
avcodec_decode_subtitle2
(
ist
->
st
->
codec
,
&
subtitle
,
&
got_
picture
,
&
avpkt
);
&
subtitle
,
&
got_
output
,
&
avpkt
);
if
(
ret
<
0
)
goto
fail_decode
;
if
(
!
got_
picture
)
{
if
(
!
got_
output
)
{
goto
discard_packet
;
}
subtitle_to_free
=
&
subtitle
;
...
...
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