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
1301aa55
Commit
1301aa55
authored
Mar 25, 2015
by
Himangi Saraogi
Committed by
Michael Niedermayer
Mar 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_telecine: Fix AV desync by using the first input timestamp
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
21adb996
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
vf_telecine.c
libavfilter/vf_telecine.c
+8
-1
No files found.
libavfilter/vf_telecine.c
View file @
1301aa55
...
...
@@ -38,6 +38,7 @@ typedef struct {
int
first_field
;
char
*
pattern
;
unsigned
int
pattern_pos
;
int64_t
start_time
;
AVRational
pts
;
double
ts_unit
;
...
...
@@ -89,6 +90,8 @@ static av_cold int init(AVFilterContext *ctx)
s
->
pts
.
den
+=
*
p
-
'0'
;
}
s
->
start_time
=
AV_NOPTS_VALUE
;
s
->
out_cnt
=
(
max
+
1
)
/
2
;
av_log
(
ctx
,
AV_LOG_INFO
,
"Telecine pattern %s yields up to %d frames per frame, pts advance factor: %d/%d
\n
"
,
s
->
pattern
,
s
->
out_cnt
,
s
->
pts
.
num
,
s
->
pts
.
den
);
...
...
@@ -173,6 +176,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
TelecineContext
*
s
=
ctx
->
priv
;
int
i
,
len
,
ret
=
0
,
nout
=
0
;
if
(
s
->
start_time
==
AV_NOPTS_VALUE
)
s
->
start_time
=
inpicref
->
pts
;
len
=
s
->
pattern
[
s
->
pattern_pos
]
-
'0'
;
s
->
pattern_pos
++
;
...
...
@@ -235,7 +241,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
return
AVERROR
(
ENOMEM
);
}
frame
->
pts
=
outlink
->
frame_count
*
s
->
ts_unit
;
frame
->
pts
=
((
s
->
start_time
==
AV_NOPTS_VALUE
)
?
0
:
s
->
start_time
)
+
outlink
->
frame_count
*
s
->
ts_unit
;
ret
=
ff_filter_frame
(
outlink
,
frame
);
}
av_frame_free
(
&
inpicref
);
...
...
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