summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-04-16 17:40:00 +0200
committerJan Ekström <jeebjp@gmail.com>2018-04-16 22:47:33 +0300
commit028e51d8afcaba20d6b0743fbe39795cf2e0015d (patch)
treeda2195e6ec47f6ef3263b9b40bc5f9e862236d0c
parent3d88e6f4c2da4c64e0daf658da2c97dff8c3963f (diff)
downloadmpv-028e51d8afcaba20d6b0743fbe39795cf2e0015d.tar.bz2
mpv-028e51d8afcaba20d6b0743fbe39795cf2e0015d.tar.xz
demux_lavf: use new libavformat semantics for stream resync
I changed avio_flush() and introduced avformat_flush() exactly for this reason. Used with DVD/BD only (on seeks and when setting the "angle" property). Seems to work, but wasn't tested too thoroughly (I don't care about optical discs, I only want this ugly stuff gone that might even violate the API/ABI).
-rw-r--r--demux/demux_lavf.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 320df49df5..a8f631d142 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -1148,24 +1148,9 @@ redo:
return CONTROL_OK;
}
case DEMUXER_CTRL_RESYNC:
- /* NOTE:
- *
- * We actually want to call ff_read_frame_flush() here, but it is
- * internal.
- *
- * This function call seems to do the same for now.
- *
- * Once ff_read_frame_flush() is exported in some way, change this to
- * call the new API instead of relying on av_seek_frame() to do this
- * for us.
- */
- // avio_flush() is designed for write-only streams, and does the wrong
- // thing when reading. Flush it manually instead.
stream_drop_buffers(priv->stream);
- priv->avfc->pb->buf_ptr = priv->avfc->pb->buf_end = priv->avfc->pb->buffer;
- priv->avfc->pb->pos = stream_tell(priv->stream);
- av_seek_frame(priv->avfc, 0, stream_tell(priv->stream),
- AVSEEK_FLAG_BYTE);
+ avio_flush(priv->avfc->pb);
+ avformat_flush(priv->avfc);
return CONTROL_OK;
case DEMUXER_CTRL_REPLACE_STREAM:
if (priv->own_stream)