Skip to content

Commit

Permalink
H264: reorder buffer size
Browse files Browse the repository at this point in the history
No need to change it when threads are less than the buffer.

Change to max reorder buffer size isn't always appropriate (e.g., source with buffer size of 1).
  • Loading branch information
Asd-g committed Mar 23, 2024
1 parent 256437e commit 3bbe176
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ int open_decoder
&& thread_count != 1
&& av_cpu_count() > 1 )
c->thread_count = 2;
if( codec->id == AV_CODEC_ID_H264
&& c->has_b_frames < 8 )
c->has_b_frames = 8;
if (codec->id == AV_CODEC_ID_H264
&& (!thread_count) ? av_cpu_count() : thread_count > c->has_b_frames)
c->has_b_frames = FFMIN((c->has_b_frames + 1) << 2, 16);
if( codec->wrapper_name
&& !strcmp( codec->wrapper_name, "cuvid" ) )
c->has_b_frames = 16; /* the maximum decoder latency for AVC and HEVC frame */
Expand Down

0 comments on commit 3bbe176

Please sign in to comment.