Mercurial > mplayer.hg
comparison libmpdemux/demux_lavf.c @ 35603:ff4d8445f93e
Set AVSEEK_FLAG_BACKWARD also when seeking to the start of a file.
Fixes -loop 0 with some files where libavformat seems to set
a slightly off broken start_time value (probably, I have
not yet analyzed in detail).
author | reimar |
---|---|
date | Tue, 18 Dec 2012 19:33:29 +0000 |
parents | a51fc69ae1b3 |
children | 5be881b963ec |
comparison
equal
deleted
inserted
replaced
35602:80521cdbc272 | 35603:ff4d8445f93e |
---|---|
682 mp_msg(MSGT_DEMUX,MSGL_DBG2,"demux_seek_lavf(%p, %f, %f, %d)\n", demuxer, rel_seek_secs, audio_delay, flags); | 682 mp_msg(MSGT_DEMUX,MSGL_DBG2,"demux_seek_lavf(%p, %f, %f, %d)\n", demuxer, rel_seek_secs, audio_delay, flags); |
683 | 683 |
684 if (flags & SEEK_ABSOLUTE) { | 684 if (flags & SEEK_ABSOLUTE) { |
685 priv->last_pts = priv->avfc->start_time != AV_NOPTS_VALUE ? | 685 priv->last_pts = priv->avfc->start_time != AV_NOPTS_VALUE ? |
686 priv->avfc->start_time : 0; | 686 priv->avfc->start_time : 0; |
687 } else { | 687 } |
688 if (rel_seek_secs < 0) avsflags = AVSEEK_FLAG_BACKWARD; | 688 if (rel_seek_secs <= 0) avsflags = AVSEEK_FLAG_BACKWARD; |
689 } | |
690 if (flags & SEEK_FACTOR) { | 689 if (flags & SEEK_FACTOR) { |
691 if (priv->avfc->duration == 0 || priv->avfc->duration == AV_NOPTS_VALUE) | 690 if (priv->avfc->duration == 0 || priv->avfc->duration == AV_NOPTS_VALUE) |
692 return; | 691 return; |
693 priv->last_pts += rel_seek_secs * priv->avfc->duration; | 692 priv->last_pts += rel_seek_secs * priv->avfc->duration; |
694 } else { | 693 } else { |