Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
23f94423
Commit
23f94423
authored
Mar 17, 2005
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/stream_out/switcher.c: Fixed aspect ratio.
parent
05c786b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
modules/stream_out/switcher.c
modules/stream_out/switcher.c
+14
-9
No files found.
modules/stream_out/switcher.c
View file @
23f94423
...
@@ -131,7 +131,7 @@ struct sout_stream_sys_t
...
@@ -131,7 +131,7 @@ struct sout_stream_sys_t
sout_stream_t
*
p_out
;
sout_stream_t
*
p_out
;
int
i_gop
;
int
i_gop
;
int
i_qscale
;
int
i_qscale
;
AVRational
sample_aspect_ratio
;
int
i_aspect
;
sout_stream_id_t
*
pp_audio_ids
[
MAX_AUDIO
];
sout_stream_id_t
*
pp_audio_ids
[
MAX_AUDIO
];
/* Pictures */
/* Pictures */
...
@@ -233,22 +233,20 @@ static int Open( vlc_object_t *p_this )
...
@@ -233,22 +233,20 @@ static int Open( vlc_object_t *p_this )
if
(
psz_parser
)
if
(
psz_parser
)
{
{
*
psz_parser
++
=
'\0'
;
*
psz_parser
++
=
'\0'
;
p_sys
->
sample_aspect_ratio
.
num
=
atoi
(
val
.
psz_string
);
p_sys
->
i_aspect
=
atoi
(
val
.
psz_string
)
*
VOUT_ASPECT_FACTOR
p_sys
->
sample_aspect_ratio
.
den
=
atoi
(
psz_parser
);
/
atoi
(
psz_parser
);
}
}
else
else
{
{
msg_Warn
(
p_stream
,
"bad aspect ratio %s"
,
val
.
psz_string
);
msg_Warn
(
p_stream
,
"bad aspect ratio %s"
,
val
.
psz_string
);
p_sys
->
sample_aspect_ratio
.
num
=
4
;
p_sys
->
i_aspect
=
4
*
VOUT_ASPECT_FACTOR
/
3
;
p_sys
->
sample_aspect_ratio
.
den
=
3
;
}
}
free
(
val
.
psz_string
);
free
(
val
.
psz_string
);
}
}
else
else
{
{
p_sys
->
sample_aspect_ratio
.
num
=
4
;
p_sys
->
i_aspect
=
4
*
VOUT_ASPECT_FACTOR
/
3
;
p_sys
->
sample_aspect_ratio
.
den
=
3
;
}
}
var_Get
(
p_stream
,
SOUT_CFG_PREFIX
"port"
,
&
val
);
var_Get
(
p_stream
,
SOUT_CFG_PREFIX
"port"
,
&
val
);
...
@@ -695,6 +693,8 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
...
@@ -695,6 +693,8 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
{
{
/* Create a new encoder. */
/* Create a new encoder. */
int
i_ff_codec
=
CODEC_ID_MPEG2VIDEO
;
int
i_ff_codec
=
CODEC_ID_MPEG2VIDEO
;
int
i_aspect_num
,
i_aspect_den
;
if
(
i_ff_codec
==
0
)
if
(
i_ff_codec
==
0
)
{
{
msg_Err
(
p_stream
,
"cannot find encoder"
);
msg_Err
(
p_stream
,
"cannot find encoder"
);
...
@@ -732,11 +732,16 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
...
@@ -732,11 +732,16 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
id
->
ff_enc_c
->
width
=
p_sys
->
p_pictures
[
p_sys
->
i_cmd
-
1
].
format
.
i_width
;
id
->
ff_enc_c
->
width
=
p_sys
->
p_pictures
[
p_sys
->
i_cmd
-
1
].
format
.
i_width
;
id
->
ff_enc_c
->
height
=
p_sys
->
p_pictures
[
p_sys
->
i_cmd
-
1
].
format
.
i_height
;
id
->
ff_enc_c
->
height
=
p_sys
->
p_pictures
[
p_sys
->
i_cmd
-
1
].
format
.
i_height
;
av_reduce
(
&
i_aspect_num
,
&
i_aspect_den
,
p_sys
->
i_aspect
,
VOUT_ASPECT_FACTOR
,
1
<<
30
/* something big */
);
av_reduce
(
&
id
->
ff_enc_c
->
sample_aspect_ratio
.
num
,
&
id
->
ff_enc_c
->
sample_aspect_ratio
.
den
,
i_aspect_num
*
(
int64_t
)
id
->
ff_enc_c
->
height
,
i_aspect_den
*
(
int64_t
)
id
->
ff_enc_c
->
width
,
1
<<
30
);
id
->
ff_enc_c
->
frame_rate
=
25
;
/* FIXME */
id
->
ff_enc_c
->
frame_rate
=
25
;
/* FIXME */
id
->
ff_enc_c
->
frame_rate_base
=
1
;
id
->
ff_enc_c
->
frame_rate_base
=
1
;
memcpy
(
&
id
->
ff_enc_c
->
sample_aspect_ratio
,
&
p_sys
->
sample_aspect_ratio
,
sizeof
(
AVRational
)
);
id
->
ff_enc_c
->
gop_size
=
200
;
id
->
ff_enc_c
->
gop_size
=
200
;
id
->
ff_enc_c
->
max_b_frames
=
0
;
id
->
ff_enc_c
->
max_b_frames
=
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