summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2013-01-17 21:30:08 +0000
committerAlexis Ballier <aballier@gentoo.org>2013-01-17 21:30:08 +0000
commit5bbaaf9d0aac89b905647416f5d05413858249fd (patch)
treed3f710246c17c38de8fcbb6be7ba80dfbc0f1181 /media-video/hwdecode-demos/files
parentBe specific in the ChangeLog for WilliamH (diff)
downloadhistorical-5bbaaf9d0aac89b905647416f5d05413858249fd.tar.gz
historical-5bbaaf9d0aac89b905647416f5d05413858249fd.tar.bz2
historical-5bbaaf9d0aac89b905647416f5d05413858249fd.zip
Fix build with latest ffmpeg. Part of bug #443430
Package-Manager: portage-2.2.0_alpha154/cvs/Linux x86_64 Manifest-Sign-Key: 0x160F534A
Diffstat (limited to 'media-video/hwdecode-demos/files')
-rw-r--r--media-video/hwdecode-demos/files/ffmpeg-1.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/media-video/hwdecode-demos/files/ffmpeg-1.patch b/media-video/hwdecode-demos/files/ffmpeg-1.patch
new file mode 100644
index 000000000000..f0b223e1401c
--- /dev/null
+++ b/media-video/hwdecode-demos/files/ffmpeg-1.patch
@@ -0,0 +1,73 @@
+Index: hwdecode-demos-0.9.5/src/ffmpeg.c
+===================================================================
+--- hwdecode-demos-0.9.5.orig/src/ffmpeg.c
++++ hwdecode-demos-0.9.5/src/ffmpeg.c
+@@ -53,7 +53,6 @@ static int ffmpeg_init(void)
+ return -1;
+ }
+
+- avcodec_init();
+ avcodec_register_all();
+
+ ffmpeg_context = ffmpeg;
+@@ -148,7 +147,6 @@ static int get_buffer(struct AVCodecCont
+ void *surface = (void *)(uintptr_t)vaapi->surface_id;
+
+ pic->type = FF_BUFFER_TYPE_USER;
+- pic->age = 1;
+ pic->data[0] = surface;
+ pic->data[1] = NULL;
+ pic->data[2] = NULL;
+Index: hwdecode-demos-0.9.5/src/ffmpeg_video.c
+===================================================================
+--- hwdecode-demos-0.9.5.orig/src/ffmpeg_video.c
++++ hwdecode-demos-0.9.5/src/ffmpeg_video.c
+@@ -23,6 +23,7 @@
+
+ #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
+ # include <libavformat/avformat.h>
++# include <libavformat/avio.h>
+ #endif
+ #ifdef HAVE_FFMPEG_AVFORMAT_H
+ # include <ffmpeg/avformat.h>
+@@ -59,7 +60,7 @@
+ int decode(void)
+ {
+ AVProbeData pd;
+- ByteIOContext ioctx;
++ AVIOContext *ioctx;
+ AVInputFormat *format = NULL;
+ AVFormatContext *ic = NULL;
+ AVCodec *codec;
+@@ -84,15 +85,20 @@ int decode(void)
+ goto end;
+ format->flags |= AVFMT_NOFILE;
+
+- if (init_put_byte(&ioctx, (uint8_t *)video_data, video_data_size, 0, NULL, NULL, NULL, NULL) < 0)
++ ioctx = avio_alloc_context((uint8_t *)video_data, video_data_size, 0, NULL, NULL, NULL, NULL);
++ if (!ioctx)
+ goto end;
+
+- if (av_open_input_stream(&ic, &ioctx, "", format, NULL) < 0)
++ ic = avformat_alloc_context();
++ if(!ic)
++ goto end;
++ ic->pb = ioctx;
++ if (avformat_open_input(&ic, "", format, NULL) < 0)
+ goto end;
+
+ if (av_find_stream_info(ic) < 0)
+ goto end;
+- dump_format(ic, 0, "", 0);
++ av_dump_format(ic, 0, "", 0);
+
+ video_stream = NULL;
+ for (i = 0; i < ic->nb_streams; i++) {
+@@ -135,6 +141,6 @@ end:
+ if (avctx)
+ avcodec_close(avctx);
+ if (ic)
+- av_close_input_stream(ic);
++ avformat_close_input(&ic);
+ return error;
+ }