[FFmpeg-devel] [PATCH 1/2] ffplay: disallow seeking before the start of the file

Michael Niedermayer michaelni at gmx.at
Fri Nov 23 01:26:14 CET 2012


On Fri, Nov 23, 2012 at 12:28:11AM +0100, Marton Balint wrote:
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  ffplay.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/ffplay.c b/ffplay.c
> index 5ba5164..c61e4e3 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -2984,6 +2984,8 @@ static void event_loop(VideoState *cur_stream)
>                      } else {
>                          pos = get_master_clock(cur_stream);
>                          pos += incr;
> +                        if (pos < 0)
> +                            pos = 0;
>                          stream_seek(cur_stream, (int64_t)(pos * AV_TIME_BASE), (int64_t)(incr * AV_TIME_BASE), 0);

what if the file has timestamps staring before 0 ?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121123/d60a9c9f/attachment.asc>


More information about the ffmpeg-devel mailing list