Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
39f24712
Commit
39f24712
authored
Nov 24, 2014
by
Rodger Combs
Committed by
Michael Niedermayer
Nov 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: fix accurate seeking with -copyts
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
54170a33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
ffmpeg.h
ffmpeg.h
+1
-0
ffmpeg_filter.c
ffmpeg_filter.c
+16
-2
No files found.
ffmpeg.h
View file @
39f24712
...
@@ -483,6 +483,7 @@ extern int do_deinterlace;
...
@@ -483,6 +483,7 @@ extern int do_deinterlace;
extern
int
do_hex_dump
;
extern
int
do_hex_dump
;
extern
int
do_pkt_dump
;
extern
int
do_pkt_dump
;
extern
int
copy_ts
;
extern
int
copy_ts
;
extern
int
start_at_zero
;
extern
int
copy_tb
;
extern
int
copy_tb
;
extern
int
debug_ts
;
extern
int
debug_ts
;
extern
int
exit_on_error
;
extern
int
exit_on_error
;
...
...
ffmpeg_filter.c
View file @
39f24712
...
@@ -637,6 +637,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
...
@@ -637,6 +637,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
AVBPrint
args
;
AVBPrint
args
;
char
name
[
255
];
char
name
[
255
];
int
ret
,
pad_idx
=
0
;
int
ret
,
pad_idx
=
0
;
int64_t
tsoffset
=
0
;
if
(
ist
->
dec_ctx
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
if
(
ist
->
dec_ctx
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Cannot connect video filter to audio input
\n
"
);
av_log
(
NULL
,
AV_LOG_ERROR
,
"Cannot connect video filter to audio input
\n
"
);
...
@@ -711,8 +712,14 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
...
@@ -711,8 +712,14 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
snprintf
(
name
,
sizeof
(
name
),
"trim for input stream %d:%d"
,
snprintf
(
name
,
sizeof
(
name
),
"trim for input stream %d:%d"
,
ist
->
file_index
,
ist
->
st
->
index
);
ist
->
file_index
,
ist
->
st
->
index
);
if
(
copy_ts
)
{
tsoffset
=
f
->
start_time
==
AV_NOPTS_VALUE
?
0
:
f
->
start_time
;
if
(
!
start_at_zero
&&
f
->
ctx
->
start_time
!=
AV_NOPTS_VALUE
)
tsoffset
+=
f
->
ctx
->
start_time
;
}
ret
=
insert_trim
(((
f
->
start_time
==
AV_NOPTS_VALUE
)
||
!
f
->
accurate_seek
)
?
ret
=
insert_trim
(((
f
->
start_time
==
AV_NOPTS_VALUE
)
||
!
f
->
accurate_seek
)
?
AV_NOPTS_VALUE
:
0
,
f
->
recording_time
,
&
last_filter
,
&
pad_idx
,
name
);
AV_NOPTS_VALUE
:
tsoffset
,
f
->
recording_time
,
&
last_filter
,
&
pad_idx
,
name
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
...
@@ -731,6 +738,7 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
...
@@ -731,6 +738,7 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
AVBPrint
args
;
AVBPrint
args
;
char
name
[
255
];
char
name
[
255
];
int
ret
,
pad_idx
=
0
;
int
ret
,
pad_idx
=
0
;
int64_t
tsoffset
=
0
;
if
(
ist
->
dec_ctx
->
codec_type
!=
AVMEDIA_TYPE_AUDIO
)
{
if
(
ist
->
dec_ctx
->
codec_type
!=
AVMEDIA_TYPE_AUDIO
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"Cannot connect audio filter to non audio input
\n
"
);
av_log
(
NULL
,
AV_LOG_ERROR
,
"Cannot connect audio filter to non audio input
\n
"
);
...
@@ -813,8 +821,14 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
...
@@ -813,8 +821,14 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
snprintf
(
name
,
sizeof
(
name
),
"trim for input stream %d:%d"
,
snprintf
(
name
,
sizeof
(
name
),
"trim for input stream %d:%d"
,
ist
->
file_index
,
ist
->
st
->
index
);
ist
->
file_index
,
ist
->
st
->
index
);
if
(
copy_ts
)
{
tsoffset
=
f
->
start_time
==
AV_NOPTS_VALUE
?
0
:
f
->
start_time
;
if
(
!
start_at_zero
&&
f
->
ctx
->
start_time
!=
AV_NOPTS_VALUE
)
tsoffset
+=
f
->
ctx
->
start_time
;
}
ret
=
insert_trim
(((
f
->
start_time
==
AV_NOPTS_VALUE
)
||
!
f
->
accurate_seek
)
?
ret
=
insert_trim
(((
f
->
start_time
==
AV_NOPTS_VALUE
)
||
!
f
->
accurate_seek
)
?
AV_NOPTS_VALUE
:
0
,
f
->
recording_time
,
&
last_filter
,
&
pad_idx
,
name
);
AV_NOPTS_VALUE
:
tsoffset
,
f
->
recording_time
,
&
last_filter
,
&
pad_idx
,
name
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
...
...
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