mirror of
https://github.com/alsa-project/alsa-tools.git
synced 2025-11-02 09:01:48 -05:00
Fix for piped AC3 stream
This commit is contained in:
parent
8d82fdf44e
commit
871e1499dc
1 changed files with 5 additions and 6 deletions
|
|
@ -40,6 +40,7 @@ init_spdif(void);
|
||||||
int
|
int
|
||||||
output_spdif(uint_8 *data_start, uint_8 *data_end, int quiet);
|
output_spdif(uint_8 *data_start, uint_8 *data_end, int quiet);
|
||||||
|
|
||||||
|
static int end_flag = 0;
|
||||||
static int quiet = 0;
|
static int quiet = 0;
|
||||||
|
|
||||||
static void help(void)
|
static void help(void)
|
||||||
|
|
@ -68,12 +69,10 @@ ssize_t fill_buffer(uint_8 **start,uint_8 **end)
|
||||||
|
|
||||||
bytes_read = fread(*start,1,CHUNK_SIZE,in_file);
|
bytes_read = fread(*start,1,CHUNK_SIZE,in_file);
|
||||||
|
|
||||||
if (feof(in_file))
|
if (feof(in_file) || ferror(in_file) || bytes_read < CHUNK_SIZE) {
|
||||||
return EOF;
|
end_flag = 1;
|
||||||
if (ferror(in_file))
|
|
||||||
return EOF;
|
|
||||||
if(bytes_read < CHUNK_SIZE)
|
|
||||||
return EOF;
|
return EOF;
|
||||||
|
}
|
||||||
|
|
||||||
*end = *start + bytes_read;
|
*end = *start + bytes_read;
|
||||||
return bytes_read;
|
return bytes_read;
|
||||||
|
|
@ -170,7 +169,7 @@ int main(int argc,char *argv[])
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (argc - optind <= 0) {
|
if (argc - optind <= 0) {
|
||||||
if (loop)
|
if (loop || end_flag)
|
||||||
break;
|
break;
|
||||||
in_file = stdin;
|
in_file = stdin;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue