]> git.sesse.net Git - ffmpeg/commitdiff
lavc/libopenh264enc: prompt slice number changing inside libopenh264
authorLinjie Fu <linjie.fu@intel.com>
Wed, 29 Apr 2020 03:00:49 +0000 (11:00 +0800)
committerMartin Storsjö <martin@martin.st>
Wed, 29 Apr 2020 17:58:17 +0000 (20:58 +0300)
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@intel.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/libopenh264enc.c

index dc3bd536a8a7e1d8c16f9f5a1e0451d4bec4364b..29269f95136a382a1d4946e9b2811a0d7eccd0b6 100644 (file)
@@ -244,6 +244,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) {