summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_lavf.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-10-06 04:28:59 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-10-06 04:48:00 +0300
commit7fd3eb0f74e7986e07556077ed654bad7869add8 (patch)
tree8d293145c0ef2bc31ca63f79dccb4e3b57294c82 /libmpdemux/demux_lavf.c
parentef438b3a6b5bc714d521dd46d3ccb798ecd31eed (diff)
parentcbbc886820e981f488660708678f528e1d243121 (diff)
downloadmpv-7fd3eb0f74e7986e07556077ed654bad7869add8.tar.bz2
mpv-7fd3eb0f74e7986e07556077ed654bad7869add8.tar.xz
Merge svn changes up to r29752
As part of merging subtitle-in-terminal changes make update_subtitles() only clear existing subtitles if called with the reset argument, and not try to set new ones. Later calls should set the needed new subtitles, and this change avoids some problems with trying to set subtitles when mp_property_sub() in command.c gets called from initialization code before full initialization.
Diffstat (limited to 'libmpdemux/demux_lavf.c')
-rw-r--r--libmpdemux/demux_lavf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 31eabc67a1..f69f2715ff 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -623,7 +623,10 @@ static void demux_seek_lavf(demuxer_t *demuxer, float rel_seek_secs, float audio
} else {
priv->last_pts += rel_seek_secs * AV_TIME_BASE;
}
- av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags);
+ if (av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags) < 0) {
+ avsflags ^= AVSEEK_FLAG_BACKWARD;
+ av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags);
+ }
}
static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg)