aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/DllAvCodec.h12
-rw-r--r--lib/addons/library.xbmc.addon/libXBMC_addon.cpp3
-rw-r--r--lib/ffmpeg/libavcodec/vaapi.c5
-rw-r--r--lib/ffmpeg/patches/0038-backport-vaapi-return-early-from-ff_vaapi_render_picture-without-picture.patch22
-rw-r--r--lib/ffmpeg/patches/0038-vaapi-don-t-unmap-non-existing-buffer.patch30
5 files changed, 32 insertions, 40 deletions
diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h
index cf52a14c14..8a439d506d 100644
--- a/lib/DllAvCodec.h
+++ b/lib/DllAvCodec.h
@@ -64,8 +64,8 @@ public:
virtual void avcodec_register_all(void)=0;
virtual void avcodec_flush_buffers(AVCodecContext *avctx)=0;
virtual int avcodec_open2_dont_call(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options)=0;
- virtual AVCodec *avcodec_find_decoder(enum CodecID id)=0;
- virtual AVCodec *avcodec_find_encoder(enum CodecID id)=0;
+ virtual AVCodec *avcodec_find_decoder(enum AVCodecID id)=0;
+ virtual AVCodec *avcodec_find_encoder(enum AVCodecID id)=0;
virtual int avcodec_close_dont_call(AVCodecContext *avctx)=0;
virtual AVFrame *avcodec_alloc_frame(void)=0;
virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height)=0;
@@ -124,8 +124,8 @@ public:
}
virtual int avcodec_open2_dont_call(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options) { *(volatile int *)0x0 = 0; return 0; }
virtual int avcodec_close_dont_call(AVCodecContext *avctx) { *(volatile int *)0x0 = 0; return 0; }
- virtual AVCodec *avcodec_find_decoder(enum CodecID id) { return ::avcodec_find_decoder(id); }
- virtual AVCodec *avcodec_find_encoder(enum CodecID id) { return ::avcodec_find_encoder(id); }
+ virtual AVCodec *avcodec_find_decoder(enum AVCodecID id) { return ::avcodec_find_decoder(id); }
+ virtual AVCodec *avcodec_find_encoder(enum AVCodecID id) { return ::avcodec_find_encoder(id); }
virtual int avcodec_close(AVCodecContext *avctx)
{
CSingleLock lock(DllAvCodec::m_critSection);
@@ -202,8 +202,8 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface
LOAD_SYMBOLS();
DEFINE_METHOD0(void, avcodec_register_all_dont_call)
- DEFINE_METHOD1(AVCodec*, avcodec_find_decoder, (enum CodecID p1))
- DEFINE_METHOD1(AVCodec*, avcodec_find_encoder, (enum CodecID p1))
+ DEFINE_METHOD1(AVCodec*, avcodec_find_decoder, (enum AVCodecID p1))
+ DEFINE_METHOD1(AVCodec*, avcodec_find_encoder, (enum AVCodecID p1))
DEFINE_METHOD1(int, avcodec_close_dont_call, (AVCodecContext *p1))
DEFINE_METHOD0(AVFrame*, avcodec_alloc_frame)
DEFINE_METHOD5(int, avpicture_fill, (AVPicture *p1, uint8_t *p2, PixelFormat p3, int p4, int p5))
diff --git a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp
index e39931dbe8..34081d9962 100644
--- a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp
+++ b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp
@@ -113,8 +113,7 @@ DLLEXPORT char* XBMC_get_dvd_menu_language(void *hdl, void* cb)
if (cb == NULL)
return "";
- string buffer = ((CB_AddOnLib*)cb)->GetDVDMenuLanguage(((AddonCB*)hdl)->addonData);
- return strdup(buffer.c_str());
+ return ((CB_AddOnLib*)cb)->GetDVDMenuLanguage(((AddonCB*)hdl)->addonData);
}
DLLEXPORT void XBMC_free_string(void* hdl, void* cb, char* str)
diff --git a/lib/ffmpeg/libavcodec/vaapi.c b/lib/ffmpeg/libavcodec/vaapi.c
index 3e203d66c5..94959bf5ed 100644
--- a/lib/ffmpeg/libavcodec/vaapi.c
+++ b/lib/ffmpeg/libavcodec/vaapi.c
@@ -46,10 +46,11 @@ int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
VABufferID va_buffers[3];
unsigned int n_va_buffers = 0;
- if (vactx->pic_param_buf_id) {
+ if (!vactx->pic_param_buf_id)
+ return 0;
+
vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
- }
if (vactx->iq_matrix_buf_id) {
vaUnmapBuffer(vactx->display, vactx->iq_matrix_buf_id);
diff --git a/lib/ffmpeg/patches/0038-backport-vaapi-return-early-from-ff_vaapi_render_picture-without-picture.patch b/lib/ffmpeg/patches/0038-backport-vaapi-return-early-from-ff_vaapi_render_picture-without-picture.patch
new file mode 100644
index 0000000000..3a6db3dbc0
--- /dev/null
+++ b/lib/ffmpeg/patches/0038-backport-vaapi-return-early-from-ff_vaapi_render_picture-without-picture.patch
@@ -0,0 +1,22 @@
+Subject: [libav-devel] [PATCH 1/2] vaapi: return early from ff_vaapi_render_picture() without picture
+From: Janne Grunau janne-libav at jannau.net
+
+Fixes an assertion when called on uninitialized frame. Spotted after
+seeking in vlc. (backported from libav mailing list)
+
+---
+
+diff --git a/lib/ffmpeg/libavcodec/vaapi.c b/lib/ffmpeg/libavcodec/vaapi.c
+index a220a9d..94959bf 100644
+--- a/lib/ffmpeg/libavcodec/vaapi.c
++++ b/lib/ffmpeg/libavcodec/vaapi.c
+@@ -46,6 +46,9 @@ int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
+ VABufferID va_buffers[3];
+ unsigned int n_va_buffers = 0;
+
++ if (!vactx->pic_param_buf_id)
++ return 0;
++
+ vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
+ va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
+
diff --git a/lib/ffmpeg/patches/0038-vaapi-don-t-unmap-non-existing-buffer.patch b/lib/ffmpeg/patches/0038-vaapi-don-t-unmap-non-existing-buffer.patch
deleted file mode 100644
index 0724a861f4..0000000000
--- a/lib/ffmpeg/patches/0038-vaapi-don-t-unmap-non-existing-buffer.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 28f92dfbd59197955f95a583a61a24428048f166 Mon Sep 17 00:00:00 2001
-From: Joakim Plate <elupus@ecce.se>
-Date: Wed, 22 May 2013 22:24:07 +0200
-Subject: [PATCH 1/2] vaapi: don't unmap non-existing buffer
-
-Some h264's can end up calling ff_vaapi_render_picture after a seek
-with no buffer allocated and vaUnmapBuffer will assert on a invalid
-buffer.
----
- libavcodec/vaapi.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
-index a220a9d..b991cde 100644
---- a/libavcodec/vaapi.c
-+++ b/libavcodec/vaapi.c
-@@ -46,8 +46,10 @@ int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
- VABufferID va_buffers[3];
- unsigned int n_va_buffers = 0;
-
-+ if (vactx->pic_param_buf_id) {
- vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
- va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
-+ }
-
- if (vactx->iq_matrix_buf_id) {
- vaUnmapBuffer(vactx->display, vactx->iq_matrix_buf_id);
---
-1.8.2
-