Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fdk-aac
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
fdk-aac
Commits
e7348e7a
Commit
e7348e7a
authored
Feb 07, 2014
by
Martin Storsjo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support streamed wav files with a 0 bytes data chunk
parent
1652691e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
wavreader.c
wavreader.c
+7
-1
No files found.
wavreader.c
View file @
e7348e7a
...
@@ -34,6 +34,8 @@ struct wav_reader {
...
@@ -34,6 +34,8 @@ struct wav_reader {
int
channels
;
int
channels
;
int
byte_rate
;
int
byte_rate
;
int
block_align
;
int
block_align
;
int
streamed
;
};
};
static
uint32_t
read_tag
(
struct
wav_reader
*
wr
)
{
static
uint32_t
read_tag
(
struct
wav_reader
*
wr
)
{
...
@@ -113,6 +115,10 @@ void* wav_read_open(const char *filename) {
...
@@ -113,6 +115,10 @@ void* wav_read_open(const char *filename) {
}
else
if
(
subtag
==
TAG
(
'd'
,
'a'
,
't'
,
'a'
))
{
}
else
if
(
subtag
==
TAG
(
'd'
,
'a'
,
't'
,
'a'
))
{
data_pos
=
ftell
(
wr
->
wav
);
data_pos
=
ftell
(
wr
->
wav
);
wr
->
data_length
=
sublength
;
wr
->
data_length
=
sublength
;
if
(
!
wr
->
data_length
)
{
wr
->
streamed
=
1
;
return
wr
;
}
fseek
(
wr
->
wav
,
sublength
,
SEEK_CUR
);
fseek
(
wr
->
wav
,
sublength
,
SEEK_CUR
);
}
else
{
}
else
{
fseek
(
wr
->
wav
,
sublength
,
SEEK_CUR
);
fseek
(
wr
->
wav
,
sublength
,
SEEK_CUR
);
...
@@ -154,7 +160,7 @@ int wav_read_data(void* obj, unsigned char* data, unsigned int length) {
...
@@ -154,7 +160,7 @@ int wav_read_data(void* obj, unsigned char* data, unsigned int length) {
int
n
;
int
n
;
if
(
wr
->
wav
==
NULL
)
if
(
wr
->
wav
==
NULL
)
return
-
1
;
return
-
1
;
if
(
length
>
wr
->
data_length
)
if
(
length
>
wr
->
data_length
&&
!
wr
->
streamed
)
length
=
wr
->
data_length
;
length
=
wr
->
data_length
;
n
=
fread
(
data
,
1
,
length
,
wr
->
wav
);
n
=
fread
(
data
,
1
,
length
,
wr
->
wav
);
wr
->
data_length
-=
length
;
wr
->
data_length
-=
length
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment