Skip to content

Commit

Permalink
ffaudio: Fix too-early exit from format detection loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlindgren90 committed Jan 2, 2014
1 parent dab1d0d commit 98d085a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/ffaudio/ffaudio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,16 @@ static AVInputFormat * get_format_by_content (const gchar * name, VFSFile * file
{
if (filled < size)
filled += vfs_fread (buf + filled, 1, size - filled, file);
if (filled < size)
break;

memset (buf + size, 0, AVPROBE_PADDING_SIZE);
AVProbeData d = {name, buf, size};
memset (buf + filled, 0, AVPROBE_PADDING_SIZE);
AVProbeData d = {name, buf, filled};
score = target;

f = av_probe_input_format2 (& d, TRUE, & score);
if (f)
break;

if (size < 16384)
if (size < 16384 && filled == size)
size *= 4;
else if (target > 10)
target = 10;
Expand All @@ -191,7 +189,7 @@ static AVInputFormat * get_format_by_content (const gchar * name, VFSFile * file
}

if (f)
AUDDBG ("Format %s, buffer size %d, score %d.\n", f->name, size, score);
AUDDBG ("Format %s, buffer size %d, score %d.\n", f->name, filled, score);
else
AUDDBG ("Format unknown.\n");

Expand Down

0 comments on commit 98d085a

Please sign in to comment.