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
209cff2d
Commit
209cff2d
authored
Mar 08, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_waveform: make sure that x/y for text position is positive
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
8ca2c872
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
vf_waveform.c
libavfilter/vf_waveform.c
+18
-8
No files found.
libavfilter/vf_waveform.c
View file @
209cff2d
...
...
@@ -1369,9 +1369,12 @@ static void graticule_green_row(WaveformContext *s, AVFrame *out)
}
for
(
l
=
0
;
l
<
FF_ARRAY_ELEMS
(
lines
[
0
])
&&
(
s
->
flags
&
1
);
l
++
)
{
const
int
x
=
offset
+
(
s
->
mirror
?
255
-
lines
[
c
][
l
]
:
lines
[
c
][
l
])
-
10
;
int
x
=
offset
+
(
s
->
mirror
?
255
-
lines
[
c
][
l
]
:
lines
[
c
][
l
])
-
10
;
char
text
[
16
];
if
(
x
<
0
)
x
=
4
;
snprintf
(
text
,
sizeof
(
text
),
"%d"
,
lines
[
c
][
l
]);
draw_vtext
(
out
,
x
,
2
,
o1
,
o2
,
text
,
green_yuva_color
);
}
...
...
@@ -1403,9 +1406,12 @@ static void graticule16_green_row(WaveformContext *s, AVFrame *out)
}
for
(
l
=
0
;
l
<
FF_ARRAY_ELEMS
(
lines
[
0
])
&&
(
s
->
flags
&
1
);
l
++
)
{
const
int
x
=
offset
+
(
s
->
mirror
?
s
->
size
-
1
-
lines
[
c
][
l
]
*
mult
:
lines
[
c
][
l
]
*
mult
)
-
10
;
int
x
=
offset
+
(
s
->
mirror
?
s
->
size
-
1
-
lines
[
c
][
l
]
*
mult
:
lines
[
c
][
l
]
*
mult
)
-
10
;
char
text
[
16
];
if
(
x
<
0
)
x
=
4
;
snprintf
(
text
,
sizeof
(
text
),
"%d"
,
lines
[
c
][
l
]
*
mult
);
draw_vtext16
(
out
,
x
,
2
,
mult
,
o1
,
o2
,
text
,
green_yuva_color
);
}
...
...
@@ -1436,12 +1442,14 @@ static void graticule_green_column(WaveformContext *s, AVFrame *out)
}
for
(
l
=
0
;
l
<
FF_ARRAY_ELEMS
(
lines
[
0
])
&&
(
s
->
flags
&
1
);
l
++
)
{
const
int
y
=
offset
+
(
s
->
mirror
?
255
-
lines
[
c
][
l
]
:
lines
[
c
][
l
])
-
10
;
int
y
=
offset
+
(
s
->
mirror
?
255
-
lines
[
c
][
l
]
:
lines
[
c
][
l
])
-
10
;
char
text
[
16
];
if
(
y
<
0
)
y
=
4
;
snprintf
(
text
,
sizeof
(
text
),
"%d"
,
lines
[
c
][
l
]);
draw_htext
(
out
,
2
,
y
,
o1
,
o2
,
text
,
green_yuva_color
);
draw_htext
(
out
,
2
,
y
,
o1
,
o2
,
text
,
green_yuva_color
);
}
offset
+=
256
*
s
->
display
;
...
...
@@ -1471,12 +1479,14 @@ static void graticule16_green_column(WaveformContext *s, AVFrame *out)
}
for
(
l
=
0
;
l
<
FF_ARRAY_ELEMS
(
lines
[
0
])
&&
(
s
->
flags
&
1
);
l
++
)
{
const
int
y
=
offset
+
(
s
->
mirror
?
s
->
size
-
1
-
lines
[
c
][
l
]
*
mult
:
lines
[
c
][
l
]
*
mult
)
-
10
;
int
y
=
offset
+
(
s
->
mirror
?
s
->
size
-
1
-
lines
[
c
][
l
]
*
mult
:
lines
[
c
][
l
]
*
mult
)
-
10
;
char
text
[
16
];
if
(
y
<
0
)
y
=
4
;
snprintf
(
text
,
sizeof
(
text
),
"%d"
,
lines
[
c
][
l
]
*
mult
);
draw_htext16
(
out
,
2
,
y
,
mult
,
o1
,
o2
,
text
,
green_yuva_color
);
draw_htext16
(
out
,
2
,
y
,
mult
,
o1
,
o2
,
text
,
green_yuva_color
);
}
offset
+=
s
->
size
*
s
->
display
;
...
...
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