diff mbox

[FFmpeg-devel] libvpxenc: Don't spam level errors for VP8 encodes

Message ID 1481573533-23361-1-git-send-email-alex.converse@gmail.com
State Accepted
Commit bf15981b126256c403a1529df5172dce761295d4
Headers show

Commit Message

Alex Converse Dec. 12, 2016, 8:12 p.m. UTC
Fixes "Failed to set VP9E_GET_LEVEL codec control: Codec does not
implement requested capability" log messages on VP8 encodes.
---
 libavcodec/libvpxenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

James Zern Dec. 12, 2016, 10:41 p.m. UTC | #1
On Mon, Dec 12, 2016 at 12:12 PM, Alex Converse <alex.converse@gmail.com> wrote:
> Fixes "Failed to set VP9E_GET_LEVEL codec control: Codec does not
> implement requested capability" log messages on VP8 encodes.
> ---
>  libavcodec/libvpxenc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>

lgtm
Alex Converse Dec. 13, 2016, 6:47 p.m. UTC | #2
On Mon, Dec 12, 2016 at 2:41 PM, James Zern <jzern@google.com> wrote:
> On Mon, Dec 12, 2016 at 12:12 PM, Alex Converse <alex.converse@gmail.com> wrote:
>> Fixes "Failed to set VP9E_GET_LEVEL codec control: Codec does not
>> implement requested capability" log messages on VP8 encodes.
>> ---
>>  libavcodec/libvpxenc.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> lgtm

Pushed
diff mbox

Patch

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 1325199..de0d0b6 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -293,7 +293,8 @@  static av_cold int vpx_free(AVCodecContext *avctx)
     VPxContext *ctx = avctx->priv_data;
 
 #if VPX_ENCODER_ABI_VERSION >= 12
-    if (ctx->level >= 0 && !(avctx->flags & AV_CODEC_FLAG_PASS1)) {
+    if (avctx->codec_id == AV_CODEC_ID_VP9 && ctx->level >= 0 &&
+        !(avctx->flags & AV_CODEC_FLAG_PASS1)) {
         int level_out = 0;
         if (!codecctl_intp(avctx, VP9E_GET_LEVEL, &level_out))
             av_log(avctx, AV_LOG_INFO, "Encoded level %.1f\n", level_out * 0.1);