mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 11:24:05 +00:00
[y4m] Fix y4m header parsing problems with piped input by removing ungetc()
This commit is contained in:
parent
a120b53395
commit
5ea913287b
|
@ -355,9 +355,6 @@ static bool read_header(FILE* input, uvg_config* config) {
|
|||
buffer[i] = getc(input);
|
||||
// Start code of frame data
|
||||
if (buffer[i] == 0x0A) {
|
||||
for (; i > 0; i--) {
|
||||
ungetc(buffer[i], input);
|
||||
}
|
||||
end_of_header = true;
|
||||
break;
|
||||
}
|
||||
|
@ -381,10 +378,7 @@ static bool read_header(FILE* input, uvg_config* config) {
|
|||
// Framerate (or start code of frame)
|
||||
case 'F':
|
||||
// The header has no ending signature other than the start code of a frame
|
||||
if (i > 5 && strncmp(buffer, "FRAME", 5) == 0) {
|
||||
for (; i > 0; i--) {
|
||||
ungetc(buffer[i], input);
|
||||
}
|
||||
if (i >= 4 && strncmp(buffer, "FRAME", 5) == 0) {
|
||||
end_of_header = true;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue