diff --git a/src/encoder_state-bitstream.c b/src/encoder_state-bitstream.c index b6f3c409..d43d1cec 100644 --- a/src/encoder_state-bitstream.c +++ b/src/encoder_state-bitstream.c @@ -329,8 +329,13 @@ static void encoder_state_write_bitstream_seq_parameter_set(bitstream_t* stream, WRITE_U(stream, 0, 1, "sps_sub_layer_ordering_info_present_flag"); //for each layer - WRITE_UE(stream, encoder->cfg->ref_frames + encoder->cfg->gop_len, "sps_max_dec_pic_buffering"); - WRITE_UE(stream, encoder->cfg->gop_len, "sps_num_reorder_pics"); + if (encoder->cfg->gop_lowdelay) { + WRITE_UE(stream, encoder->cfg->ref_frames, "sps_max_dec_pic_buffering"); + WRITE_UE(stream, 0, "sps_num_reorder_pics"); + } else { + WRITE_UE(stream, encoder->cfg->ref_frames + encoder->cfg->gop_len, "sps_max_dec_pic_buffering"); + WRITE_UE(stream, encoder->cfg->gop_len, "sps_num_reorder_pics"); + } WRITE_UE(stream, 0, "sps_max_latency_increase"); //end for