aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Cabral <brataoufba@gmail.com>2013-12-21 03:11:12 +0000
committerBruno Cabral <brataoufba@gmail.com>2013-12-21 03:11:12 +0000
commitd07e0d17678a99816962687d75c085b1b690efe7 (patch)
treee7b7153b2f720181144e40bc86d6a7cc72583008
parent11d6ea836b572d758352240d2cb9f08107d15297 (diff)
downloadlibextractor-d07e0d17678a99816962687d75c085b1b690efe7.tar.gz
libextractor-d07e0d17678a99816962687d75c085b1b690efe7.zip
Build only with libav , remove unused variables.
-rw-r--r--configure.ac8
-rw-r--r--src/plugins/previewopus_extractor.c30
2 files changed, 14 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac
index 9101b16..e5a880e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -672,11 +672,13 @@ if test x$ffmpeg_enabled = x1
672then 672then
673 ffmpeg_enabled=0 673 ffmpeg_enabled=0
674 new_ffmpeg=0 674 new_ffmpeg=0
675 AC_CHECK_HEADERS([libavutil/frame.h],new_ffmpeg=1) 675 AC_CHECK_HEADERS([libavutil/frame.h],
676 AC_CHECK_HEADERS([libavresample/avresample.h],new_ffmpeg=1))
677
676 AC_CHECK_LIB(swscale, sws_getContext, 678 AC_CHECK_LIB(swscale, sws_getContext,
677 AC_CHECK_LIB(avcodec, avcodec_alloc_context3, 679 AC_CHECK_LIB(avcodec, avcodec_alloc_context3,
678 ffmpeg_enabled=1)) 680 ffmpeg_enabled=1))
679 AC_CHECK_HEADERS([libavutil/avutil.h ffmpeg/avutil.h libavformat/avformat.h ffmpeg/avformat.h libavcodec/avcodec.h ffmpeg/avcodec.h libswscale/swscale.h ffmpeg/swscale.h libavresample/avresample.h ffmpeg/avresample.h]) 681 AC_CHECK_HEADERS([libavutil/avutil.h ffmpeg/avutil.h libavformat/avformat.h ffmpeg/avformat.h libavcodec/avcodec.h ffmpeg/avcodec.h libswscale/swscale.h ffmpeg/swscale.h])
680fi 682fi
681AM_CONDITIONAL(HAVE_FFMPEG, test x$ffmpeg_enabled != x0) 683AM_CONDITIONAL(HAVE_FFMPEG, test x$ffmpeg_enabled != x0)
682AM_CONDITIONAL(HAVE_FFMPEG_NEW, test x$new_ffmpeg != x0) 684AM_CONDITIONAL(HAVE_FFMPEG_NEW, test x$new_ffmpeg != x0)
@@ -805,7 +807,7 @@ fi
805 807
806if test "x$new_ffmpeg" = "x0" 808if test "x$new_ffmpeg" = "x0"
807then 809then
808 AC_MSG_NOTICE([NOTICE: FFmpeg/opus audio preview plugin disabled]) 810 AC_MSG_NOTICE([NOTICE: FFmpeg/opus audio preview plugin disabled, It needs libav > 10, or a FFmpeg with --enable-libavresample])
809fi 811fi
810 812
811if test "x$without_gtk" = "xtrue" 813if test "x$without_gtk" = "xtrue"
diff --git a/src/plugins/previewopus_extractor.c b/src/plugins/previewopus_extractor.c
index 1387044..9cae71f 100644
--- a/src/plugins/previewopus_extractor.c
+++ b/src/plugins/previewopus_extractor.c
@@ -66,11 +66,10 @@
66#endif 66#endif
67 67
68//TODO: Check for ffmpeg 68//TODO: Check for ffmpeg
69#if HAVE_LIBAVRESAMPLE_AVRESAMPLE_H
70#include <libavresample/avresample.h> 69#include <libavresample/avresample.h>
71#elif HAVE_FFMPEG_AVRESAMPLE_H 70
72#include <ffmpeg/avresample.h> 71
73#endif 72
74 73
75 74
76 75
@@ -202,19 +201,16 @@ static int open_output_file(
202 AVFormatContext **output_format_context, 201 AVFormatContext **output_format_context,
203 AVCodecContext **output_codec_context) 202 AVCodecContext **output_codec_context)
204{ 203{
205 AVIOContext *output_io_context = NULL;
206 AVStream *stream = NULL; 204 AVStream *stream = NULL;
207 AVCodec *output_codec = NULL; 205 AVCodec *output_codec = NULL;
208 AVIOContext *io_ctx; 206 AVIOContext *io_ctx;
209 int error; 207 int error;
210 208
211 209
212
213 AVDictionary *options;
214 unsigned char *iob; 210 unsigned char *iob;
215 211
216 if (NULL == (iob = av_malloc (16 * 1024))) 212 if (NULL == (iob = av_malloc (16 * 1024)))
217 return; 213 return AVERROR_EXIT;
218 if (NULL == (io_ctx = avio_alloc_context (iob, 16 * 1024, 214 if (NULL == (io_ctx = avio_alloc_context (iob, 16 * 1024,
219 AVIO_FLAG_WRITE, NULL, 215 AVIO_FLAG_WRITE, NULL,
220 NULL, 216 NULL,
@@ -222,12 +218,12 @@ static int open_output_file(
222 NULL))) 218 NULL)))
223 { 219 {
224 av_free (iob); 220 av_free (iob);
225 return; 221 return AVERROR_EXIT;
226 } 222 }
227 if (NULL == ((*output_format_context) = avformat_alloc_context ())) 223 if (NULL == ((*output_format_context) = avformat_alloc_context ()))
228 { 224 {
229 av_free (io_ctx); 225 av_free (io_ctx);
230 return; 226 return AVERROR_EXIT;
231 } 227 }
232 (*output_format_context)->pb = io_ctx; 228 (*output_format_context)->pb = io_ctx;
233 229
@@ -825,7 +821,6 @@ static int write_output_file_trailer(AVFormatContext *output_format_context)
825static void 821static void
826extract_audio (struct EXTRACTOR_ExtractContext *ec) 822extract_audio (struct EXTRACTOR_ExtractContext *ec)
827{ 823{
828 AVPacket packet;
829 AVIOContext *io_ctx; 824 AVIOContext *io_ctx;
830 struct AVFormatContext *format_ctx; 825 struct AVFormatContext *format_ctx;
831 AVCodecContext *codec_ctx; 826 AVCodecContext *codec_ctx;
@@ -833,23 +828,18 @@ extract_audio (struct EXTRACTOR_ExtractContext *ec)
833 AVCodec *codec; 828 AVCodec *codec;
834 AVDictionary *options; 829 AVDictionary *options;
835 AVFrame *frame; 830 AVFrame *frame;
836
837 AVCodecContext* output_codec_context = NULL; 831 AVCodecContext* output_codec_context = NULL;
838
839
840 AVAudioResampleContext *resample_context = NULL; 832 AVAudioResampleContext *resample_context = NULL;
841 AVAudioFifo *fifo = NULL; 833 AVAudioFifo *fifo = NULL;
842 834
843 835
844 int audio_stream_index; 836 int audio_stream_index;
845 int thumb_width;
846 int thumb_height;
847 int i; 837 int i;
848 int err; 838 int err;
849 int frame_finished;
850 int duration; 839 int duration;
851 unsigned char *iob; 840 unsigned char *iob;
852 841
842
853 totalSize =0; 843 totalSize =0;
854 844
855 if (NULL == (iob = av_malloc (16 * 1024))) 845 if (NULL == (iob = av_malloc (16 * 1024)))
@@ -982,7 +972,6 @@ extract_audio (struct EXTRACTOR_ExtractContext *ec)
982 972
983 if (err >= 0) 973 if (err >= 0)
984 avcodec_flush_buffers (codec_ctx); 974 avcodec_flush_buffers (codec_ctx);
985 frame_finished = 0;
986 975
987 976
988 /** 977 /**
@@ -1120,7 +1109,6 @@ extract_audio (struct EXTRACTOR_ExtractContext *ec)
1120void 1109void
1121EXTRACTOR_previewopus_extract_method (struct EXTRACTOR_ExtractContext *ec) 1110EXTRACTOR_previewopus_extract_method (struct EXTRACTOR_ExtractContext *ec)
1122{ 1111{
1123 unsigned int i;
1124 ssize_t iret; 1112 ssize_t iret;
1125 void *data; 1113 void *data;
1126 1114