Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
ffmpeg
Commits
650a5206
Commit
650a5206
authored
Apr 04, 2014
by
Anton Khirnov
Browse files
avconv: rename 'icodec' to 'dec_ctx'
This more clearly describes what is the variable used for.
parent
f3a6ad22
Changes
1
Hide whitespace changes
Inline
Side-by-side
avconv.c
View file @
650a5206
...
...
@@ -1674,7 +1674,7 @@ static int transcode_init(void)
/* for each output stream, we compute the right encoding parameters */
for
(
i
=
0
;
i
<
nb_output_streams
;
i
++
)
{
AVCodecContext
*
ico
dec
=
NULL
;
AVCodecContext
*
dec
_ctx
=
NULL
;
ost
=
output_streams
[
i
];
oc
=
output_files
[
ost
->
file_index
]
->
ctx
;
ist
=
get_input_stream
(
ost
);
...
...
@@ -1685,11 +1685,11 @@ static int transcode_init(void)
codec
=
ost
->
st
->
codec
;
if
(
ist
)
{
ico
dec
=
ist
->
st
->
codec
;
dec
_ctx
=
ist
->
st
->
codec
;
ost
->
st
->
disposition
=
ist
->
st
->
disposition
;
codec
->
bits_per_raw_sample
=
ico
dec
->
bits_per_raw_sample
;
codec
->
chroma_sample_location
=
ico
dec
->
chroma_sample_location
;
codec
->
bits_per_raw_sample
=
dec
_ctx
->
bits_per_raw_sample
;
codec
->
chroma_sample_location
=
dec
_ctx
->
chroma_sample_location
;
}
if
(
ost
->
stream_copy
)
{
...
...
@@ -1698,36 +1698,36 @@ static int transcode_init(void)
av_assert0
(
ist
&&
!
ost
->
filter
);
extra_size
=
(
uint64_t
)
ico
dec
->
extradata_size
+
FF_INPUT_BUFFER_PADDING_SIZE
;
extra_size
=
(
uint64_t
)
dec
_ctx
->
extradata_size
+
FF_INPUT_BUFFER_PADDING_SIZE
;
if
(
extra_size
>
INT_MAX
)
{
return
AVERROR
(
EINVAL
);
}
/* if stream_copy is selected, no need to decode or encode */
codec
->
codec_id
=
ico
dec
->
codec_id
;
codec
->
codec_type
=
ico
dec
->
codec_type
;
codec
->
codec_id
=
dec
_ctx
->
codec_id
;
codec
->
codec_type
=
dec
_ctx
->
codec_type
;
if
(
!
codec
->
codec_tag
)
{
if
(
!
oc
->
oformat
->
codec_tag
||
av_codec_get_id
(
oc
->
oformat
->
codec_tag
,
ico
dec
->
codec_tag
)
==
codec
->
codec_id
||
av_codec_get_tag
(
oc
->
oformat
->
codec_tag
,
ico
dec
->
codec_id
)
<=
0
)
codec
->
codec_tag
=
ico
dec
->
codec_tag
;
av_codec_get_id
(
oc
->
oformat
->
codec_tag
,
dec
_ctx
->
codec_tag
)
==
codec
->
codec_id
||
av_codec_get_tag
(
oc
->
oformat
->
codec_tag
,
dec
_ctx
->
codec_id
)
<=
0
)
codec
->
codec_tag
=
dec
_ctx
->
codec_tag
;
}
codec
->
bit_rate
=
ico
dec
->
bit_rate
;
codec
->
rc_max_rate
=
ico
dec
->
rc_max_rate
;
codec
->
rc_buffer_size
=
ico
dec
->
rc_buffer_size
;
codec
->
field_order
=
ico
dec
->
field_order
;
codec
->
bit_rate
=
dec
_ctx
->
bit_rate
;
codec
->
rc_max_rate
=
dec
_ctx
->
rc_max_rate
;
codec
->
rc_buffer_size
=
dec
_ctx
->
rc_buffer_size
;
codec
->
field_order
=
dec
_ctx
->
field_order
;
codec
->
extradata
=
av_mallocz
(
extra_size
);
if
(
!
codec
->
extradata
)
{
return
AVERROR
(
ENOMEM
);
}
memcpy
(
codec
->
extradata
,
ico
dec
->
extradata
,
ico
dec
->
extradata_size
);
codec
->
extradata_size
=
ico
dec
->
extradata_size
;
memcpy
(
codec
->
extradata
,
dec
_ctx
->
extradata
,
dec
_ctx
->
extradata_size
);
codec
->
extradata_size
=
dec
_ctx
->
extradata_size
;
if
(
!
copy_tb
)
{
codec
->
time_base
=
ico
dec
->
time_base
;
codec
->
time_base
.
num
*=
ico
dec
->
ticks_per_frame
;
codec
->
time_base
=
dec
_ctx
->
time_base
;
codec
->
time_base
.
num
*=
dec
_ctx
->
ticks_per_frame
;
av_reduce
(
&
codec
->
time_base
.
num
,
&
codec
->
time_base
.
den
,
codec
->
time_base
.
num
,
codec
->
time_base
.
den
,
INT_MAX
);
}
else
...
...
@@ -1741,29 +1741,29 @@ static int transcode_init(void)
av_log
(
NULL
,
AV_LOG_FATAL
,
"-acodec copy and -vol are incompatible (frames are not decoded)
\n
"
);
exit_program
(
1
);
}
codec
->
channel_layout
=
ico
dec
->
channel_layout
;
codec
->
sample_rate
=
ico
dec
->
sample_rate
;
codec
->
channels
=
ico
dec
->
channels
;
codec
->
frame_size
=
ico
dec
->
frame_size
;
codec
->
audio_service_type
=
ico
dec
->
audio_service_type
;
codec
->
block_align
=
ico
dec
->
block_align
;
codec
->
channel_layout
=
dec
_ctx
->
channel_layout
;
codec
->
sample_rate
=
dec
_ctx
->
sample_rate
;
codec
->
channels
=
dec
_ctx
->
channels
;
codec
->
frame_size
=
dec
_ctx
->
frame_size
;
codec
->
audio_service_type
=
dec
_ctx
->
audio_service_type
;
codec
->
block_align
=
dec
_ctx
->
block_align
;
break
;
case
AVMEDIA_TYPE_VIDEO
:
codec
->
pix_fmt
=
ico
dec
->
pix_fmt
;
codec
->
width
=
ico
dec
->
width
;
codec
->
height
=
ico
dec
->
height
;
codec
->
has_b_frames
=
ico
dec
->
has_b_frames
;
codec
->
pix_fmt
=
dec
_ctx
->
pix_fmt
;
codec
->
width
=
dec
_ctx
->
width
;
codec
->
height
=
dec
_ctx
->
height
;
codec
->
has_b_frames
=
dec
_ctx
->
has_b_frames
;
if
(
ost
->
frame_aspect_ratio
)
sar
=
av_d2q
(
ost
->
frame_aspect_ratio
*
codec
->
height
/
codec
->
width
,
255
);
else
if
(
ist
->
st
->
sample_aspect_ratio
.
num
)
sar
=
ist
->
st
->
sample_aspect_ratio
;
else
sar
=
ico
dec
->
sample_aspect_ratio
;
sar
=
dec
_ctx
->
sample_aspect_ratio
;
ost
->
st
->
sample_aspect_ratio
=
codec
->
sample_aspect_ratio
=
sar
;
break
;
case
AVMEDIA_TYPE_SUBTITLE
:
codec
->
width
=
ico
dec
->
width
;
codec
->
height
=
ico
dec
->
height
;
codec
->
width
=
dec
_ctx
->
width
;
codec
->
height
=
dec
_ctx
->
height
;
break
;
case
AVMEDIA_TYPE_DATA
:
case
AVMEDIA_TYPE_ATTACHMENT
:
...
...
@@ -1851,10 +1851,10 @@ static int transcode_init(void)
ost
->
filter
->
filter
->
inputs
[
0
]
->
sample_aspect_ratio
;
codec
->
pix_fmt
=
ost
->
filter
->
filter
->
inputs
[
0
]
->
format
;
if
(
ico
dec
&&
(
codec
->
width
!=
ico
dec
->
width
||
codec
->
height
!=
ico
dec
->
height
||
codec
->
pix_fmt
!=
ico
dec
->
pix_fmt
))
{
if
(
dec
_ctx
&&
(
codec
->
width
!=
dec
_ctx
->
width
||
codec
->
height
!=
dec
_ctx
->
height
||
codec
->
pix_fmt
!=
dec
_ctx
->
pix_fmt
))
{
codec
->
bits_per_raw_sample
=
0
;
}
...
...
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