alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* alsa-plugins: pcm_a52.c uses recently removed avcodec_{alloc, free}_frame
@ 2016-03-09  7:20 Daniel Kirchner
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Kirchner @ 2016-03-09  7:20 UTC (permalink / raw)
  To: alsa-devel

pcm_a52.c uses avcodec_alloc_frame and avcodec_free_frame that have
been replaced by av_frame_alloc and av_frame_free in recent versions of
libavcodec. The following patch should fix this while remaining
backwards compatible.


--- a/a52/pcm_a52.c.orig	2016-03-04 18:21:12.606805770 +0100
+++ b/a52/pcm_a52.c	2016-03-04 18:34:22.653240501 +0100
@@ -62,6 +62,11 @@
 #define AV_CODEC_ID_AC3 CODEC_ID_AC3
 #endif
 
+#if LIBAVCODEC_VERSION_INT < 0x371c01
+#define av_frame_alloc avcodec_alloc_frame
+#define av_frame_free avcodec_free_frame
+#endif
+
 struct a52_ctx {
 	snd_pcm_ioplug_t io;
 	snd_pcm_t *slave;
@@ -513,7 +518,7 @@
 		rec->inbuf = NULL;
 	}
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
-	avcodec_free_frame(&rec->frame);
+	av_frame_free(&rec->frame);
 #else
 	av_freep(&rec->frame);
 #endif
@@ -557,7 +562,7 @@
 {
 	struct a52_ctx *rec = io->private_data;
 #ifdef USE_AVCODEC_FRAME
-	rec->frame = avcodec_alloc_frame();
+	rec->frame = av_frame_alloc();
 	if (!rec->frame)
 		return -ENOMEM;
 	if (av_samples_alloc(rec->frame->data, rec->frame->linesize,

^ permalink raw reply	[flat|nested] 3+ messages in thread
* alsa-plugins: pcm_a52.c uses recently removed avcodec_{alloc, free}_frame
@ 2016-03-09  8:18 Daniel Kirchner
  2016-03-09  8:20 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Kirchner @ 2016-03-09  8:18 UTC (permalink / raw)
  To: alsa-devel

pcm_a52.c uses avcodec_alloc_frame and avcodec_free_frame that have
been replaced by av_frame_alloc and av_frame_free in recent versions of
libavcodec. The following patch should fix this while remaining
backwards compatible.


--- a/a52/pcm_a52.c.orig	2016-03-04 18:21:12.606805770 +0100
+++ b/a52/pcm_a52.c	2016-03-04 18:34:22.653240501 +0100
@@ -62,6 +62,11 @@
 #define AV_CODEC_ID_AC3 CODEC_ID_AC3
 #endif
 
+#if LIBAVCODEC_VERSION_INT < 0x371c01
+#define av_frame_alloc avcodec_alloc_frame
+#define av_frame_free avcodec_free_frame
+#endif
+
 struct a52_ctx {
 	snd_pcm_ioplug_t io;
 	snd_pcm_t *slave;
@@ -513,7 +518,7 @@
 		rec->inbuf = NULL;
 	}
 #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0)
-	avcodec_free_frame(&rec->frame);
+	av_frame_free(&rec->frame);
 #else
 	av_freep(&rec->frame);
 #endif
@@ -557,7 +562,7 @@
 {
 	struct a52_ctx *rec = io->private_data;
 #ifdef USE_AVCODEC_FRAME
-	rec->frame = avcodec_alloc_frame();
+	rec->frame = av_frame_alloc();
 	if (!rec->frame)
 		return -ENOMEM;
 	if (av_samples_alloc(rec->frame->data, rec->frame->linesize,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-09  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09  7:20 alsa-plugins: pcm_a52.c uses recently removed avcodec_{alloc, free}_frame Daniel Kirchner
  -- strict thread matches above, loose matches on Subject: below --
2016-03-09  8:18 Daniel Kirchner
2016-03-09  8:20 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).