demux_lavf: implement DEMUXER_CTRL_RESYNC

This makes -chapter work with stream_dvd by telling ffmpeg to flush its
internal buffers after a stream_dvd seek.
This commit is contained in:
Rudolf Polzer 2013-01-07 17:39:55 +01:00
parent 413b2e3b0f
commit 5a412bfa09
1 changed files with 15 additions and 0 deletions

View File

@ -1066,6 +1066,21 @@ redo:
priv->cur_program = prog->progid = program->id;
return DEMUXER_CTRL_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.
*/
av_seek_frame(priv->avfc, 0, avio_tell(priv->avfc->pb),
AVSEEK_FLAG_BYTE);
return DEMUXER_CTRL_OK;
default:
return DEMUXER_CTRL_NOTIMPL;
}