summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-multimedia/mplayer
diff options
context:
space:
mode:
authorBelal, Awais <Awais_Belal@mentor.com>2016-01-18 19:08:48 +0500
committerMartin Jansa <Martin.Jansa@gmail.com>2016-01-27 12:43:55 +0100
commit8e49262b129fa1f83501bb1179cffff6ce343f5a (patch)
tree9ecf11e64285877af2cdafb668a948617fbe6f3c /meta-oe/recipes-multimedia/mplayer
parente27a8ed92b53c6ae8504b0d573c7352d6a07bbf8 (diff)
downloadmeta-openembedded-8e49262b129fa1f83501bb1179cffff6ce343f5a.tar.gz
mplayer2: fix building with gcc 5.x
This patch works around a potential problem in the theora glue code where it assumes that the compiler will somehow find a function which is not exported explicitly through the libtheora library. Due to this problem the build fails with gcc-5.x compiler. The included patch essentially backports a commit which updates the glue code to use the Theora 1.0 API to eliminate this problem and PNBLACKLIST is cleared for mplayer2. Signed-off-by: Awais Belal <awais_belal@mentor.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-multimedia/mplayer')
-rw-r--r--meta-oe/recipes-multimedia/mplayer/mplayer2/0001-demux_ogg-partially-port-libtheora-glue-code-to-Theo.patch136
-rw-r--r--meta-oe/recipes-multimedia/mplayer/mplayer2_git.bb4
2 files changed, 137 insertions, 3 deletions
diff --git a/meta-oe/recipes-multimedia/mplayer/mplayer2/0001-demux_ogg-partially-port-libtheora-glue-code-to-Theo.patch b/meta-oe/recipes-multimedia/mplayer/mplayer2/0001-demux_ogg-partially-port-libtheora-glue-code-to-Theo.patch
new file mode 100644
index 000000000..b4d98412f
--- /dev/null
+++ b/meta-oe/recipes-multimedia/mplayer/mplayer2/0001-demux_ogg-partially-port-libtheora-glue-code-to-Theo.patch
@@ -0,0 +1,136 @@
1From 0571bb4f1a6e1934ee7e093ce7aa517b9bac8e6a Mon Sep 17 00:00:00 2001
2From: Awais Belal <awais_belal@mentor.com>
3Date: Sun, 17 Jan 2016 14:46:10 +0500
4Subject: [PATCH] demux_ogg: partially port libtheora glue code to Theora 1.0
5 API
6
7This partially backports the following commit to allow building
8with gcc-5.x and otherwise fails to find the definition of
9the _ilog function the way it is used.
10
11https://github.com/pigoz/mplayer-svn/commit/85e51408cd00979fc209da8e3a39b6f0e7f325bc
12
13Signed-off-by: Awais Belal <awais_belal@mentor.com>
14---
15 libmpdemux/demux_ogg.c | 52 ++++++++++++++++++++++++++------------------------
16 1 file changed, 27 insertions(+), 25 deletions(-)
17
18diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
19index 9eea061..9144426 100644
20--- a/libmpdemux/demux_ogg.c
21+++ b/libmpdemux/demux_ogg.c
22@@ -50,8 +50,7 @@
23 #endif
24
25 #ifdef CONFIG_OGGTHEORA
26-#include <theora/theora.h>
27-int _ilog (unsigned int); /* defined in many places in theora/lib/ */
28+#include <theora/theoradec.h>
29 #endif
30
31 #define BLOCK_SIZE 4096
32@@ -62,9 +61,10 @@ int _ilog (unsigned int); /* defined in many places in theora/lib/ */
33 */
34 #ifdef CONFIG_OGGTHEORA
35 typedef struct theora_struct_st {
36- theora_state st;
37- theora_comment cc;
38- theora_info inf;
39+ th_setup_info *tsi;
40+ th_dec_ctx *tctx;
41+ th_comment tc;
42+ th_info ti;
43 } theora_struct_t;
44 #endif
45
46@@ -117,7 +117,7 @@ typedef struct ogg_stream {
47 float samplerate; /// granulpos 2 time
48 int64_t lastpos;
49 int32_t lastsize;
50- int keyframe_frequency_force;
51+ int keyframe_granule_shift;
52
53 // Logical stream state
54 ogg_stream_state stream;
55@@ -300,11 +300,10 @@ static unsigned char *demux_ogg_read_packet(ogg_stream_t *os, ogg_packet *pack,
56 have theora_state st, until all header packets were passed to the
57 decoder. */
58 if (!pack->bytes || !(*data&0x80)) {
59- int keyframe_granule_shift = _ilog(os->keyframe_frequency_force - 1);
60- int64_t iframemask = (1 << keyframe_granule_shift) - 1;
61+ int64_t iframemask = iframemask = (1 << os->keyframe_granule_shift) - 1;
62
63 if (pack->granulepos >= 0) {
64- os->lastpos = pack->granulepos >> keyframe_granule_shift;
65+ os->lastpos = pack->granulepos >> os->keyframe_granule_shift;
66 os->lastpos += pack->granulepos & iframemask;
67 *keyframe = (pack->granulepos & iframemask) == 0;
68 } else {
69@@ -888,14 +887,15 @@ int demux_ogg_open(demuxer_t *demuxer)
70 #ifdef CONFIG_OGGTHEORA
71 } else if (pack.bytes >= 7 && !strncmp (&pack.packet[1], "theora", 6)) {
72 int errorCode = 0;
73- theora_info inf;
74- theora_comment cc;
75+ th_info ti;
76+ th_comment tc;
77+ th_setup_info *tsi = NULL;
78
79- theora_info_init (&inf);
80- theora_comment_init (&cc);
81+ th_info_init (&ti);
82+ th_comment_init (&tc);
83
84- errorCode = theora_decode_header (&inf, &cc, &pack);
85- if (errorCode) {
86+ errorCode = th_decode_headerin(&ti, &tc, &tsi, &pack);
87+ if (errorCode < 0) {
88 mp_msg(MSGT_DEMUX, MSGL_ERR,
89 "Theora header parsing failed: %i \n", errorCode);
90 } else {
91@@ -904,30 +904,32 @@ int demux_ogg_open(demuxer_t *demuxer)
92 sh_v->bih = calloc(1, sizeof(*sh_v->bih));
93 sh_v->bih->biSize = sizeof(*sh_v->bih);
94 sh_v->bih->biCompression = sh_v->format = FOURCC_THEORA;
95- sh_v->fps = ((double)inf.fps_numerator) / (double)inf.fps_denominator;
96- sh_v->frametime = ((double)inf.fps_denominator) / (double)inf.fps_numerator;
97- sh_v->disp_w = sh_v->bih->biWidth = inf.frame_width;
98- sh_v->disp_h = sh_v->bih->biHeight = inf.frame_height;
99+ sh_v->fps = ((double)ti.fps_numerator) / (double)ti.fps_denominator;
100+ sh_v->frametime = ((double)ti.fps_denominator) / (double)ti.fps_numerator;
101+ sh_v->i_bps = ti.target_bitrate / 8;
102+ sh_v->disp_w = sh_v->bih->biWidth = ti.frame_width;
103+ sh_v->disp_h = sh_v->bih->biHeight = ti.frame_height;
104 sh_v->bih->biBitCount = 24;
105 sh_v->bih->biPlanes = 3;
106 sh_v->bih->biSizeImage = ((sh_v->bih->biBitCount / 8) * sh_v->bih->biWidth * sh_v->bih->biHeight);
107 ogg_d->subs[ogg_d->num_sub].samplerate = sh_v->fps;
108 ogg_d->subs[ogg_d->num_sub].theora = 1;
109- ogg_d->subs[ogg_d->num_sub].keyframe_frequency_force = inf.keyframe_frequency_force;
110+ ogg_d->subs[ogg_d->num_sub].keyframe_granule_shift = ti.keyframe_granule_shift;
111 ogg_d->subs[ogg_d->num_sub].id = n_video;
112 n_video++;
113 mp_msg(MSGT_DEMUX, MSGL_INFO,
114 "[Ogg] stream %d: video (Theora v%d.%d.%d), -vid %d\n",
115 ogg_d->num_sub,
116- (int)inf.version_major,
117- (int)inf.version_minor,
118- (int)inf.version_subminor,
119+ (int)ti.version_major,
120+ (int)ti.version_minor,
121+ (int)ti.version_subminor,
122 n_video - 1);
123 if (mp_msg_test(MSGT_HEADER, MSGL_V))
124 print_video_header(sh_v->bih, MSGL_V);
125 }
126- theora_comment_clear(&cc);
127- theora_info_clear(&inf);
128+ th_comment_clear(&tc);
129+ th_info_clear(&ti);
130+ th_setup_free(tsi);
131 #endif /* CONFIG_OGGTHEORA */
132 } else if (pack.bytes >= 4 && !strncmp (&pack.packet[0], "fLaC", 4)) {
133 sh_a = new_sh_audio_aid(demuxer, ogg_d->num_sub, n_audio);
134--
1351.9.1
136
diff --git a/meta-oe/recipes-multimedia/mplayer/mplayer2_git.bb b/meta-oe/recipes-multimedia/mplayer/mplayer2_git.bb
index 2f0369a19..9df4e745a 100644
--- a/meta-oe/recipes-multimedia/mplayer/mplayer2_git.bb
+++ b/meta-oe/recipes-multimedia/mplayer/mplayer2_git.bb
@@ -21,6 +21,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=d32239bcb673463ab874e80d47fae504"
21 21
22SRC_URI = "git://repo.or.cz/mplayer.git \ 22SRC_URI = "git://repo.or.cz/mplayer.git \
23 file://0001-configure-don-t-disable-ASS-support-when-explicitly-.patch \ 23 file://0001-configure-don-t-disable-ASS-support-when-explicitly-.patch \
24 file://0001-demux_ogg-partially-port-libtheora-glue-code-to-Theo.patch \
24" 25"
25 26
26SRCREV = "2c378c71a4d9b1df382db9aa787b646628b4e3f9" 27SRCREV = "2c378c71a4d9b1df382db9aa787b646628b4e3f9"
@@ -153,6 +154,3 @@ do_install() {
153 install ${S}/etc/codecs.conf ${D}/usr/etc/mplayer/ 154 install ${S}/etc/codecs.conf ${D}/usr/etc/mplayer/
154 [ -e ${D}/usr/lib ] && rmdir ${D}/usr/lib 155 [ -e ${D}/usr/lib ] && rmdir ${D}/usr/lib
155} 156}
156
157# | libmpdemux/demux_ogg.o:demux_ogg.c:function demux_ogg_read_packet: error: undefined reference to '_ilog'
158PNBLACKLIST[mplayer2] ?= "BROKEN, fails to build with gcc-5"