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
ae2bb52c
Commit
ae2bb52c
authored
Jun 18, 2012
by
Ronald S. Bultje
Committed by
Mans Rullgard
Jun 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegts: remove unused/incomplete/broken seeking code
parent
ae46fbee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
96 deletions
+0
-96
mpegts.c
libavformat/mpegts.c
+0
-96
No files found.
libavformat/mpegts.c
View file @
ae2bb52c
...
...
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
//#define USE_SYNCPOINT_SEARCH
#include "libavutil/crc.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
...
...
@@ -2093,92 +2091,6 @@ static int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
return
timestamp
;
}
#ifdef USE_SYNCPOINT_SEARCH
static
int
read_seek2
(
AVFormatContext
*
s
,
int
stream_index
,
int64_t
min_ts
,
int64_t
target_ts
,
int64_t
max_ts
,
int
flags
)
{
int64_t
pos
;
int64_t
ts_ret
,
ts_adj
;
int
stream_index_gen_search
;
AVStream
*
st
;
AVParserState
*
backup
;
backup
=
ff_store_parser_state
(
s
);
// detect direction of seeking for search purposes
flags
|=
(
target_ts
-
min_ts
>
(
uint64_t
)(
max_ts
-
target_ts
))
?
AVSEEK_FLAG_BACKWARD
:
0
;
if
(
flags
&
AVSEEK_FLAG_BYTE
)
{
// use position directly, we will search starting from it
pos
=
target_ts
;
}
else
{
// search for some position with good timestamp match
if
(
stream_index
<
0
)
{
stream_index_gen_search
=
av_find_default_stream_index
(
s
);
if
(
stream_index_gen_search
<
0
)
{
ff_restore_parser_state
(
s
,
backup
);
return
-
1
;
}
st
=
s
->
streams
[
stream_index_gen_search
];
// timestamp for default must be expressed in AV_TIME_BASE units
ts_adj
=
av_rescale
(
target_ts
,
st
->
time_base
.
den
,
AV_TIME_BASE
*
(
int64_t
)
st
->
time_base
.
num
);
}
else
{
ts_adj
=
target_ts
;
stream_index_gen_search
=
stream_index
;
}
pos
=
ff_gen_search
(
s
,
stream_index_gen_search
,
ts_adj
,
0
,
INT64_MAX
,
-
1
,
AV_NOPTS_VALUE
,
AV_NOPTS_VALUE
,
flags
,
&
ts_ret
,
mpegts_get_pcr
);
if
(
pos
<
0
)
{
ff_restore_parser_state
(
s
,
backup
);
return
-
1
;
}
}
// search for actual matching keyframe/starting position for all streams
if
(
ff_gen_syncpoint_search
(
s
,
stream_index
,
pos
,
min_ts
,
target_ts
,
max_ts
,
flags
)
<
0
)
{
ff_restore_parser_state
(
s
,
backup
);
return
-
1
;
}
ff_free_parser_state
(
s
,
backup
);
return
0
;
}
static
int
read_seek
(
AVFormatContext
*
s
,
int
stream_index
,
int64_t
target_ts
,
int
flags
)
{
int
ret
;
if
(
flags
&
AVSEEK_FLAG_BACKWARD
)
{
flags
&=
~
AVSEEK_FLAG_BACKWARD
;
ret
=
read_seek2
(
s
,
stream_index
,
INT64_MIN
,
target_ts
,
target_ts
,
flags
);
if
(
ret
<
0
)
// for compatibility reasons, seek to the best-fitting timestamp
ret
=
read_seek2
(
s
,
stream_index
,
INT64_MIN
,
target_ts
,
INT64_MAX
,
flags
);
}
else
{
ret
=
read_seek2
(
s
,
stream_index
,
target_ts
,
target_ts
,
INT64_MAX
,
flags
);
if
(
ret
<
0
)
// for compatibility reasons, seek to the best-fitting timestamp
ret
=
read_seek2
(
s
,
stream_index
,
INT64_MIN
,
target_ts
,
INT64_MAX
,
flags
);
}
return
ret
;
}
#else
static
int
read_seek
(
AVFormatContext
*
s
,
int
stream_index
,
int64_t
target_ts
,
int
flags
){
MpegTSContext
*
ts
=
s
->
priv_data
;
uint8_t
buf
[
TS_PACKET_SIZE
];
...
...
@@ -2202,8 +2114,6 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t target_ts, in
return
0
;
}
#endif
/**************************************************************/
/* parsing functions - called from other demuxers such as RTP */
...
...
@@ -2268,9 +2178,6 @@ AVInputFormat ff_mpegts_demuxer = {
.
read_seek
=
read_seek
,
.
read_timestamp
=
mpegts_get_pcr
,
.
flags
=
AVFMT_SHOW_IDS
|
AVFMT_TS_DISCONT
,
#ifdef USE_SYNCPOINT_SEARCH
.
read_seek2
=
read_seek2
,
#endif
};
AVInputFormat
ff_mpegtsraw_demuxer
=
{
...
...
@@ -2283,8 +2190,5 @@ AVInputFormat ff_mpegtsraw_demuxer = {
.
read_seek
=
read_seek
,
.
read_timestamp
=
mpegts_get_pcr
,
.
flags
=
AVFMT_SHOW_IDS
|
AVFMT_TS_DISCONT
,
#ifdef USE_SYNCPOINT_SEARCH
.
read_seek2
=
read_seek2
,
#endif
.
priv_class
=
&
mpegtsraw_class
,
};
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