summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.hgignore11
-rw-r--r--ChangeLog6
-rw-r--r--debian/changelog7
-rw-r--r--debian/control8
-rw-r--r--debian/libxine2.install (renamed from debian/libxine1.install)10
-rw-r--r--debian/reportbug.presubj4
-rwxr-xr-xdebian/rules4
-rw-r--r--misc/xine-lib.spec.in254
-rw-r--r--src/input/Makefile.am5
-rw-r--r--src/input/input_dvb.c206
-rw-r--r--src/video_out/video_out_xcbxv.c4
-rw-r--r--src/video_out/video_out_xv.c4
12 files changed, 269 insertions, 254 deletions
diff --git a/.hgignore b/.hgignore
index 32b62ae30..186211ae5 100644
--- a/.hgignore
+++ b/.hgignore
@@ -2,6 +2,8 @@ syntax: glob
*~
*.orig
+*.o
+*.a
*.lo
*.la
.libs/*
@@ -34,16 +36,21 @@ build-stamp
configure-stamp
debian/files
debian/libxine-dev
-debian/libxine1
-debian/libxine1-dbg
+debian/libxine2
+debian/libxine2-dbg
debian/tmp
debian/*.debhelper
debian/*.substvars
+contrib/ffmpeg/*.pc
+contrib/ffmpeg/config.err
+contrib/ffmpeg/config.mak
+
doc/faq/faq.html
doc/faq/faq.txt
doc/hackersguide/*.png
doc/hackersguide/hackersguide.html
+doc/Doxyfile
include/xine.h
diff --git a/ChangeLog b/ChangeLog
index 8c88c57aa..a1f4e0909 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,12 @@ xine-lib (1.1.90) (Unreleased)
xine-lib (1.1.6) [UNRELEASED]
* Split the DirectFB plugin into X11 and non-X versions.
* Improve the Mac OS X video output plugin. Thanks to Matt Messier.
+ * Fixed the XcbXv plugin - an empty plugin would be built if "old" Xv
+ isn't detected.
+ * Reworked the channels.conf file handling in the DVB plugin. Previously,
+ with junk content, the plugin could potentially consume lots of memory
+ (possibly causing a local DoS). Also, a few small memory leaks have been
+ eliminated.
xine-lib (1.1.5)
* Security fixes:
diff --git a/debian/changelog b/debian/changelog
index e3fcde9a3..b2d25a3ce 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+xine-lib (1.2.0~hg-0) unstable; urgency=low
+
+ * Hg snapshot.
+ * Adjust for libxine2.
+
+ -- Darren Salt <linux@youmustbejoking.demon.co.uk> Sat, 14 Apr 2007 16:31:58 +0100
+
xine-lib (1.1.5~cvs-0) unstable; urgency=low
* CVS snapshot.
diff --git a/debian/control b/debian/control
index 1749dd041..fa053d851 100644
--- a/debian/control
+++ b/debian/control
@@ -25,7 +25,7 @@ Standards-Version: 3.7.2
Package: libxine-dev
Architecture: any
Section: libdevel
-Depends: libxine1 (= ${Source-Version}), libc6-dev, zlib1g-dev | libz-dev, libslang2-dev | slang1-dev, libfreetype6-dev
+Depends: libxine2 (= ${Source-Version}), libc6-dev, zlib1g-dev | libz-dev, libslang2-dev | slang1-dev, libfreetype6-dev
Conflicts: xine-ui (<< 0.9.10)
Description: the xine video player library, development packages
This contains development files (headers, documentation and the like)
@@ -42,7 +42,7 @@ Description: the xine video player library, development packages
The xine-ui and gxine packages each provide one for your convenience, so
you can just start watching your VCDs ;-)
-Package: libxine1
+Package: libxine2
Architecture: any
Depends: ${shlibs:Depends}
Recommends: ${shlibs:Recommends}
@@ -61,10 +61,10 @@ Description: the xine video/media player library, binary files
The xine-ui and gxine packages each provide one for your convenience, so
you can just start watching your VCDs ;-)
-Package: libxine1-dbg
+Package: libxine2-dbg
Priority: extra
Architecture: any
-Depends: libxine1 (= ${Source-Version})
+Depends: libxine2 (= ${Source-Version})
Description: the xine video/media player library, debug data
This is the xine media player library (libxine).
.
diff --git a/debian/libxine1.install b/debian/libxine2.install
index 1efbabbea..42f7937c2 100644
--- a/debian/libxine1.install
+++ b/debian/libxine2.install
@@ -3,9 +3,9 @@ usr/lib/xine/plugins/*/post/*.so
usr/lib/xine/plugins/*/*.so
usr/lib/xine/plugins/*/vidix/*.so
usr/share/locale
-usr/share/xine
+usr/share/xine-lib
usr/share/man/man5/xine.5
-usr/share/doc/libxine1/faq/*
-usr/share/doc/libxine1/README*
-usr/share/doc/libxine1/hackersguide/*
-usr/share/bug/libxine1/presubj
+usr/share/doc/libxine2/faq/*
+usr/share/doc/libxine2/README*
+usr/share/doc/libxine2/hackersguide/*
+usr/share/bug/libxine2/presubj
diff --git a/debian/reportbug.presubj b/debian/reportbug.presubj
index 229cd9d74..847ff0bad 100644
--- a/debian/reportbug.presubj
+++ b/debian/reportbug.presubj
@@ -21,9 +21,9 @@ with xine-ui, then file the bug against gxine)
Report bugs for xine crashes
============================
-If you report a bug that applications linked against libxine1
+If you report a bug that applications linked against libxine2
(xine-ui, gxine, amarok, totem, etc) segfault, please install the
-packages 'xine-ui' and 'libxine1-dbg', and try to reproduce it with
+packages 'xine-ui' and 'libxine2-dbg', and try to reproduce it with
this command:
> ulimit -c unlimited ; /usr/bin/xine --bug-report <mrl>
diff --git a/debian/rules b/debian/rules
index 395b983e0..6ff7d17f0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -128,10 +128,10 @@ binary-arch: build install
dh_installdocs
dh_installchangelogs -k ChangeLog
dh_link
- dh_strip --dbg-package=libxine1
+ dh_strip --dbg-package=libxine2
dh_compress
dh_fixperms
- dh_makeshlibs -V 'libxine1 (>= 1.1.2-5)'
+ dh_makeshlibs -V 'libxine2 (>= 1.2.0~)'
dh_installdeb
chmod +x debian/shlibdeps.sh
debian/shlibdeps.sh libxine${major}
diff --git a/misc/xine-lib.spec.in b/misc/xine-lib.spec.in
index 6382b9b9a..2b182e8ad 100644
--- a/misc/xine-lib.spec.in
+++ b/misc/xine-lib.spec.in
@@ -1,5 +1,5 @@
%define shortname libxine
-%define name libxine1
+%define name libxine2
%define version @SPEC_VERSION@
%define release 0
@@ -646,7 +646,7 @@ libxine Soundausgabeplugin für den jack-Soundserver
%build
export CFLAGS="${RPM_OPT_FLAGS}"
-export XINE_DOCPATH="%{_docdir}/libxine1"
+export XINE_DOCPATH="%{_docdir}/libxine2"
if [ ! -f configure ]; then
NO_CONFIGURE=1 ./autogen.sh
@@ -682,175 +682,175 @@ make DESTDIR=%{?buildroot:%{buildroot}} LIBRARY_PATH=%{?buildroot:%{buildroot}}%
cd ${RPM_BUILD_ROOT}
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_zw
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_zw
%if %BUILD_DEVEL
-echo "%doc README TODO AUTHORS COPYING ChangeLog" >> ${RPM_BUILD_DIR}/filelist_libxine1_zw
+echo "%doc README TODO AUTHORS COPYING ChangeLog" >> ${RPM_BUILD_DIR}/filelist_libxine2_zw
%else
-echo "%doc README TODO AUTHORS COPYING ChangeLog doc/hackersguide/*.sgml doc/hackersguide/*.fig doc/hackersguide/README" >> ${RPM_BUILD_DIR}/filelist_libxine1_zw
+echo "%doc README TODO AUTHORS COPYING ChangeLog doc/hackersguide/*.sgml doc/hackersguide/*.fig doc/hackersguide/README" >> ${RPM_BUILD_DIR}/filelist_libxine2_zw
%endif
-find . -type f | sed 's,^\.%{_datadir}/doc,\%doc %{_datadir}/doc,' | sed 's,^\.,,' >> ${RPM_BUILD_DIR}/filelist_libxine1_zw
-find . -type l | sed 's,^\.%{_datadir}/doc,\%doc %{_datadir}/doc,' | sed 's,^\.,,' >> ${RPM_BUILD_DIR}/filelist_libxine1_zw
-find . -type d | grep xine | sed 's,^\.,\%dir ,' >> ${RPM_BUILD_DIR}/filelist_libxine1_zw
-grep -v "/man/" ${RPM_BUILD_DIR}/filelist_libxine1_zw | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-grep "/man/" ${RPM_BUILD_DIR}/filelist_libxine1_zw | sed -e 's/$/\*/g' | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_zw
+find . -type f | sed 's,^\.%{_datadir}/doc,\%doc %{_datadir}/doc,' | sed 's,^\.,,' >> ${RPM_BUILD_DIR}/filelist_libxine2_zw
+find . -type l | sed 's,^\.%{_datadir}/doc,\%doc %{_datadir}/doc,' | sed 's,^\.,,' >> ${RPM_BUILD_DIR}/filelist_libxine2_zw
+find . -type d | grep xine | sed 's,^\.,\%dir ,' >> ${RPM_BUILD_DIR}/filelist_libxine2_zw
+grep -v "/man/" ${RPM_BUILD_DIR}/filelist_libxine2_zw | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+grep "/man/" ${RPM_BUILD_DIR}/filelist_libxine2_zw | sed -e 's/$/\*/g' | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_zw
%if %BUILD_DEVEL
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_devel
-echo "%doc doc/hackersguide/*.sgml doc/hackersguide/*.fig doc/hackersguide/README" >> ${RPM_BUILD_DIR}/filelist_libxine1_devel
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep -E "/include/|dhahelper\.o|libxine*\.(so|la)$|\.m4$" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_devel
-grep -v -E "/include/|dhahelper\.o|libxine*\.(so|la)$|\.m4$" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_devel
+echo "%doc doc/hackersguide/*.sgml doc/hackersguide/*.fig doc/hackersguide/README" >> ${RPM_BUILD_DIR}/filelist_libxine2_devel
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep -E "/include/|dhahelper\.o|libxine*\.(so|la)$|\.m4$" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_devel
+grep -v -E "/include/|dhahelper\.o|libxine*\.(so|la)$|\.m4$" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_ALSA
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_alsa
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep "xineplug_ao_out_alsa\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_alsa
-grep -v "xineplug_ao_out_alsa\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_alsa
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep "xineplug_ao_out_alsa\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_alsa
+grep -v "xineplug_ao_out_alsa\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_ARTS
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_arts
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep "xineplug_ao_out_arts\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_arts
-grep -v "xineplug_ao_out_arts\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_arts
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep "xineplug_ao_out_arts\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_arts
+grep -v "xineplug_ao_out_arts\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_ESD
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_esd
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep "xineplug_ao_out_esd\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_esd
-grep -v "xineplug_ao_out_esd\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_esd
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep "xineplug_ao_out_esd\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_esd
+grep -v "xineplug_ao_out_esd\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_DXR3
%ifarch i386 i486 i586 i686 i786 i868 i986 k6 k7 athlon x86_64 amd64 ia32e
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_dxr3
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep "dxr3" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_dxr3
-grep -v "dxr3" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_dxr3
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep "dxr3" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_dxr3
+grep -v "dxr3" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%endif
%if %BUILD_SDL
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_sdl
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep "xineplug_vo_out_sdl\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_sdl
-grep -v "xineplug_vo_out_sdl\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_sdl
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep "xineplug_vo_out_sdl\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_sdl
+grep -v "xineplug_vo_out_sdl\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_AA
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_aa
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep "xineplug_vo_out_aa\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_aa
-grep -v "xineplug_vo_out_aa\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_aa
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep "xineplug_vo_out_aa\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_aa
+grep -v "xineplug_vo_out_aa\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_OPENGL
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_opengl
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep -E "xineplug_vo_out_opengl\.|README.opengl" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_opengl
-grep -v -E "xineplug_vo_out_opengl\.|README.opengl" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_opengl
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep -E "xineplug_vo_out_opengl\.|README.opengl" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_opengl
+grep -v -E "xineplug_vo_out_opengl\.|README.opengl" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_SYNCFB
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_syncfb
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep -E "xineplug_vo_out_syncfb\.|README\.syncfb" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_syncfb
-grep -v -E "xineplug_vo_out_syncfb\.|README\.syncfb" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_syncfb
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep -E "xineplug_vo_out_syncfb\.|README\.syncfb" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_syncfb
+grep -v -E "xineplug_vo_out_syncfb\.|README\.syncfb" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_DIRECTFB
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_directfb
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep -E "xineplug_vo_out_directfb\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_directfb
-grep -v -E "xineplug_vo_out_directfb\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_directfb
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep -E "xineplug_vo_out_directfb\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_directfb
+grep -v -E "xineplug_vo_out_directfb\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_STK
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_stk
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep -E "xineplug_vo_out_stk\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_stk
-grep -v -E "xineplug_vo_out_stk\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_stk
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep -E "xineplug_vo_out_stk\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_stk
+grep -v -E "xineplug_vo_out_stk\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_XVMC
%ifarch i386 i486 i586 i686 i786 i868 i986 k6 k7 athlon x86_64 amd64 ia32e
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_xvmc
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep "xineplug_vo_out_x[x|v]mc\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_xvmc
-grep -v "xineplug_vo_out_x[x|v]mc\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_xvmc
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep "xineplug_vo_out_x[x|v]mc\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_xvmc
+grep -v "xineplug_vo_out_x[x|v]mc\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%endif
%if %BUILD_W32DLL
%ifarch i386 i486 i586 i686 i786 i868 i986 k6 k7 athlon
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_w32dll
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep -E "xineplug_decode_qt\.|xineplug_decode_w32dll\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_w32dll
-grep -v -E "xineplug_decode_qt\.|xineplug_decode_w32dll\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_w32dll
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep -E "xineplug_decode_qt\.|xineplug_decode_w32dll\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_w32dll
+grep -v -E "xineplug_decode_qt\.|xineplug_decode_w32dll\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%endif
%if %BUILD_DVB
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_dvb
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep -E "xineplug_inp_dvb\.|README\.dvb" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_dvb
-grep -v -E "xineplug_inp_dvb\.|README\.dvb" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_dvb
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep -E "xineplug_inp_dvb\.|README\.dvb" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_dvb
+grep -v -E "xineplug_inp_dvb\.|README\.dvb" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_DVD
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_dvd
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep -E "xineplug_inp_dvd\.|README\.network_dvd" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_dvd
-grep -v -E "xineplug_inp_dvd\.|README\.network_dvd" ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_dvd
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep -E "xineplug_inp_dvd\.|README\.network_dvd" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_dvd
+grep -v -E "xineplug_inp_dvd\.|README\.network_dvd" ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_GNOME_VFS
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_gnome_vfs
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep "xineplug_inp_gnome_vfs\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_gnome_vfs
-grep -v "xineplug_inp_gnome_vfs\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_gnome_vfs
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep "xineplug_inp_gnome_vfs\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_gnome_vfs
+grep -v "xineplug_inp_gnome_vfs\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_FLAC
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_flac
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep "xineplug_flac\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_flac
-grep -v "xineplug_flac\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_flac
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep "xineplug_flac\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_flac
+grep -v "xineplug_flac\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_OGG
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_ogg
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep -E "xineplug_decode_vorbis\.|xineplug_dmx_ogg\.|xineplug_decode_theora\.|xineplug_decode_speex\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_ogg
-grep -v -E "xineplug_decode_vorbis\.|xineplug_dmx_ogg\.|xineplug_decode_theora\.|xineplug_decode_speex\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_ogg
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep -E "xineplug_decode_vorbis\.|xineplug_dmx_ogg\.|xineplug_decode_theora\.|xineplug_decode_speex\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_ogg
+grep -v -E "xineplug_decode_vorbis\.|xineplug_dmx_ogg\.|xineplug_decode_theora\.|xineplug_decode_speex\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
%if %BUILD_JACK
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine1_jack
-mv ${RPM_BUILD_DIR}/filelist_libxine1 ${RPM_BUILD_DIR}/filelist_libxine1_old
-grep "xineplug_ao_out_jack\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine1_jack
-grep -v "xineplug_ao_out_jack\." ${RPM_BUILD_DIR}/filelist_libxine1_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine1
-rm ${RPM_BUILD_DIR}/filelist_libxine1_old
+echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_libxine2_jack
+mv ${RPM_BUILD_DIR}/filelist_libxine2 ${RPM_BUILD_DIR}/filelist_libxine2_old
+grep "xineplug_ao_out_jack\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - >> ${RPM_BUILD_DIR}/filelist_libxine2_jack
+grep -v "xineplug_ao_out_jack\." ${RPM_BUILD_DIR}/filelist_libxine2_old | cat - > ${RPM_BUILD_DIR}/filelist_libxine2
+rm ${RPM_BUILD_DIR}/filelist_libxine2_old
%endif
@@ -860,88 +860,88 @@ rm ${RPM_BUILD_DIR}/filelist_libxine1_old
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
-%files -f ../filelist_libxine1
+%files -f ../filelist_libxine2
%if %BUILD_DEVEL
-%files devel -f ../filelist_libxine1_devel
+%files devel -f ../filelist_libxine2_devel
%endif
%if %BUILD_ALSA
-%files alsa -f ../filelist_libxine1_alsa
+%files alsa -f ../filelist_libxine2_alsa
%endif
%if %BUILD_ARTS
-%files arts -f ../filelist_libxine1_arts
+%files arts -f ../filelist_libxine2_arts
%endif
%if %BUILD_ESD
-%files esd -f ../filelist_libxine1_esd
+%files esd -f ../filelist_libxine2_esd
%endif
%if %BUILD_DXR3
%ifarch i386 i486 i586 i686 i786 i868 i986 k6 k7 athlon x86_64 amd64 ia32e
-%files dxr3 -f ../filelist_libxine1_dxr3
+%files dxr3 -f ../filelist_libxine2_dxr3
%endif
%endif
%if %BUILD_SDL
-%files sdl -f ../filelist_libxine1_sdl
+%files sdl -f ../filelist_libxine2_sdl
%endif
%if %BUILD_AA
-%files aa -f ../filelist_libxine1_aa
+%files aa -f ../filelist_libxine2_aa
%endif
%if %BUILD_OPENGL
-%files opengl -f ../filelist_libxine1_opengl
+%files opengl -f ../filelist_libxine2_opengl
%endif
%if %BUILD_SYNCFB
-%files syncfb -f ../filelist_libxine1_syncfb
+%files syncfb -f ../filelist_libxine2_syncfb
%endif
%if %BUILD_DIRECTFB
-%files directfb -f ../filelist_libxine1_directfb
+%files directfb -f ../filelist_libxine2_directfb
%endif
%if %BUILD_STK
-%files stk -f ../filelist_libxine1_stk
+%files stk -f ../filelist_libxine2_stk
%endif
%if %BUILD_XVMC
%ifarch i386 i486 i586 i686 i786 i868 i986 k6 k7 athlon x86_64 amd64 ia32e
-%files xvmc -f ../filelist_libxine1_xvmc
+%files xvmc -f ../filelist_libxine2_xvmc
%endif
%endif
%if %BUILD_W32DLL
%ifarch i386 i486 i586 i686 i786 i868 i986 k6 k7 athlon
-%files w32dll -f ../filelist_libxine1_w32dll
+%files w32dll -f ../filelist_libxine2_w32dll
%endif
%endif
%if %BUILD_DVB
-%files dvb -f ../filelist_libxine1_dvb
+%files dvb -f ../filelist_libxine2_dvb
%endif
%if %BUILD_DVD
-%files dvd -f ../filelist_libxine1_dvd
+%files dvd -f ../filelist_libxine2_dvd
%endif
%if %BUILD_GNOME_VFS
-%files gnome-vfs -f ../filelist_libxine1_gnome_vfs
+%files gnome-vfs -f ../filelist_libxine2_gnome_vfs
%endif
%if %BUILD_FLAC
-%files flac -f ../filelist_libxine1_flac
+%files flac -f ../filelist_libxine2_flac
%endif
%if %BUILD_OGG
-%files ogg -f ../filelist_libxine1_ogg
+%files ogg -f ../filelist_libxine2_ogg
%endif
%if %BUILD_JACK
-%files jack -f ../filelist_libxine1_jack
+%files jack -f ../filelist_libxine2_jack
%endif
%changelog
diff --git a/src/input/Makefile.am b/src/input/Makefile.am
index d35641bb4..ae38de187 100644
--- a/src/input/Makefile.am
+++ b/src/input/Makefile.am
@@ -115,8 +115,9 @@ xineplug_inp_pnm_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
xineplug_inp_pnm_la_LDFLAGS = -avoid-version -module
xineplug_inp_dvb_la_SOURCES = input_dvb.c net_buf_ctrl.c
-xineplug_inp_dvb_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS)
-xineplug_inp_dvb_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
+xineplug_inp_dvb_la_DEPS = $(XDG_BASEDIR_DEPS)
+xineplug_inp_dvb_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(XDG_BASEDIR_LIBS)
+xineplug_inp_dvb_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) $(XDG_BASEDIR_CFLAGS)
xineplug_inp_dvb_la_LDFLAGS = -avoid-version -module
xineplug_inp_rtsp_la_SOURCES = input_rtsp.c net_buf_ctrl.c
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index 10d6eca55..fd2c5f570 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -66,17 +66,22 @@
* OSD - this will allow for filtering/searching of epg data - useful for automatic recording :)
*/
-/* pthread.h must be included first so rest of the headers are imported
- thread safely (on some systems). */
-#include <pthread.h>
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+/* pthread.h must be included first so rest of the headers are imported
+ thread safely (on some systems).
+ However, including it before config.h causes problems with asprintf not
+ being declared (glibc 2.3.6)
+*/
+#include <pthread.h>
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
@@ -95,6 +100,9 @@
#endif
#include <ctype.h>
+/* XDG */
+#include <basedir.h>
+
/* These will eventually be #include <linux/dvb/...> */
#include "dvb/dmx.h"
#include "dvb/frontend.h"
@@ -703,7 +711,7 @@ static int find_param(const Param *list, const char *name)
return list->value;;
}
-static int extract_channel_from_string(channel_t * channel,char * str,fe_type_t fe_type)
+static int extract_channel_from_string_internal(channel_t * channel,char * str,fe_type_t fe_type)
{
/*
try to extract channel data from a string in the following format
@@ -864,55 +872,69 @@ static int extract_channel_from_string(channel_t * channel,char * str,fe_type_t
return 0;
}
-static channel_t *load_channels(dvb_input_plugin_t *this, int *num_ch, fe_type_t fe_type) {
+static int extract_channel_from_string(channel_t *channel, char *str, fe_type_t fe_type)
+{
+ channel->name = NULL;
+ if (!extract_channel_from_string_internal(channel, str, fe_type))
+ return 0;
+ free (channel->name); /* without this, we have a possible memleak */
+ return -1;
+}
+
+static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch, fe_type_t fe_type) {
FILE *f;
char str[BUFSIZE];
char filename[BUFSIZE];
- channel_t *channels;
- int num_channels;
+ channel_t *channels = NULL;
+ int num_channels = 0;
+ int num_alloc = 0;
int i;
- xine_t *xine = this->class->xine;
-
- snprintf(filename, BUFSIZE, "%s/.xine/channels.conf", xine_get_homedir());
+ struct stat st;
- f = fopen(filename, "rb");
+ snprintf(filename, BUFSIZE, "%s/"PACKAGE"/channels.conf", xdgConfigHome(xine->basedir_handle));
+
+ f = fopen(filename, "r");
if (!f) {
- xprintf(xine, XINE_VERBOSITY_LOG, _("input_dvb: failed to open dvb channel file '%s'\n"), filename);
- _x_message(this->stream, XINE_MSG_FILE_NOT_FOUND, filename, "Please run the dvbscan utility.", NULL);
+ xprintf(xine, XINE_VERBOSITY_LOG, _("input_dvb: failed to open dvb channel file '%s': %s\n"), filename, strerror (errno));
+ if (!f && stream)
+ _x_message(stream, XINE_MSG_FILE_NOT_FOUND, filename, "Please run the dvbscan utility.", NULL);
return NULL;
}
-
- /*
- * count and alloc channels
- */
- num_channels = 0;
- while ( fgets (str, BUFSIZE, f)) {
- num_channels++;
- }
- fclose (f);
-
- if(num_channels > 0)
- xprintf (xine, XINE_VERBOSITY_DEBUG, "input_dvb: expecting %d channels...\n", num_channels);
- else {
- xprintf (xine, XINE_VERBOSITY_DEBUG, "input_dvb: no channels found in the file: giving up.\n");
+ if (fstat(fileno(f), &st) || !S_ISREG (st.st_mode)) {
+ xprintf(xine, XINE_VERBOSITY_LOG, _("input_dvb: dvb channel file '%s' is not a plain file\n"), filename);
+ fclose(f);
return NULL;
}
- channels = xine_xmalloc (sizeof (channel_t) * num_channels);
-
- _x_assert(channels != NULL);
-
/*
* load channel list
*/
- f = fopen (filename, "rb");
- num_channels = 0;
while ( fgets (str, BUFSIZE, f)) {
- if (extract_channel_from_string(&(channels[num_channels]),str,fe_type) < 0)
+ channel_t channel = {0};
+
+ /* lose trailing spaces & control characters */
+ i = strlen (str);
+ while (i && str[i - 1] <= ' ')
+ --i;
+ if (i == 0)
+ continue;
+ str[i] = 0;
+
+ if (extract_channel_from_string(&channel,str,fe_type) < 0)
continue;
+ if (num_channels >= num_alloc) {
+ channel_t *new_channels = xine_xmalloc((num_alloc += 32) * sizeof (channel_t));
+ _x_assert(new_channels != NULL);
+ memcpy(new_channels, channels, num_channels * sizeof (channel_t));
+ free(channels);
+ channels = new_channels;
+ }
+
+ channels[num_channels] = channel;
+
/* Initially there's no EPG data in the EPG structs. */
channels[num_channels].epg_count = 0;
for (i = 0; i < MAX_EPG_ENTRIES_PER_CHANNEL; ++i)
@@ -922,6 +944,9 @@ static channel_t *load_channels(dvb_input_plugin_t *this, int *num_ch, fe_type_t
}
fclose(f);
+ /* free any trailing unused entries */
+ channels = realloc (channels, num_channels * sizeof (channel_t));
+
if(num_channels > 0)
xprintf (xine, XINE_VERBOSITY_DEBUG, "input_dvb: found %d channels...\n", num_channels);
else {
@@ -934,6 +959,14 @@ static channel_t *load_channels(dvb_input_plugin_t *this, int *num_ch, fe_type_t
return channels;
}
+static void free_channel_list (channel_t *channels, int num_channels)
+{
+ if (channels)
+ while (--num_channels >= 0)
+ free(channels[num_channels].name);
+ free(channels);
+}
+
static int tuner_set_diseqc(tuner_t *this, channel_t *c)
{
struct dvb_diseqc_master_cmd cmd =
@@ -2624,7 +2657,7 @@ static void dvb_plugin_dispose (input_plugin_t *this_gen) {
}
}
if (this->channels)
- free (this->channels);
+ free_channel_list (this->channels, this->num_channels);
/* Make the EPG updater thread return. */
@@ -2719,7 +2752,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
* and assume that its format is valid for our tuner type
*/
- if (!(channels = load_channels(this, &num_channels, tuner->feinfo.type)))
+ if (!(channels = load_channels(this->class->xine, this->stream, &num_channels, tuner->feinfo.type)))
{
/* failed to load the channels */
tuner_dispose(tuner);
@@ -3120,77 +3153,49 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen,
{
dvb_input_class_t *class = (dvb_input_class_t *) this_gen;
channel_t *channels=NULL;
- FILE *f;
- char *tmpbuffer=xine_xmalloc(BUFSIZE);
- char *foobuffer=xine_xmalloc(BUFSIZE);
- char *str=tmpbuffer;
- int num_channels;
- int nlines=0;
- int default_channel;
- xine_cfg_entry_t lastchannel_enable;
+ char foobuffer[BUFSIZE];
+ int ch, apch, num_channels;
+ int default_channel = -1;
+ xine_cfg_entry_t lastchannel_enable = {0};
xine_cfg_entry_t lastchannel;
- _x_assert(tmpbuffer != NULL);
- _x_assert(foobuffer != NULL);
-
- snprintf(tmpbuffer, BUFSIZE, "%s/.xine/channels.conf", xine_get_homedir());
-
num_channels = 0;
- f=fopen (tmpbuffer,"rb");
- if(!f){ /* channels.conf not found in .xine */
- class->mrls[0]="Sorry, No channels.conf found";
- class->mrls[1]="Please run the dvbscan utility";
- class->mrls[2]="from the dvb drivers apps package";
- class->mrls[3]="and place the file in ~/.xine/";
+ if (!(channels = load_channels(class->xine, NULL, &num_channels, 0))) {
+ static char *placefile = NULL;
+ /* channels.conf not found in .xine */
+ class->mrls[0]="Sorry, no channels.conf found.";
+ class->mrls[1]="Please run the scan utility from the DVB";
+ class->mrls[2]="drivers apps package and place the file in";
+ if (!placefile)
+ asprintf (&placefile, "%s/"PACKAGE"/", xdgConfigHome(class->xine->basedir_handle));
+ class->mrls[3]=placefile;
*num_files=4;
- free(tmpbuffer);
- free(foobuffer);
return class->mrls;
- } else {
- while (fgets(str, BUFSIZE, f))
- nlines++;
}
- fclose (f);
- if (xine_config_lookup_entry(class->xine, "media.dvb.remember_channel", &lastchannel_enable))
- if (lastchannel_enable.num_value){
- num_channels++;
- if (xine_config_lookup_entry(class->xine, "media.dvb.last_channel", &lastchannel))
- default_channel = lastchannel.num_value;
- }
-
- if (nlines+lastchannel_enable.num_value >= MAX_AUTOCHANNELS)
- nlines = MAX_AUTOCHANNELS-lastchannel_enable.num_value;
-
- snprintf(tmpbuffer, BUFSIZE, "%s/.xine/channels.conf", xine_get_homedir());
-
-
- f=fopen (tmpbuffer,"rb");
- channels=xine_xmalloc(sizeof(channel_t)*(nlines+lastchannel_enable.num_value));
-
- _x_assert(channels != NULL);
-
-
- while (fgets(str,BUFSIZE,f) && num_channels < nlines+lastchannel_enable.num_value) {
- if (extract_channel_from_string (&(channels[num_channels]), str, 0) < 0)
- continue;
-
- sprintf(foobuffer,"dvb://%s",channels[num_channels].name);
- if(class->autoplaylist[num_channels])
- free(class->autoplaylist[num_channels]);
- class->autoplaylist[num_channels]=xine_xmalloc(128);
+ if (xine_config_lookup_entry(class->xine, "media.dvb.remember_channel", &lastchannel_enable)
+ && lastchannel_enable.num_value
+ && xine_config_lookup_entry(class->xine, "media.dvb.last_channel", &lastchannel))
+ {
+ default_channel = lastchannel.num_value - 1;
+ if (default_channel < 0 || default_channel >= num_channels)
+ default_channel = -1;
+ }
- _x_assert(class->autoplaylist[num_channels] != NULL);
-
- class->autoplaylist[num_channels]=strdup(foobuffer);
- num_channels++;
- }
+ for (ch = 0, apch = !!lastchannel_enable.num_value;
+ ch < num_channels && ch < MAX_AUTOCHANNELS;
+ ++ch, ++apch) {
+ snprintf(foobuffer, BUFSIZE, "dvb://%s", channels[ch].name);
+ free(class->autoplaylist[apch]);
+ class->autoplaylist[apch] = strdup(foobuffer);
+ _x_assert(class->autoplaylist[apch] != NULL);
+ }
if (lastchannel_enable.num_value){
- if (lastchannel.num_value > -1 && lastchannel.num_value < num_channels)
+ if (default_channel != -1)
/* plugin has been used before - channel is valid */
- sprintf (foobuffer, "dvb://%s", channels[lastchannel.num_value].name);
+ sprintf (foobuffer, "dvb://%s", channels[default_channel].name);
else
/* set a reasonable default - the first channel */
sprintf (foobuffer, "dvb://%s", num_channels ? channels[0].name : "0");
@@ -3198,13 +3203,10 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen,
class->autoplaylist[0]=strdup(foobuffer);
}
- free(tmpbuffer);
- free(foobuffer);
- free(channels);
- fclose(f);
+ free_channel_list(channels, num_channels);
- *num_files = num_channels;
- class->numchannels=nlines;
+ *num_files = num_channels + lastchannel_enable.num_value;
+ class->numchannels = *num_files;
return class->autoplaylist;
}
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c
index db4be14fa..432d93416 100644
--- a/src/video_out/video_out_xcbxv.c
+++ b/src/video_out/video_out_xcbxv.c
@@ -37,8 +37,6 @@
#include "config.h"
#endif
-#ifdef HAVE_XV
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1618,5 +1616,3 @@ const plugin_info_t xine_plugin_info[] EXPORTED = {
{ PLUGIN_VIDEO_OUT, 21, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
-
-#endif
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index 55340a9e7..2cba3c2b6 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -36,8 +36,6 @@
#include "config.h"
#endif
-#ifdef HAVE_XV
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1676,5 +1674,3 @@ const plugin_info_t xine_plugin_info[] EXPORTED = {
{ PLUGIN_VIDEO_OUT, 21, "xv", XINE_VERSION_CODE, &vo_info_xv_2, init_class_2 },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
-
-#endif