Skip to content

Commit dba4b35

Browse files
authored
Merge pull request jgilje#17 from Sound-Linux-More/master
0.20211104: stdin only with a hyphen
2 parents 0bd1657 + 2e3d24a commit dba4b35

File tree

7 files changed

+14
-58
lines changed

7 files changed

+14
-58
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Farbrausch V2M player
33
SDL Port by github.com/jgilje
44

5+
0.20211104
6+
7+
stdin only with a hyphen
8+
59
0.20210505
610

711
removed 'force power size stdin buffer'

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cmake_minimum_required(VERSION 3.5)
22

33
set(MAJOR_VERSION 0)
4-
set(DATE_VERSION 20210505)
5-
set(V2M_MAN_DATE "05 May 2021")
4+
set(DATE_VERSION 20211104)
5+
set(V2M_MAN_DATE "04 Nov 2021")
66
set(V2M_VERSION ${MAJOR_VERSION}.${DATE_VERSION})
77
project(v2mplayer VERSION ${V2M_VERSION})
88

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sudo make install
2424

2525
```
2626
./v2mplayer v2m/0test.v2m
27-
zcat v2m/Dafunk--breeze.v2mz | ./v2mplayer
27+
zcat v2m/Dafunk--breeze.v2mz | ./v2mplayer -
2828
gzip -cdf v2m/Dafunk--breeze.v2mz | ./v2mplayer -o Dafunk--breeze.newest.v2m
2929
```
3030

doc/CHANGELOG

Lines changed: 0 additions & 47 deletions
This file was deleted.

doc/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.20180825
1+
0.20211104

man/man1/v2mplayer.1.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ v2mplayer
99
SDL Port by github.com/jgilje
1010

1111
.SH SYNOPSIS
12-
\fBv2mplayer\fP [options] <input_file_v2m | stdin>
12+
\fBv2mplayer\fP [options] input_file_v2m | - (stdin)
1313

1414
.SH OPTIONS
1515
.TP
@@ -30,7 +30,7 @@ help
3030

3131
.SH EXAMPLE
3232
\fBv2mplayer\fP v2m/0test.v2m
33-
zcat v2m/Dafunk--breeze.v2mz | \fBv2mplayer\fP
33+
zcat v2m/Dafunk--breeze.v2mz | \fBv2mplayer\fP -
3434

3535
.SH COPYRIGHT
3636
Copyright 2016 Joakim L. Gilje.

src/tinyplayer.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static void V2mPlayerTitle()
3535
}
3636
static 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

Comments
 (0)