Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
44b55bff
Commit
44b55bff
authored
Feb 28, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audiofile: no CamelCase
Renamed several variables and a function.
parent
2a69aba7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
audiofile_plugin.c
src/decoder/audiofile_plugin.c
+9
-9
No files found.
src/decoder/audiofile_plugin.c
View file @
44b55bff
...
...
@@ -31,7 +31,7 @@
/* pick 1020 since its devisible for 8,16,24, and 32-bit audio */
#define CHUNK_SIZE 1020
static
int
getAudiofileTotalTime
(
const
char
*
file
)
static
int
audiofile_get_duration
(
const
char
*
file
)
{
int
total_time
;
AFfilehandle
af_fp
=
afOpenFile
(
file
,
"r"
,
NULL
);
...
...
@@ -79,7 +79,7 @@ audiofile_file_seek(AFvirtualfile *vfile, long offset, int is_relative)
{
struct
input_stream
*
is
=
(
struct
input_stream
*
)
vfile
->
closure
;
int
whence
=
(
is_relative
?
SEEK_CUR
:
SEEK_SET
);
if
(
input_stream_seek
(
is
,
offset
,
whence
))
{
if
(
input_stream_seek
(
is
,
offset
,
whence
))
{
return
is
->
offset
;
}
else
{
return
-
1
;
...
...
@@ -101,7 +101,7 @@ setup_virtual_fops(struct input_stream *stream)
}
static
void
audiofile_stream
decode
(
struct
decoder
*
decoder
,
struct
input_stream
*
inStream
)
audiofile_stream
_decode
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
)
{
AFvirtualfile
*
vf
;
int
fs
,
frame_count
;
...
...
@@ -109,11 +109,11 @@ audiofile_streamdecode(struct decoder * decoder, struct input_stream *inStream)
int
bits
;
struct
audio_format
audio_format
;
float
total_time
;
uint16_t
bit
R
ate
;
uint16_t
bit
_r
ate
;
int
ret
,
current
=
0
;
char
chunk
[
CHUNK_SIZE
];
vf
=
setup_virtual_fops
(
i
nStream
);
vf
=
setup_virtual_fops
(
i
s
);
af_fp
=
afOpenVirtualFile
(
vf
,
"r"
,
NULL
);
if
(
af_fp
==
AF_NULL_FILEHANDLE
)
{
...
...
@@ -142,7 +142,7 @@ audiofile_streamdecode(struct decoder * decoder, struct input_stream *inStream)
total_time
=
((
float
)
frame_count
/
(
float
)
audio_format
.
sample_rate
);
bit
Rate
=
(
uint16_t
)(
inStream
->
size
*
8
.
0
/
total_time
/
1000
.
0
+
0
.
5
);
bit
_rate
=
(
uint16_t
)(
is
->
size
*
8
.
0
/
total_time
/
1000
.
0
+
0
.
5
);
fs
=
(
int
)
afGetVirtualFrameSize
(
af_fp
,
AF_DEFAULT_TRACK
,
1
);
...
...
@@ -165,7 +165,7 @@ audiofile_streamdecode(struct decoder * decoder, struct input_stream *inStream)
decoder_data
(
decoder
,
NULL
,
chunk
,
ret
*
fs
,
(
float
)
current
/
(
float
)
audio_format
.
sample_rate
,
bit
R
ate
,
NULL
);
bit
_r
ate
,
NULL
);
}
while
(
decoder_get_command
(
decoder
)
!=
DECODE_COMMAND_STOP
);
afCloseFile
(
af_fp
);
...
...
@@ -174,7 +174,7 @@ audiofile_streamdecode(struct decoder * decoder, struct input_stream *inStream)
static
struct
tag
*
audiofile_tag_dup
(
const
char
*
file
)
{
struct
tag
*
ret
=
NULL
;
int
total_time
=
getAudiofileTotalTime
(
file
);
int
total_time
=
audiofile_get_duration
(
file
);
if
(
total_time
>=
0
)
{
ret
=
tag_new
();
...
...
@@ -199,7 +199,7 @@ static const char *const audiofile_mime_types[] = {
const
struct
decoder_plugin
audiofilePlugin
=
{
.
name
=
"audiofile"
,
.
stream_decode
=
audiofile_streamdecode
,
.
stream_decode
=
audiofile_stream
_
decode
,
.
tag_dup
=
audiofile_tag_dup
,
.
suffixes
=
audiofile_suffixes
,
.
mime_types
=
audiofile_mime_types
,
...
...
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