[MPlayer-dev-eng] [PATCH] MPlayer doesn't build with our current libdvdnav+libdvdread

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Thu Nov 22 22:33:14 CET 2007


Two issues.

1. If both libdvdnav and libdvdread are used, wrong header locations are
used, leading to:

+ /usr/bin/make
./version.sh `cc -dumpversion`
cc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -ffast-math -I./libavcodec -I./libavformat -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -I. -I. -I./libavutil -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -ffast-math -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I/usr/include/  -I/usr/include/SDL  -D_REENTRANT -D_REENTRANT   -I/usr/include/cdda -I/usr/include/freetype2 -I/usr/include/fribidi   -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -I/usr/include -I/usr/include/dvdnav   -c -o mplayer.o mplayer.c
In file included from mplayer.c:169:
stream/stream_dvd.h:7:24: error: dvd_reader.h: No such file or directory
stream/stream_dvd.h:8:23: error: ifo_types.h: No such file or directory
stream/stream_dvd.h:9:22: error: ifo_read.h: No such file or directory
stream/stream_dvd.h:10:22: error: nav_read.h: No such file or directory

2. Since current libdvdread is similar to our internal, these #ifdefs in stream_dvd.c
[...]
#ifdef USE_DVDREAD_INTERNAL
          if(pgc->audio_control[i].present) {
#else
          if(pgc->audio_control[i] & 0x8000) {
#endif
[...]

lead to:
cc -I../libavcodec -I../libavformat -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -I. -I.. -I../libavutil -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -ffast-math -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I/usr/include/  -I/usr/include/SDL  -D_REENTRANT -D_REENTRANT   -I/usr/include/cdda -I/usr/include/freetype2 -I/usr/include/fribidi   -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -I/usr/include -I/usr/include/dvdnav   -c -o stream_dvd.o stream_dvd.c
stream_dvd.c: In function ‘dvd_parse_chapter_range’:
stream_dvd.c:167: warning: passing argument 2 of ‘strtol’ from incompatible pointer type
stream_dvd.c: In function ‘open_s’:
stream_dvd.c:933: error: invalid operands to binary &
stream_dvd.c:951: error: invalid operands to binary >>
stream_dvd.c:1002: error: invalid operands to binary &
stream_dvd.c:1023: error: invalid operands to binary >>
stream_dvd.c:1029: error: invalid operands to binary >>
make: *** [stream_dvd.o] Error 1

Attached patch fixes both problems. Shouldn't we just remove the internal
libdvdread, by the way?

Regards,
R.

-- 
MPlayer developer and RPMs maintainer: http://mplayerhq.hu http://rpm.livna.org
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
diff -up MPlayer-1.0rc2/stream/stream_dvd.h.dvdread MPlayer-1.0rc2/stream/stream_dvd.h
--- MPlayer-1.0rc2/stream/stream_dvd.h.dvdread	2007-10-07 21:49:26.000000000 +0200
+++ MPlayer-1.0rc2/stream/stream_dvd.h	2007-11-22 20:21:10.000000000 +0100
@@ -3,11 +3,6 @@
 #include "dvdread/ifo_types.h"
 #include "dvdread/ifo_read.h"
 #include "dvdread/nav_read.h"
-#elif defined(USE_DVDNAV)
-#include <dvd_reader.h>
-#include <ifo_types.h>
-#include <ifo_read.h>
-#include <nav_read.h>
 #else
 #include <dvdread/dvd_reader.h>
 #include <dvdread/ifo_types.h>
diff -up MPlayer-1.0rc2/stream/stream_dvd.c.dvdread MPlayer-1.0rc2/stream/stream_dvd.c
--- MPlayer-1.0rc2/stream/stream_dvd.c.dvdread	2007-10-07 21:49:26.000000000 +0200
+++ MPlayer-1.0rc2/stream/stream_dvd.c	2007-11-22 20:28:59.000000000 +0100
@@ -928,11 +928,7 @@ static int open_s(stream_t *stream,int m
       if(vts_file->vts_pgcit) {
         int i;
         for(i=0;i<8;i++)
-#ifdef USE_DVDREAD_INTERNAL
           if(pgc->audio_control[i].present) {
-#else
-          if(pgc->audio_control[i] & 0x8000) {
-#endif
             audio_attr_t * audio = &vts_file->vtsi_mat->vts_audio_attr[i];
             int language = 0;
             char tmp[] = "unknown";
@@ -946,11 +942,7 @@ static int open_s(stream_t *stream,int m
             }
 
             audio_stream->language=language;
-#ifdef USE_DVDREAD_INTERNAL
             audio_stream->id=pgc->audio_control[i].s_audio;
-#else
-            audio_stream->id=pgc->audio_control[i] >> 8 & 7;
-#endif
             switch(audio->audio_format) {
               case 0: // ac3
                 audio_stream->id+=FIRST_AC3_AID;
@@ -997,11 +989,7 @@ static int open_s(stream_t *stream,int m
 
       d->nr_of_subtitles=0;
       for(i=0;i<32;i++)
-#ifdef USE_DVDREAD_INTERNAL
       if(pgc->subp_control[i].present) {
-#else
-      if(pgc->subp_control[i] & 0x80000000) {
-#endif
         subp_attr_t * subtitle = &vts_file->vtsi_mat->vts_subp_attr[i];
         video_attr_t *video = &vts_file->vtsi_mat->vts_video_attr;
         int language = 0;
@@ -1018,17 +1006,9 @@ static int open_s(stream_t *stream,int m
         sub_stream->language=language;
         sub_stream->id=d->nr_of_subtitles;
         if(video->display_aspect_ratio == 0) /* 4:3 */
-#ifdef USE_DVDREAD_INTERNAL
           sub_stream->id = pgc->subp_control[i].s_4p3;
-#else
-          sub_stream->id = pgc->subp_control[i] >> 24 & 31;
-#endif
         else if(video->display_aspect_ratio == 3) /* 16:9 */
-#ifdef USE_DVDREAD_INTERNAL
           sub_stream->id = pgc->subp_control[i].s_lbox;
-#else
-          sub_stream->id = pgc->subp_control[i] >> 8 & 31;
-#endif
 
         mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDsubtitleLanguage, sub_stream->id, tmp);
         mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SUBTITLE_ID=%d\n", sub_stream->id);


More information about the MPlayer-dev-eng mailing list