On May 16, 2017, at 01:32, Timo Rothenpieler <t...@rothenpieler.org> wrote: > >> Am 16.05.2017 um 10:27 schrieb Wiki Wang: >> --- >> libavcodec/cuvid.c | 13 +++---------- >> 1 file changed, 3 insertions(+), 10 deletions(-) >> >> diff --git a/libavcodec/cuvid.c b/libavcodec/cuvid.c >> index 218be8495d..0b1710bd46 100644 >> --- a/libavcodec/cuvid.c >> +++ b/libavcodec/cuvid.c >> @@ -1029,20 +1029,13 @@ static void cuvid_flush(AVCodecContext *avctx) >> return; >> } >> >> - if (ctx->cudecoder) { >> - ctx->cvdl->cuvidDestroyDecoder(ctx->cudecoder); >> - ctx->cudecoder = NULL; >> - } >> + seq_pkt.flags = CUVID_PKT_ENDOFSTREAM; >> >> - if (ctx->cuparser) { >> - ctx->cvdl->cuvidDestroyVideoParser(ctx->cuparser); >> - ctx->cuparser = NULL; >> - } >> - >> - ret = CHECK_CU(ctx->cvdl->cuvidCreateVideoParser(&ctx->cuparser, >> &ctx->cuparseinfo)); >> + ret = CHECK_CU(ctx->cvdl->cuvidParseVideoData(ctx->cuparser, &seq_pkt)); >> if (ret < 0) >> goto error; >> >> + seq_pkt.flags = 0; >> seq_pkt.payload = ctx->cuparse_ext.raw_seqhdr_data; >> seq_pkt.payload_size = ctx->cuparse_ext.format.seqhdr_data_length; >> >> > > I'm not exactly sure what was the issue for this to be done this way, > but I remember there being some issue with just flushing the decoder, > hence the re-creation. > The issue is that when flushing for a media player, you need to drop all frames in the pipeline too. Inserting EOS means you still have n frames that will come out after the flush which breaks interactive seeking.
--phil _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel