[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35548 - Extractor/src/plugins
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35548 - Extractor/src/plugins |
Date: |
Tue, 21 Apr 2015 17:52:19 +0200 |
Author: LRN
Date: 2015-04-21 17:52:19 +0200 (Tue, 21 Apr 2015)
New Revision: 35548
Modified:
Extractor/src/plugins/previewopus_extractor.c
Log:
Make previewopus compatible with new libav versions
Modified: Extractor/src/plugins/previewopus_extractor.c
===================================================================
--- Extractor/src/plugins/previewopus_extractor.c 2015-04-21 15:52:17 UTC
(rev 35547)
+++ Extractor/src/plugins/previewopus_extractor.c 2015-04-21 15:52:19 UTC
(rev 35548)
@@ -296,7 +296,12 @@
/** Initialize one audio frame for reading from the input file */
static int init_input_frame(AVFrame **frame)
{
- if (!(*frame = avcodec_alloc_frame())) {
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
+ *frame = av_frame_alloc ();
+#else
+ *frame = avcodec_alloc_frame();
+#endif
+ if (NULL == *frame) {
#if DEBUG
fprintf(stderr, "Could not allocate input frame\n");
#endif
@@ -655,7 +660,11 @@
av_freep(&converted_input_samples[0]);
free(converted_input_samples);
}
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
+ av_frame_free (&input_frame);
+#else
avcodec_free_frame(&input_frame);
+#endif
return ret;
}
@@ -671,7 +680,12 @@
int error;
/** Create a new frame to store the audio samples. */
- if (!(*frame = avcodec_alloc_frame())) {
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
+ *frame = av_frame_alloc ();
+#else
+ *frame = avcodec_alloc_frame();
+#endif
+ if (NULL == *frame) {
#if DEBUG
fprintf(stderr, "Could not allocate output frame\n");
#endif
@@ -702,7 +716,11 @@
#if DEBUG
fprintf(stderr, "Could allocate output frame samples (error
'%s')\n", get_error_text(error));
#endif
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
+ av_frame_free (frame);
+#else
avcodec_free_frame(frame);
+#endif
return error;
}
@@ -783,17 +801,29 @@
#if DEBUG
fprintf(stderr, "Could not read data from FIFO\n");
#endif
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
+ av_frame_free (&output_frame);
+#else
avcodec_free_frame(&output_frame);
+#endif
return AVERROR_EXIT;
}
/** Encode one frame worth of audio samples. */
if (encode_audio_frame(output_frame, output_format_context,
output_codec_context, &data_written)) {
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
+ av_frame_free (&output_frame);
+#else
avcodec_free_frame(&output_frame);
+#endif
return AVERROR_EXIT;
}
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
+ av_frame_free (&output_frame);
+#else
avcodec_free_frame(&output_frame);
+#endif
return 0;
}
/** Write the trailer of the output file container. */
@@ -907,7 +937,12 @@
return;
}
- if (NULL == (frame = avcodec_alloc_frame ()))
+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55,28,1)
+ frame = av_frame_alloc ();
+#else
+ frame = avcodec_alloc_frame();
+#endif
+ if (NULL == frame)
{
#if DEBUG
fprintf (stderr,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35548 - Extractor/src/plugins,
gnunet <=