@@ -35,7 +35,7 @@ static void V2mPlayerTitle()
3535}
3636static void V2mPlayerUsage ()
3737{
38- printf (" Usage : v2mplayer [options] < input_file_v2m> \n\n " );
38+ printf (" Usage : v2mplayer [options] input_file_v2m | - (stdin) \n\n " );
3939 printf (" options:\n " );
4040 printf (" -s N.N start at position (float, optional, in s., default = 0.0)\n " );
4141 printf (" -g N.N gain (float, optional, default = 1.0)\n " );
@@ -144,7 +144,7 @@ int main(int argc, char** argv)
144144 }
145145 }
146146
147- if (fhelp > 0 )
147+ if (( fhelp > 0 )||(optind + 1 > argc) )
148148 {
149149 V2mPlayerUsage ();
150150 return 1 ;
@@ -154,7 +154,8 @@ int main(int argc, char** argv)
154154 uint64_t size;
155155 unsigned int blksz = 4096 , read = 0 , eofcnt = 0 ;
156156 char ch;
157- if (optind + 1 > argc)
157+ const char *v2m_filename = argv[optind];
158+ if (strcmp (v2m_filename, " -" ) == 0 )
158159 {
159160 file = stdin;
160161 eofcnt = 0 ;
@@ -188,8 +189,6 @@ int main(int argc, char** argv)
188189 printf (" Now Playing: stdin(%d[%lu])\n " , read, size);
189190 size = read;
190191 } else {
191- const char *v2m_filename = argv[optind];
192-
193192 file = fopen (v2m_filename, " rb" );
194193 if (file == NULL )
195194 {
0 commit comments