| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 ctx->name = iface->name; | 46 ctx->name = iface->name; |
| 47 ctx->priv = NULL; | 47 ctx->priv = NULL; |
| 48 ctx->init_flags = flags; | 48 ctx->init_flags = flags; |
| 49 ctx->config.enc = cfg; | 49 ctx->config.enc = cfg; |
| 50 res = ctx->iface->init(ctx, NULL); | 50 res = ctx->iface->init(ctx, NULL); |
| 51 | 51 |
| 52 if (res) { | 52 if (res) { |
| 53 ctx->err_detail = ctx->priv ? ctx->priv->err_detail : NULL; | 53 ctx->err_detail = ctx->priv ? ctx->priv->err_detail : NULL; |
| 54 vpx_codec_destroy(ctx); | 54 vpx_codec_destroy(ctx); |
| 55 } | 55 } |
| 56 | |
| 57 if (ctx->priv) | |
| 58 ctx->priv->iface = ctx->iface; | |
| 59 } | 56 } |
| 60 | 57 |
| 61 return SAVE_STATUS(ctx, res); | 58 return SAVE_STATUS(ctx, res); |
| 62 } | 59 } |
| 63 | 60 |
| 64 vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx, | 61 vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx, |
| 65 vpx_codec_iface_t *iface, | 62 vpx_codec_iface_t *iface, |
| 66 vpx_codec_enc_cfg_t *cfg, | 63 vpx_codec_enc_cfg_t *cfg, |
| 67 int num_enc, | 64 int num_enc, |
| 68 vpx_codec_flags_t flags, | 65 vpx_codec_flags_t flags, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 125 |
| 129 /* Destroy already allocated high-level ctx */ | 126 /* Destroy already allocated high-level ctx */ |
| 130 while (i) { | 127 while (i) { |
| 131 ctx--; | 128 ctx--; |
| 132 ctx->err_detail = error_detail; | 129 ctx->err_detail = error_detail; |
| 133 vpx_codec_destroy(ctx); | 130 vpx_codec_destroy(ctx); |
| 134 i--; | 131 i--; |
| 135 } | 132 } |
| 136 } | 133 } |
| 137 | 134 |
| 138 if (ctx->priv) | |
| 139 ctx->priv->iface = ctx->iface; | |
| 140 | |
| 141 if (res) | 135 if (res) |
| 142 break; | 136 break; |
| 143 | 137 |
| 144 ctx++; | 138 ctx++; |
| 145 cfg++; | 139 cfg++; |
| 146 dsf++; | 140 dsf++; |
| 147 } | 141 } |
| 148 ctx--; | 142 ctx--; |
| 149 } | 143 } |
| 150 } | 144 } |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 388 |
| 395 pkt = (const vpx_codec_cx_pkt_t *)*iter; | 389 pkt = (const vpx_codec_cx_pkt_t *)*iter; |
| 396 | 390 |
| 397 if ((size_t)(pkt - list->pkts) < list->cnt) | 391 if ((size_t)(pkt - list->pkts) < list->cnt) |
| 398 *iter = pkt + 1; | 392 *iter = pkt + 1; |
| 399 else | 393 else |
| 400 pkt = NULL; | 394 pkt = NULL; |
| 401 | 395 |
| 402 return pkt; | 396 return pkt; |
| 403 } | 397 } |
| OLD | NEW |