ffmpeg: for h264 we need has_b_frames from the decoder
Other solutions welcome Fixes Ticket3711 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
378ad22492
commit
5ded0b390b
13
ffmpeg.c
13
ffmpeg.c
@ -1886,11 +1886,16 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
|
||||
|
||||
// The following line may be required in some cases where there is no parser
|
||||
// or the parser does not has_b_frames correctly
|
||||
// ist->st->codec->has_b_frames = ist->dec_ctx->has_b_frames;
|
||||
if (ist->st->codec->has_b_frames < ist->dec_ctx->has_b_frames) {
|
||||
av_log_ask_for_sample(ist->dec_ctx, "has_b_frames is larger in decoder than demuxer %d > %d ",
|
||||
ist->dec_ctx->has_b_frames, ist->st->codec->has_b_frames
|
||||
);
|
||||
if (ist->dec_ctx->codec_id == AV_CODEC_ID_H264) {
|
||||
ist->st->codec->has_b_frames = ist->dec_ctx->has_b_frames;
|
||||
} else
|
||||
av_log_ask_for_sample(
|
||||
ist->dec_ctx,
|
||||
"has_b_frames is larger in decoder than demuxer %d > %d ",
|
||||
ist->dec_ctx->has_b_frames,
|
||||
ist->st->codec->has_b_frames
|
||||
);
|
||||
}
|
||||
|
||||
if (*got_output || ret<0 || pkt->size)
|
||||
|
Loading…
Reference in New Issue
Block a user