[MPlayer-dev-eng] How to test main function in subreader.c?
Sunsik Park
lukepss at gmail.com
Wed Mar 19 03:59:24 CET 2008
now, I solve this problem
I did like that.
I insert this code, " mp_smg_init() ", at main function in subreader.c
./mplayer test.sub
>
It is successful.
Thank you.
08. 3. 19, Sunsik Park <lukepss at gmail.com>님이 작성:
>
> Thank you,
> I show you that I did, step by step.
>
> 1.configure
>
> ./configure --prefix=/home/keti/mplayer/ --disable-ftp --disable-tv
> > --disable-tv-teletext --disable-tv-v4l2 \
> > --disable-tv-v4l1 --disable-dvdread --disable-network --disable-dvdnav
> > --disable-dvdread-internal --disable-qtx \
> > --disable-xanim --disable-win32dll --disable-faad-external
> > --disable-faad-internal --disable-theora --disable-pnm \
> > --disable-png --disable-fbdev --disable-tga --disable-md5sum
> > --disable-tremor-internal --disable-mp3lib \
> > --disable-real --disable-libmpeg2 --disable-iconv
> >
>
> 2. I edited subreader.c
>
> -#define DUMPSUBS
>
> #include "subreader.h"
> > #include "stream/stream.h"
> >
> > /* by LukePark*/
> > #define DUMPSUBS
> >
> > #ifdef HAVE_ENCA
> > #include <enca.h>
> >
>
> - main in subreader.c
>
> #ifdef DUMPSUBS
> > int main(int argc, char **argv) { // for testing
> > sub_data *subd;
> >
> > if(argc<2){
> > printf("\nUsage: subreader filename.sub\n\n");
> > exit(1);
> > }
> > /* by LukePark */
> > // sub_cp = argv[2];
> > // subd = sub_read_file(argv[1]);
> >
> subd = sub_read_file(argv[1],0); /* subreader.c:2364: error: too few
> > arguments to function 'sub_read_file'*/
> >
> > if(!subd){
> > printf("Couldn't load file.\n");
> > exit(1);
> > }
> >
> > list_sub_file(subd);
> >
> > return 0;
> > }
> > #endif
> >
>
> 3. make
>
> > subreader.o: In function `main':
> > subreader.c:(.text+0x49b9): multiple definition of `main'
> > mplayer.o:mplayer.c:(.text+0x235c): first defined here
> > libvo/libosd.a(sub.o):(.bss+0x10): multiple definition of `sub_utf8'
> > subreader.o:(.bss+0x10): first defined here
> > collect2: ld returned 1 exit status
> > make: *** [mplayer] 오류 1
> >
>
> - I edited libvo/sub.c. because "sub_utf8" defined in sub.h as
> "extern int sub_utf8"
>
> > int sub_unicode=0;
> >
> > /* by LukePark */
> > //int sub_utf8=0;
> >
> > int sub_pos=100;
> > int sub_width_p=100;
> >
>
> 4. make
>
> > subreader.o: In function `main':
> > subreader.c:(.text+0x49b9): multiple definition of `main'
> > mplayer.o:mplayer.c:(.text+0x235c): first defined here
> > collect2: ld returned 1 exit status
> > make: *** [mplayer] 오류 1
> >
> >
> >
> > - I del main function in mplayer.c ( as comment)
>
> 5.make
>
> subreader.o: In function `main':
> > subreader.c:(.text+0x49b9): multiple definition of `main'
> > mencoder.o:mencoder.c:(.text+0x3e1): first defined here
> > collect2: ld returned 1 exit status
> > make: *** [mencoder] 오류 1
> >
>
> - I del main function in mencoder.c ( as comment)
>
> 6. compiling is successful
> 7. execution
>
> > desktop:~/MPlayer-1.0rc2# ./mplayer
> > Usage: subreader filename.sub
> > desktop:~/MPlayer-1.0rc2# ./mplayer test.sub
> > desktop:~/MPlayer-1.0rc2#
> >
>
> I can't confirm any result of "list_sub_file" function. I know , becauset
> I deleteed main function in mplayer.c and mencoder.c
>
> How can I solve this problem ?
>
>
> 2008/3/18, Diego Biurrun <diego at biurrun.de>:
> >
> > On Tue, Mar 18, 2008 at 08:27:16PM +0900, Sunsik Park wrote:
> > >
> > > [...]
> >
> > >
> > > So, I defined DUBPSUBS in subreader.c ,as " #define DUMPSUBS".
> > > 1. make ( Mplayer source )
> > >
> >
> > > [...]
> >
> > >
> > > result :
> > >
> > > > In file included from subreader.c:21:
> > > > stream/stream.h:4:20: error: mp_msg.h: No such file or directory
> > > > subreader.c: In function 'sub_read_file':
> > > > subreader.c:1380: error: 'sub_utf8_prev' undeclared (first use
> > in this function)
> > > > subreader.c:1380: error: (Each undeclared identifier is reported
> > only once
> > > > subreader.c:1380: error: for each function it appears in.)
> > > > subreader.c: In function 'main':
> > > > subreader.c:2364: error: too few arguments to function
> > 'sub_read_file'
> > > >
> > > Two ways was failed .
> >
> >
> > One way fixed.
> >
> >
> > > How to test main function in subreader.c ?
> >
> >
> > Fix the invocation of sub_read_file. The API was likely changed at some
> > point but this part was never updated.
> >
> >
> > > I attached subreader.c ( original source ).
> >
> >
> > This is completely unnecessary, you can be sure that we have subreader.c
> > source at hand.
> >
> > Diego
> > _______________________________________________
> > MPlayer-dev-eng mailing list
> > MPlayer-dev-eng at mplayerhq.hu
> > https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
> >
>
>
More information about the MPlayer-dev-eng
mailing list