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
3f486e0d
Commit
3f486e0d
authored
Feb 21, 2012
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
img2: Use ff_guess_image2_codec(filename) shorthand where appropriate.
parent
24d150b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
img2.c
libavformat/img2.c
+8
-8
No files found.
libavformat/img2.c
View file @
3f486e0d
...
...
@@ -129,6 +129,11 @@ static enum CodecID av_str2id(const IdStrMap *tags, const char *str)
return
CODEC_ID_NONE
;
}
enum
CodecID
ff_guess_image2_codec
(
const
char
*
filename
)
{
return
av_str2id
(
img_tags
,
filename
);
}
/* return -1 if no image found */
static
int
find_image_range
(
int
*
pfirst_index
,
int
*
plast_index
,
const
char
*
path
)
...
...
@@ -185,7 +190,7 @@ static int find_image_range(int *pfirst_index, int *plast_index,
static
int
read_probe
(
AVProbeData
*
p
)
{
if
(
p
->
filename
&&
av_str2id
(
img_tags
,
p
->
filename
))
{
if
(
p
->
filename
&&
ff_guess_image2_codec
(
p
->
filename
))
{
if
(
av_filename_number_test
(
p
->
filename
))
return
AVPROBE_SCORE_MAX
;
else
...
...
@@ -194,11 +199,6 @@ static int read_probe(AVProbeData *p)
return
0
;
}
enum
CodecID
ff_guess_image2_codec
(
const
char
*
filename
)
{
return
av_str2id
(
img_tags
,
filename
);
}
static
int
read_header
(
AVFormatContext
*
s1
)
{
VideoData
*
s
=
s1
->
priv_data
;
...
...
@@ -266,7 +266,7 @@ static int read_header(AVFormatContext *s1)
st
->
codec
->
codec_id
=
s1
->
audio_codec_id
;
}
else
{
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
st
->
codec
->
codec_id
=
av_str2id
(
img_tags
,
s
->
path
);
st
->
codec
->
codec_id
=
ff_guess_image2_codec
(
s
->
path
);
}
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
pix_fmt
!=
PIX_FMT_NONE
)
st
->
codec
->
pix_fmt
=
pix_fmt
;
...
...
@@ -403,7 +403,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
avio_close
(
pb
[
1
]);
avio_close
(
pb
[
2
]);
}
else
{
if
(
av_str2id
(
img_tags
,
s
->
filename
)
==
CODEC_ID_JPEG2000
)
{
if
(
ff_guess_image2_codec
(
s
->
filename
)
==
CODEC_ID_JPEG2000
)
{
AVStream
*
st
=
s
->
streams
[
0
];
if
(
st
->
codec
->
extradata_size
>
8
&&
AV_RL32
(
st
->
codec
->
extradata
+
4
)
==
MKTAG
(
'j'
,
'p'
,
'2'
,
'h'
)){
...
...
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