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
e7188a1a
Commit
e7188a1a
authored
Jan 21, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avprobe: remove a pointless condition and a dead branch
AVStream.codec is always non-NULL
parent
dc4983d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
66 deletions
+63
-66
avprobe.c
avprobe.c
+63
-66
No files found.
avprobe.c
View file @
e7188a1a
...
...
@@ -610,74 +610,71 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
probe_int
(
"index"
,
stream
->
index
);
if
((
dec_ctx
=
stream
->
codec
))
{
if
((
dec
=
dec_ctx
->
codec
))
{
probe_str
(
"codec_name"
,
dec
->
name
);
probe_str
(
"codec_long_name"
,
dec
->
long_name
);
}
else
{
probe_str
(
"codec_name"
,
"unknown"
);
}
dec_ctx
=
stream
->
codec
;
if
((
dec
=
dec_ctx
->
codec
))
{
probe_str
(
"codec_name"
,
dec
->
name
);
probe_str
(
"codec_long_name"
,
dec
->
long_name
);
}
else
{
probe_str
(
"codec_name"
,
"unknown"
);
}
probe_str
(
"codec_type"
,
media_type_string
(
dec_ctx
->
codec_type
));
probe_str
(
"codec_time_base"
,
rational_string
(
val_str
,
sizeof
(
val_str
),
"/"
,
&
dec_ctx
->
time_base
));
/* print AVI/FourCC tag */
av_get_codec_tag_string
(
val_str
,
sizeof
(
val_str
),
dec_ctx
->
codec_tag
);
probe_str
(
"codec_tag_string"
,
val_str
);
probe_str
(
"codec_tag"
,
tag_string
(
val_str
,
sizeof
(
val_str
),
dec_ctx
->
codec_tag
));
/* print profile, if there is one */
if
(
dec
&&
(
profile
=
av_get_profile_name
(
dec
,
dec_ctx
->
profile
)))
probe_str
(
"profile"
,
profile
);
switch
(
dec_ctx
->
codec_type
)
{
case
AVMEDIA_TYPE_VIDEO
:
probe_int
(
"width"
,
dec_ctx
->
width
);
probe_int
(
"height"
,
dec_ctx
->
height
);
probe_int
(
"coded_width"
,
dec_ctx
->
coded_width
);
probe_int
(
"coded_height"
,
dec_ctx
->
coded_height
);
probe_int
(
"has_b_frames"
,
dec_ctx
->
has_b_frames
);
if
(
dec_ctx
->
sample_aspect_ratio
.
num
)
sar
=
&
dec_ctx
->
sample_aspect_ratio
;
else
if
(
stream
->
sample_aspect_ratio
.
num
)
sar
=
&
stream
->
sample_aspect_ratio
;
if
(
sar
)
{
probe_str
(
"sample_aspect_ratio"
,
rational_string
(
val_str
,
sizeof
(
val_str
),
":"
,
sar
));
av_reduce
(
&
display_aspect_ratio
.
num
,
&
display_aspect_ratio
.
den
,
dec_ctx
->
width
*
sar
->
num
,
dec_ctx
->
height
*
sar
->
den
,
1024
*
1024
);
probe_str
(
"display_aspect_ratio"
,
rational_string
(
val_str
,
sizeof
(
val_str
),
":"
,
&
display_aspect_ratio
));
}
desc
=
av_pix_fmt_desc_get
(
dec_ctx
->
pix_fmt
);
probe_str
(
"pix_fmt"
,
desc
?
desc
->
name
:
"unknown"
);
probe_int
(
"level"
,
dec_ctx
->
level
);
probe_str
(
"color_range"
,
av_color_range_name
(
dec_ctx
->
color_range
));
probe_str
(
"color_space"
,
av_color_space_name
(
dec_ctx
->
colorspace
));
probe_str
(
"color_trc"
,
av_color_transfer_name
(
dec_ctx
->
color_trc
));
probe_str
(
"color_pri"
,
av_color_primaries_name
(
dec_ctx
->
color_primaries
));
probe_str
(
"chroma_loc"
,
av_chroma_location_name
(
dec_ctx
->
chroma_sample_location
));
break
;
case
AVMEDIA_TYPE_AUDIO
:
probe_str
(
"sample_rate"
,
value_string
(
val_str
,
sizeof
(
val_str
),
dec_ctx
->
sample_rate
,
unit_hertz_str
));
probe_int
(
"channels"
,
dec_ctx
->
channels
);
probe_int
(
"bits_per_sample"
,
av_get_bits_per_sample
(
dec_ctx
->
codec_id
));
break
;
probe_str
(
"codec_type"
,
media_type_string
(
dec_ctx
->
codec_type
));
probe_str
(
"codec_time_base"
,
rational_string
(
val_str
,
sizeof
(
val_str
),
"/"
,
&
dec_ctx
->
time_base
));
/* print AVI/FourCC tag */
av_get_codec_tag_string
(
val_str
,
sizeof
(
val_str
),
dec_ctx
->
codec_tag
);
probe_str
(
"codec_tag_string"
,
val_str
);
probe_str
(
"codec_tag"
,
tag_string
(
val_str
,
sizeof
(
val_str
),
dec_ctx
->
codec_tag
));
/* print profile, if there is one */
if
(
dec
&&
(
profile
=
av_get_profile_name
(
dec
,
dec_ctx
->
profile
)))
probe_str
(
"profile"
,
profile
);
switch
(
dec_ctx
->
codec_type
)
{
case
AVMEDIA_TYPE_VIDEO
:
probe_int
(
"width"
,
dec_ctx
->
width
);
probe_int
(
"height"
,
dec_ctx
->
height
);
probe_int
(
"coded_width"
,
dec_ctx
->
coded_width
);
probe_int
(
"coded_height"
,
dec_ctx
->
coded_height
);
probe_int
(
"has_b_frames"
,
dec_ctx
->
has_b_frames
);
if
(
dec_ctx
->
sample_aspect_ratio
.
num
)
sar
=
&
dec_ctx
->
sample_aspect_ratio
;
else
if
(
stream
->
sample_aspect_ratio
.
num
)
sar
=
&
stream
->
sample_aspect_ratio
;
if
(
sar
)
{
probe_str
(
"sample_aspect_ratio"
,
rational_string
(
val_str
,
sizeof
(
val_str
),
":"
,
sar
));
av_reduce
(
&
display_aspect_ratio
.
num
,
&
display_aspect_ratio
.
den
,
dec_ctx
->
width
*
sar
->
num
,
dec_ctx
->
height
*
sar
->
den
,
1024
*
1024
);
probe_str
(
"display_aspect_ratio"
,
rational_string
(
val_str
,
sizeof
(
val_str
),
":"
,
&
display_aspect_ratio
));
}
}
else
{
probe_str
(
"codec_type"
,
"unknown"
);
desc
=
av_pix_fmt_desc_get
(
dec_ctx
->
pix_fmt
);
probe_str
(
"pix_fmt"
,
desc
?
desc
->
name
:
"unknown"
);
probe_int
(
"level"
,
dec_ctx
->
level
);
probe_str
(
"color_range"
,
av_color_range_name
(
dec_ctx
->
color_range
));
probe_str
(
"color_space"
,
av_color_space_name
(
dec_ctx
->
colorspace
));
probe_str
(
"color_trc"
,
av_color_transfer_name
(
dec_ctx
->
color_trc
));
probe_str
(
"color_pri"
,
av_color_primaries_name
(
dec_ctx
->
color_primaries
));
probe_str
(
"chroma_loc"
,
av_chroma_location_name
(
dec_ctx
->
chroma_sample_location
));
break
;
case
AVMEDIA_TYPE_AUDIO
:
probe_str
(
"sample_rate"
,
value_string
(
val_str
,
sizeof
(
val_str
),
dec_ctx
->
sample_rate
,
unit_hertz_str
));
probe_int
(
"channels"
,
dec_ctx
->
channels
);
probe_int
(
"bits_per_sample"
,
av_get_bits_per_sample
(
dec_ctx
->
codec_id
));
break
;
}
if
(
fmt_ctx
->
iformat
->
flags
&
AVFMT_SHOW_IDS
)
...
...
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