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
f08e54e8
Commit
f08e54e8
authored
Nov 02, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: use avcodec_decode_audio4() in avformat_find_stream_info()
parent
d1241ff3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
utils.c
libavformat/utils.c
+16
-15
No files found.
libavformat/utils.c
View file @
f08e54e8
...
...
@@ -2124,10 +2124,10 @@ static int has_decode_delay_been_guessed(AVStream *st)
static
int
try_decode_frame
(
AVStream
*
st
,
AVPacket
*
avpkt
,
AVDictionary
**
options
)
{
int16_t
*
samples
;
AVCodec
*
codec
;
int
got_picture
,
data_size
,
ret
=
0
;
int
got_picture
,
ret
=
0
;
AVFrame
picture
;
AVPacket
pkt
=
*
avpkt
;
if
(
!
st
->
codec
->
codec
){
codec
=
avcodec_find_decoder
(
st
->
codec
->
codec_id
);
...
...
@@ -2138,28 +2138,29 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **option
return
ret
;
}
if
(
!
has_codec_parameters
(
st
->
codec
)
||
!
has_decode_delay_been_guessed
(
st
)
||
(
!
st
->
codec_info_nb_frames
&&
st
->
codec
->
codec
->
capabilities
&
CODEC_CAP_CHANNEL_CONF
))
{
while
(
pkt
.
size
>
0
&&
ret
>=
0
&&
(
!
has_codec_parameters
(
st
->
codec
)
||
!
has_decode_delay_been_guessed
(
st
)
||
(
!
st
->
codec_info_nb_frames
&&
st
->
codec
->
codec
->
capabilities
&
CODEC_CAP_CHANNEL_CONF
)))
{
got_picture
=
0
;
avcodec_get_frame_defaults
(
&
picture
);
switch
(
st
->
codec
->
codec_type
)
{
case
AVMEDIA_TYPE_VIDEO
:
avcodec_get_frame_defaults
(
&
picture
);
ret
=
avcodec_decode_video2
(
st
->
codec
,
&
picture
,
&
got_picture
,
avpkt
);
if
(
got_picture
)
st
->
info
->
nb_decoded_frames
++
;
&
got_picture
,
&
pkt
);
break
;
case
AVMEDIA_TYPE_AUDIO
:
data_size
=
FFMAX
(
avpkt
->
size
,
AVCODEC_MAX_AUDIO_FRAME_SIZE
);
samples
=
av_malloc
(
data_size
);
if
(
!
samples
)
goto
fail
;
ret
=
avcodec_decode_audio3
(
st
->
codec
,
samples
,
&
data_size
,
avpkt
);
av_free
(
samples
);
ret
=
avcodec_decode_audio4
(
st
->
codec
,
&
picture
,
&
got_picture
,
&
pkt
);
break
;
default
:
break
;
}
if
(
ret
>=
0
)
{
if
(
got_picture
)
st
->
info
->
nb_decoded_frames
++
;
pkt
.
data
+=
ret
;
pkt
.
size
-=
ret
;
}
}
fail
:
return
ret
;
...
...
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