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
d210e974
Commit
d210e974
authored
Mar 03, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rv34: fix aspect ratio
Fixes part of Ticket1550 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6c6dc8cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
rv34.c
libavcodec/rv34.c
+13
-0
No files found.
libavcodec/rv34.c
View file @
d210e974
...
...
@@ -1589,6 +1589,16 @@ static int finish_frame(AVCodecContext *avctx, AVFrame *pict)
return
got_picture
;
}
static
AVRational
update_sar
(
int
old_w
,
int
old_h
,
AVRational
sar
,
int
new_w
,
int
new_h
)
{
// attempt to keep aspect during typical resolution switches
if
(
!
sar
.
num
)
sar
=
(
AVRational
){
1
,
1
};
sar
=
av_mul_q
(
sar
,
(
AVRational
){
new_h
*
old_w
,
new_w
*
old_h
});
return
sar
;
}
int
ff_rv34_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
got_picture_ptr
,
AVPacket
*
avpkt
)
...
...
@@ -1664,6 +1674,9 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
if
(
av_image_check_size
(
si
.
width
,
si
.
height
,
0
,
s
->
avctx
))
return
AVERROR_INVALIDDATA
;
s
->
avctx
->
sample_aspect_ratio
=
update_sar
(
s
->
width
,
s
->
height
,
s
->
avctx
->
sample_aspect_ratio
,
si
.
width
,
si
.
height
);
s
->
width
=
si
.
width
;
s
->
height
=
si
.
height
;
avcodec_set_dimensions
(
s
->
avctx
,
s
->
width
,
s
->
height
);
...
...
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