Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
ffworker
Commits
bf0b74d1
Commit
bf0b74d1
authored
Nov 26, 2017
by
Julian Rother
Browse files
transcode: Refactured setup_output_stream using av_buffersink_get_* functions
parent
5e784411
Changes
1
Hide whitespace changes
Inline
Side-by-side
transcode.c
View file @
bf0b74d1
...
...
@@ -149,25 +149,24 @@ static void setup_output_stream(char *stream, AVStream *st, AVCodecContext *enc,
AVFilterContext
*
sink
)
{
int
err
;
AVFilterLink
*
l
;
AVDictionary
*
opts
;
l
=
sink
->
inputs
[
0
];
if
(
enc
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
/* Why not use av_buffersink_get_* here? */
enc
->
height
=
l
->
h
;
enc
->
width
=
l
->
w
;
enc
->
sample_aspect_ratio
=
l
->
sample_aspect_ratio
;
enc
->
pix_fmt
=
l
->
format
;
enc
->
height
=
av_buffersink_get_h
(
sink
);
enc
->
width
=
av_buffersink_get_w
(
sink
);
enc
->
sample_aspect_ratio
=
av_buffersink_get_sample_aspect_ratio
(
sink
);
enc
->
pix_fmt
=
av_buffersink_get_format
(
sink
);
enc
->
framerate
=
av_buffersink_get_frame_rate
(
sink
);
}
else
if
(
enc
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
enc
->
sample_rate
=
l
->
sample_rate
;
enc
->
channel_layout
=
l
->
channel_layout
;
enc
->
channels
=
l
->
channels
;
enc
->
sample_fmt
=
l
->
format
;
enc
->
sample_rate
=
av_buffersink_get_
sample_rate
(
sink
)
;
enc
->
channel_layout
=
av_buffersink_get_
channel_layout
(
sink
)
;
enc
->
channels
=
av_buffersink_get_
channels
(
sink
)
;
enc
->
sample_fmt
=
av_buffersink_get_format
(
sink
)
;
}
enc
->
time_base
=
l
->
time_base
;
enc
->
time_base
=
av_buffersink_get_
time_base
(
sink
)
;
opts
=
0
;
parse_dict
(
&
opts
,
jlookup
(
stream
,
"options"
));
if
((
err
=
avcodec_open2
(
enc
,
enc
->
codec
,
&
opts
))
<
0
)
...
...
Write
Preview
Supports
Markdown
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