Author: spyfeng Date: Sun Jun 28 05:37:40 2009 New Revision: 4540 Log: check the returned pts value with given range. Modified: seek_api/mpeg.c Modified: seek_api/mpeg.c ============================================================================== --- seek_api/mpeg.c Sun Jun 28 04:13:13 2009 (r4539) +++ seek_api/mpeg.c Sun Jun 28 05:37:40 2009 (r4540) @@ -706,7 +706,12 @@ static int mpegps_read_seek(struct AVFor } success: av_update_cur_dts(s, st, pts); - return 0; + if (pts <= max_ts && pts >= min_ts) + return 0; + else { + av_log(s, AV_LOG_ERROR,"The target pts = %"PRId64" is out of range. min_ts = %"PRId64", max_ts = %"PRId64"\n", pts, min_ts, max_ts); + return -1; + } } AVInputFormat mpegps_demuxer = {
spyfeng wrote:
Author: spyfeng Date: Sun Jun 28 05:37:40 2009 New Revision: 4540
Log: check the returned pts value with given range.
Modified: seek_api/mpeg.c
Modified: seek_api/mpeg.c ============================================================================== --- seek_api/mpeg.c Sun Jun 28 04:13:13 2009 (r4539) +++ seek_api/mpeg.c Sun Jun 28 05:37:40 2009 (r4540) @@ -706,7 +706,12 @@ static int mpegps_read_seek(struct AVFor } success: av_update_cur_dts(s, st, pts); - return 0; + if (pts <= max_ts && pts >= min_ts) + return 0; + else { + av_log(s, AV_LOG_ERROR,"The target pts = %"PRId64" is out of range. min_ts = %"PRId64", max_ts = %"PRId64"\n", pts, min_ts, max_ts); + return -1; + } }
I don't think av_update_cur_dts must be done if seek has failed. -- Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA FFmpeg maintainer http://www.ffmpeg.org
hi 2009/6/29 Baptiste Coudurier <baptiste.coudurier@gmail.com>
spyfeng wrote:
Author: spyfeng Date: Sun Jun 28 05:37:40 2009 New Revision: 4540
Log: check the returned pts value with given range.
Modified: seek_api/mpeg.c
Modified: seek_api/mpeg.c
==============================================================================
--- seek_api/mpeg.c Sun Jun 28 04:13:13 2009 (r4539) +++ seek_api/mpeg.c Sun Jun 28 05:37:40 2009 (r4540) @@ -706,7 +706,12 @@ static int mpegps_read_seek(struct AVFor } success: av_update_cur_dts(s, st, pts); - return 0; + if (pts <= max_ts && pts >= min_ts) + return 0; + else { + av_log(s, AV_LOG_ERROR,"The target pts = %"PRId64" is out of range. min_ts = %"PRId64", max_ts = %"PRId64"\n", pts, min_ts, max_ts); + return -1; + } }
I don't think av_update_cur_dts must be done if seek has failed.
fixed -- Best wishes~
participants (3)
-
Baptiste Coudurier -
spyfeng -
zhentan feng