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
a63b479d
Commit
a63b479d
authored
Sep 28, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/utils: factor find_decoder() out
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
07da0854
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
utils.c
libavformat/utils.c
+11
-5
No files found.
libavformat/utils.c
View file @
a63b479d
...
...
@@ -99,6 +99,14 @@ static int64_t wrap_timestamp(AVStream *st, int64_t timestamp)
MAKE_ACCESSORS
(
AVStream
,
stream
,
AVRational
,
r_frame_rate
)
static
AVCodec
*
find_decoder
(
AVStream
*
st
,
enum
AVCodecID
codec_id
)
{
if
(
st
->
codec
->
codec
)
return
st
->
codec
->
codec
;
return
avcodec_find_decoder
(
codec_id
);
}
int
av_format_get_probe_score
(
const
AVFormatContext
*
s
)
{
return
s
->
probe_score
;
...
...
@@ -2444,8 +2452,7 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **option
if
(
!
avcodec_is_open
(
st
->
codec
)
&&
!
st
->
info
->
found_decoder
)
{
AVDictionary
*
thread_opt
=
NULL
;
codec
=
st
->
codec
->
codec
?
st
->
codec
->
codec
:
avcodec_find_decoder
(
st
->
codec
->
codec_id
);
codec
=
find_decoder
(
st
,
st
->
codec
->
codec_id
);
if
(
!
codec
)
{
st
->
info
->
found_decoder
=
-
1
;
...
...
@@ -2696,8 +2703,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
avcodec_get_name
(
st
->
codec
->
codec_id
));
}
}
codec
=
st
->
codec
->
codec
?
st
->
codec
->
codec
:
avcodec_find_decoder
(
st
->
codec
->
codec_id
);
codec
=
find_decoder
(
st
,
st
->
codec
->
codec_id
);
/* force thread count to 1 since the h264 decoder will not extract SPS
* and PPS to extradata during multi-threaded decoding */
...
...
@@ -3148,7 +3154,7 @@ int av_find_best_stream(AVFormatContext *ic,
if
(
st
->
disposition
&
(
AV_DISPOSITION_HEARING_IMPAIRED
|
AV_DISPOSITION_VISUAL_IMPAIRED
))
continue
;
if
(
decoder_ret
)
{
decoder
=
avcodec_find_decoder
(
st
->
codec
->
codec_id
);
decoder
=
find_decoder
(
st
,
st
->
codec
->
codec_id
);
if
(
!
decoder
)
{
if
(
ret
<
0
)
ret
=
AVERROR_DECODER_NOT_FOUND
;
...
...
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