[MPlayer-dev-eng] How to test main function in subreader.c?

Sunsik Park lukepss at gmail.com
Tue Mar 18 12:27:16 CET 2008


In subreader.c

for testing

#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);
>     }
>     sub_cp = argv[2];
>     subd = sub_read_file(argv[1]);
>     if(!subd){
>         printf("Couldn't load file.\n");
>         exit(1);
>     }
>
>     list_sub_file(subd);
>
>     return 0;
> }
> #endif
>
>

DUBPSUBS was not defined .

So, I defined DUBPSUBS in subreader.c ,as " #define DUMPSUBS".
1. make ( Mplayer source )

resurlt :

>     ...
>     spudec.c:351: warning: 'start_pts' may be used uninitialized in this function
>     cc -I./libavcodec -I./libavformat -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -I. -I. -I./libavutil -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=pentium4 -mtune=pentium4 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -I/usr/include/freetype2 -I/usr/include   -c -o sub_cc.o sub_cc.c
>     cc -I./libavcodec -I./libavformat -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -I. -I. -I./libavutil -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 -march=pentium4 -mtune=pentium4 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -I/usr/include/freetype2 -I/usr/include   -c -o subreader.o subreader.c
>     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'
>     make: *** [subreader.o] 오류 1
>
>
2. gcc subreader.c ( only subreader.c )

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 .

How to test  main function in subreader.c ?

I attached subreader.c ( original source ).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: subreader.c
Type: text/x-csrc
Size: 67460 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080318/ea24e08c/attachment.c>


More information about the MPlayer-dev-eng mailing list