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
11fdb7e1
Commit
11fdb7e1
authored
Sep 27, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avconv: factorize common code in transcode_init()
parent
282847ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
avconv.c
avconv.c
+2
-6
No files found.
avconv.c
View file @
11fdb7e1
...
@@ -2059,6 +2059,8 @@ static int transcode_init(OutputFile *output_files,
...
@@ -2059,6 +2059,8 @@ static int transcode_init(OutputFile *output_files,
}
else
{
}
else
{
if
(
!
ost
->
enc
)
if
(
!
ost
->
enc
)
ost
->
enc
=
avcodec_find_encoder
(
ost
->
st
->
codec
->
codec_id
);
ost
->
enc
=
avcodec_find_encoder
(
ost
->
st
->
codec
->
codec_id
);
ist
->
decoding_needed
=
1
;
ost
->
encoding_needed
=
1
;
switch
(
codec
->
codec_type
)
{
switch
(
codec
->
codec_type
)
{
case
AVMEDIA_TYPE_AUDIO
:
case
AVMEDIA_TYPE_AUDIO
:
ost
->
fifo
=
av_fifo_alloc
(
1024
);
ost
->
fifo
=
av_fifo_alloc
(
1024
);
...
@@ -2083,8 +2085,6 @@ static int transcode_init(OutputFile *output_files,
...
@@ -2083,8 +2085,6 @@ static int transcode_init(OutputFile *output_files,
codec
->
channel_layout
=
0
;
codec
->
channel_layout
=
0
;
ost
->
audio_resample
=
codec
->
sample_rate
!=
icodec
->
sample_rate
||
audio_sync_method
>
1
;
ost
->
audio_resample
=
codec
->
sample_rate
!=
icodec
->
sample_rate
||
audio_sync_method
>
1
;
icodec
->
request_channels
=
codec
->
channels
;
icodec
->
request_channels
=
codec
->
channels
;
ist
->
decoding_needed
=
1
;
ost
->
encoding_needed
=
1
;
ost
->
resample_sample_fmt
=
icodec
->
sample_fmt
;
ost
->
resample_sample_fmt
=
icodec
->
sample_fmt
;
ost
->
resample_sample_rate
=
icodec
->
sample_rate
;
ost
->
resample_sample_rate
=
icodec
->
sample_rate
;
ost
->
resample_channels
=
icodec
->
channels
;
ost
->
resample_channels
=
icodec
->
channels
;
...
@@ -2134,8 +2134,6 @@ static int transcode_init(OutputFile *output_files,
...
@@ -2134,8 +2134,6 @@ static int transcode_init(OutputFile *output_files,
ost
->
resample_height
=
icodec
->
height
;
ost
->
resample_height
=
icodec
->
height
;
ost
->
resample_width
=
icodec
->
width
;
ost
->
resample_width
=
icodec
->
width
;
ost
->
resample_pix_fmt
=
icodec
->
pix_fmt
;
ost
->
resample_pix_fmt
=
icodec
->
pix_fmt
;
ost
->
encoding_needed
=
1
;
ist
->
decoding_needed
=
1
;
if
(
!
ost
->
frame_rate
.
num
)
if
(
!
ost
->
frame_rate
.
num
)
ost
->
frame_rate
=
ist
->
st
->
r_frame_rate
.
num
?
ist
->
st
->
r_frame_rate
:
(
AVRational
){
25
,
1
};
ost
->
frame_rate
=
ist
->
st
->
r_frame_rate
.
num
?
ist
->
st
->
r_frame_rate
:
(
AVRational
){
25
,
1
};
...
@@ -2153,8 +2151,6 @@ static int transcode_init(OutputFile *output_files,
...
@@ -2153,8 +2151,6 @@ static int transcode_init(OutputFile *output_files,
#endif
#endif
break
;
break
;
case
AVMEDIA_TYPE_SUBTITLE
:
case
AVMEDIA_TYPE_SUBTITLE
:
ost
->
encoding_needed
=
1
;
ist
->
decoding_needed
=
1
;
break
;
break
;
default
:
default
:
abort
();
abort
();
...
...
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