diff options
author | wm4 <wm4@nowhere> | 2015-03-24 15:39:51 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-03-24 15:39:51 +0100 |
commit | 170a2e056826c9fdabbf3acdf165a17469560e7d (patch) | |
tree | 0104de243d390dc33e033291f2886b130241c89c | |
parent | 8c8d6e68780fdf040526c5c6c3d9e6cc975f1e9d (diff) | |
download | mpv-170a2e056826c9fdabbf3acdf165a17469560e7d.tar.bz2 mpv-170a2e056826c9fdabbf3acdf165a17469560e7d.tar.xz |
demux_lavf: print seek failures in verbose mode
Don't bother with making these visible by default, because often they
are bogus and/or useless.
-rw-r--r-- | demux/demux_lavf.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index ba7c96cc6f..8d105eb421 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -904,29 +904,35 @@ static void demux_seek_lavf(demuxer_t *demuxer, double rel_seek_secs, int flags) priv->last_pts += rel_seek_secs * AV_TIME_BASE; } + int r; if (!priv->avfc->iformat->read_seek2) { // Normal seeking. - int r = av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags); + r = av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags); if (r < 0 && (avsflags & AVSEEK_FLAG_BACKWARD)) { // When seeking before the beginning of the file, and seeking fails, // try again without the backwards flag to make it seek to the // beginning. avsflags &= ~AVSEEK_FLAG_BACKWARD; - av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags); + r = av_seek_frame(priv->avfc, -1, priv->last_pts, avsflags); } } else { // av_seek_frame() won't work. Use "new" seeking API. We don't use this // API by default, because there are some major issues. // Set max_ts==ts, so that demuxing starts from an earlier position in // the worst case. - int r = avformat_seek_file(priv->avfc, -1, INT64_MIN, - priv->last_pts, priv->last_pts, avsflags); + r = avformat_seek_file(priv->avfc, -1, INT64_MIN, + priv->last_pts, priv->last_pts, avsflags); // Similar issue as in the normal seeking codepath. if (r < 0) { - avformat_seek_file(priv->avfc, -1, INT64_MIN, - priv->last_pts, INT64_MAX, avsflags); + r = avformat_seek_file(priv->avfc, -1, INT64_MIN, + priv->last_pts, INT64_MAX, avsflags); } } + if (r < 0) { + char buf[180]; + av_strerror(r, buf, sizeof(buf)); + MP_VERBOSE(demuxer, "Seek failed (%s)\n", buf); + } } static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg) |