]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7508: improve vpx err msg
authorSeven Du <dujinfang@gmail.com>
Tue, 7 Apr 2015 03:03:39 +0000 (11:03 +0800)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:47:16 +0000 (12:47 -0500)
src/mod/codecs/mod_vpx/mod_vpx.c

index 85d8efd8e9ab2508588beb055e0e9cd00cd24ced..e14f3db4e123348f2b90ab43a86bbd808bf28118 100644 (file)
@@ -596,6 +596,7 @@ static switch_status_t switch_vpx_encode(switch_codec_t *codec, switch_frame_t *
        int64_t pts;
        vpx_enc_frame_flags_t vpx_flags = 0;
        switch_time_t now;
+       int err;
 
        if (frame->flags & SFF_SAME_IMAGE) {
                return consume_partition(context, frame);
@@ -652,13 +653,14 @@ static switch_status_t switch_vpx_encode(switch_codec_t *codec, switch_frame_t *
 
        dur = context->last_ms ? (now - context->last_ms) / 1000 : pts;
 
-       if (vpx_codec_encode(&context->encoder,
+       if ((err = vpx_codec_encode(&context->encoder,
                                                 (vpx_image_t *) frame->img,
                                                 pts,
                                                 dur, 
                                                 vpx_flags,
-                                                VPX_DL_REALTIME) != VPX_CODEC_OK) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "VPX encode error %d:%s\n", context->encoder.err, context->encoder.err_detail);
+                                                VPX_DL_REALTIME)) != VPX_CODEC_OK) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "VPX encode error %d:%s:%s\n",
+                       err, vpx_codec_error(&context->encoder), vpx_codec_error_detail(&context->encoder));
                frame->datalen = 0;
                return SWITCH_STATUS_FALSE;
        }