summaryrefslogtreecommitdiff
authorBang Peng <bang.peng@amlogic.com>2017-03-25 06:20:56 (GMT)
committer Zhi Zhou <zhi.zhou@amlogic.com>2017-03-29 05:47:34 (GMT)
commit1e19ae02fd5690c11482e9b0ea08f45635c0b4de (patch)
tree99372ef81fe1c52f865f975648763a0c02874e86
parent6b09eb44081de9d57a24131a5399227ebbb44805 (diff)
downloadffmpeg-1e19ae02fd5690c11482e9b0ea08f45635c0b4de.zip
ffmpeg-1e19ae02fd5690c11482e9b0ea08f45635c0b4de.tar.gz
ffmpeg-1e19ae02fd5690c11482e9b0ea08f45635c0b4de.tar.bz2
PD#141319:fixed ts seek failed on.
ff_gen_syncpoint_search get the keyframe and sometimes failed. and spend longtime on seek. Change-Id: I0f56e06364cf32882f64fdc8c35a14d3d768851b
Diffstat
-rw-r--r--[-rwxr-xr-x]libavformat/mpegts.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index a9c5ca0..7c7d64c 100755..100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2467,7 +2467,7 @@ static int read_seek2(AVFormatContext *s,
// detect direction of seeking for search purposes
flags |= (target_ts - min_ts > (uint64_t)(max_ts - target_ts)) ?
AVSEEK_FLAG_BACKWARD : 0;
-
+ av_log(NULL, AV_LOG_INFO, "read_seek::target_ts %lld , max_ts %lld ,flags %d streameindex %d\n", target_ts,max_ts,flags,stream_index);
if (flags & AVSEEK_FLAG_BYTE) {
// use position directly, we will search starting from it
pos = target_ts;
@@ -2475,6 +2475,7 @@ static int read_seek2(AVFormatContext *s,
// search for some position with good timestamp match
if (stream_index < 0) {
stream_index_gen_search = av_find_default_stream_index(s);
+ av_log(NULL, AV_LOG_INFO, "read_seek::stream_index_gen_search %d\n", stream_index_gen_search);
if (stream_index_gen_search < 0) {
ff_restore_parser_state(s, backup);
return -1;
@@ -2494,12 +2495,13 @@ static int read_seek2(AVFormatContext *s,
AV_NOPTS_VALUE,
AV_NOPTS_VALUE,
flags, &ts_ret, mpegts_get_dts);
+ av_log(NULL, AV_LOG_INFO, "read_seek::stream_index_gen_search %d ts_adj %lld pos %lld \n", stream_index_gen_search,ts_adj,pos);
if (pos < 0) {
ff_restore_parser_state(s, backup);
return -1;
}
}
-
+/* ==> modify by amlogic this is a slow when seek
// 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,
@@ -2507,7 +2509,8 @@ static int read_seek2(AVFormatContext *s,
ff_restore_parser_state(s, backup);
return -1;
}
-
+*/
+ avio_seek(s->pb, pos, SEEK_SET);
ff_free_parser_state(s, backup);
return 0;
}