diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-08-16 22:09:31 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-08-16 22:09:31 +0000 |
commit | 79585dea037e35066eb58c3a13b42c5b39d966df (patch) | |
tree | 25c94ef4b05fdd7a8853980dae3d5374c271dac1 | |
parent | 4d061ce2f83a899fbf149db1e8006a535368d081 (diff) | |
download | libextractor-79585dea037e35066eb58c3a13b42c5b39d966df.tar.gz libextractor-79585dea037e35066eb58c3a13b42c5b39d966df.zip |
bugfixes, disable debug output
-rw-r--r-- | src/plugins/thumbnailffmpeg_extractor.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/thumbnailffmpeg_extractor.c b/src/plugins/thumbnailffmpeg_extractor.c index 0bb10bf..b45d3dc 100644 --- a/src/plugins/thumbnailffmpeg_extractor.c +++ b/src/plugins/thumbnailffmpeg_extractor.c | |||
@@ -62,7 +62,7 @@ | |||
62 | /** | 62 | /** |
63 | * Set to 1 to enable debug output. | 63 | * Set to 1 to enable debug output. |
64 | */ | 64 | */ |
65 | #define DEBUG 1 | 65 | #define DEBUG 0 |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * max dimension in pixels for the thumbnail. | 68 | * max dimension in pixels for the thumbnail. |
@@ -474,18 +474,17 @@ extract_video (struct EXTRACTOR_ExtractContext *ec) | |||
474 | if (0 != avformat_open_input (&format_ctx, "<no file>", NULL, &options)) | 474 | if (0 != avformat_open_input (&format_ctx, "<no file>", NULL, &options)) |
475 | return; | 475 | return; |
476 | av_dict_free (&options); | 476 | av_dict_free (&options); |
477 | options = NULL; | 477 | if (0 > avformat_find_stream_info (format_ctx, NULL)) |
478 | if (0 > avformat_find_stream_info (format_ctx, &options)) | ||
479 | { | 478 | { |
480 | #if DEBUG | 479 | #if DEBUG |
481 | fprintf (stderr, | 480 | fprintf (stderr, |
482 | "Failed to read stream info\n"); | 481 | "Failed to read stream info\n"); |
483 | #endif | 482 | #endif |
484 | avformat_close_input (&format_ctx); | 483 | avformat_close_input (&format_ctx); |
484 | av_free (io_ctx); | ||
485 | av_free (iob); | ||
485 | return; | 486 | return; |
486 | } | 487 | } |
487 | av_dict_free (&options); | ||
488 | |||
489 | codec = NULL; | 488 | codec = NULL; |
490 | codec_ctx = NULL; | 489 | codec_ctx = NULL; |
491 | video_stream_index = -1; | 490 | video_stream_index = -1; |
@@ -517,6 +516,7 @@ extract_video (struct EXTRACTOR_ExtractContext *ec) | |||
517 | if (NULL != codec) | 516 | if (NULL != codec) |
518 | avcodec_close (codec_ctx); | 517 | avcodec_close (codec_ctx); |
519 | avformat_close_input (&format_ctx); | 518 | avformat_close_input (&format_ctx); |
519 | av_free (io_ctx); | ||
520 | return; | 520 | return; |
521 | } | 521 | } |
522 | 522 | ||
@@ -528,6 +528,7 @@ extract_video (struct EXTRACTOR_ExtractContext *ec) | |||
528 | #endif | 528 | #endif |
529 | avcodec_close (codec_ctx); | 529 | avcodec_close (codec_ctx); |
530 | avformat_close_input (&format_ctx); | 530 | avformat_close_input (&format_ctx); |
531 | av_free (io_ctx); | ||
531 | return; | 532 | return; |
532 | } | 533 | } |
533 | #if DEBUG | 534 | #if DEBUG |
@@ -573,6 +574,7 @@ extract_video (struct EXTRACTOR_ExtractContext *ec) | |||
573 | av_free (frame); | 574 | av_free (frame); |
574 | avcodec_close (codec_ctx); | 575 | avcodec_close (codec_ctx); |
575 | avformat_close_input (&format_ctx); | 576 | avformat_close_input (&format_ctx); |
577 | av_free (io_ctx); | ||
576 | return; | 578 | return; |
577 | } | 579 | } |
578 | calculate_thumbnail_dimensions (codec_ctx->width, codec_ctx->height, | 580 | calculate_thumbnail_dimensions (codec_ctx->width, codec_ctx->height, |
@@ -598,6 +600,7 @@ extract_video (struct EXTRACTOR_ExtractContext *ec) | |||
598 | av_free (frame); | 600 | av_free (frame); |
599 | avcodec_close (codec_ctx); | 601 | avcodec_close (codec_ctx); |
600 | avformat_close_input (&format_ctx); | 602 | avformat_close_input (&format_ctx); |
603 | av_free (io_ctx); | ||
601 | } | 604 | } |
602 | 605 | ||
603 | 606 | ||