[FFmpeg-devel] [PATCH v5 4/5] lavc/libopenh264enc: prompt slice number changing inside libopenh264

Martin Storsjö martin at martin.st
Tue Apr 28 13:31:26 EEST 2020


On Tue, 28 Apr 2020, Linjie Fu wrote:

> Libopenh264enc would set the slice according to the number of cpu cores
> if uiSliceNum equals to 0 (auto) in SM_FIXEDSLCNUM_SLICE mode.
>
> Prompt a warning for user to catch this.
>
> Signed-off-by: Linjie Fu <linjie.fu at intel.com>
> ---
> libavcodec/libopenh264enc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
> index 93d3de2..6487ce5 100644
> --- a/libavcodec/libopenh264enc.c
> +++ b/libavcodec/libopenh264enc.c
> @@ -247,6 +247,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>     param.sSpatialLayers[0].sSliceCfg.uiSliceMode               = s->slice_mode;
>     param.sSpatialLayers[0].sSliceCfg.sSliceArgument.uiSliceNum = avctx->slices;
> #endif
> +    if (avctx->slices == 0 && s->slice_mode == SM_FIXEDSLCNUM_SLICE)
> +        av_log(avctx, AV_LOG_WARNING, "Slice count will be set automatically\n");
>
>     if (s->slice_mode == SM_SIZELIMITED_SLICE) {
>         if (s->max_nal_size) {
> -- 
> 2.7.4

This is ok with me.

// Martin



More information about the ffmpeg-devel mailing list