[FFmpeg-cvslog] mpc: clip seeking timestamp in valid range
Michael Niedermayer
git at videolan.org
Mon Aug 27 05:25:02 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Aug 27 04:51:27 2012 +0200| [a503afb11f80facc0fa12b733c5c58989950b108] | committer: Michael Niedermayer
mpc: clip seeking timestamp in valid range
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a503afb11f80facc0fa12b733c5c58989950b108
---
libavformat/mpc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/mpc.c b/libavformat/mpc.c
index 4ebc6ae..2ca8dfa 100644
--- a/libavformat/mpc.c
+++ b/libavformat/mpc.c
@@ -194,7 +194,7 @@ static int mpc_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
MPCContext *c = s->priv_data;
AVPacket pkt1, *pkt = &pkt1;
int ret;
- int index = av_index_search_timestamp(st, timestamp - DELAY_FRAMES, flags);
+ int index = av_index_search_timestamp(st, FFMAX(timestamp - DELAY_FRAMES, 0), flags);
uint32_t lastframe;
/* if found, seek there */
More information about the ffmpeg-cvslog
mailing list