Index: source/libvpx/vpxdec.c |
=================================================================== |
--- source/libvpx/vpxdec.c (revision 263011) |
+++ source/libvpx/vpxdec.c (working copy) |
@@ -218,9 +218,11 @@ |
static int read_frame(struct VpxDecInputContext *input, uint8_t **buf, |
size_t *bytes_in_buffer, size_t *buffer_size) { |
switch (input->vpx_input_ctx->file_type) { |
+#if CONFIG_WEBM_IO |
case FILE_TYPE_WEBM: |
return webm_read_frame(input->webm_ctx, |
buf, bytes_in_buffer, buffer_size); |
+#endif |
case FILE_TYPE_RAW: |
return raw_read_frame(input->vpx_input_ctx->file, |
buf, bytes_in_buffer, buffer_size); |
@@ -663,12 +665,17 @@ |
input.vpx_input_ctx->file = infile; |
if (file_is_ivf(input.vpx_input_ctx)) |
input.vpx_input_ctx->file_type = FILE_TYPE_IVF; |
+#if CONFIG_WEBM_IO |
else if (file_is_webm(input.webm_ctx, input.vpx_input_ctx)) |
input.vpx_input_ctx->file_type = FILE_TYPE_WEBM; |
+#endif |
else if (file_is_raw(input.vpx_input_ctx)) |
input.vpx_input_ctx->file_type = FILE_TYPE_RAW; |
else { |
fprintf(stderr, "Unrecognized input file type.\n"); |
+#if !CONFIG_WEBM_IO |
+ fprintf(stderr, "vpxdec was built without WebM container support.\n"); |
+#endif |
return EXIT_FAILURE; |
} |
@@ -691,6 +698,7 @@ |
return EXIT_FAILURE; |
} |
+#if CONFIG_WEBM_IO |
if (vpx_input_ctx.file_type == FILE_TYPE_WEBM) { |
if (webm_guess_framerate(input.webm_ctx, input.vpx_input_ctx)) { |
fprintf(stderr, "Failed to guess framerate -- error parsing " |
@@ -698,6 +706,7 @@ |
return EXIT_FAILURE; |
} |
} |
+#endif |
} |
fourcc_interface = get_vpx_decoder_by_fourcc(vpx_input_ctx.fourcc); |
@@ -941,9 +950,12 @@ |
} |
} |
+#if CONFIG_WEBM_IO |
if (input.vpx_input_ctx->file_type == FILE_TYPE_WEBM) |
webm_free(input.webm_ctx); |
- else |
+#endif |
+ |
+ if (input.vpx_input_ctx->file_type != FILE_TYPE_WEBM) |
free(buf); |
if (scaled_img) vpx_img_free(scaled_img); |