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
5a52e913
Commit
5a52e913
authored
Sep 04, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/ogg_common: pass decoder to _type_detect()
Allow the function to be cancelled.
parent
18e45815
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
flac_decoder_plugin.c
src/decoder/flac_decoder_plugin.c
+1
-1
ogg_common.c
src/decoder/ogg_common.c
+2
-2
ogg_common.h
src/decoder/ogg_common.h
+1
-1
vorbis_decoder_plugin.c
src/decoder/vorbis_decoder_plugin.c
+1
-1
No files found.
src/decoder/flac_decoder_plugin.c
View file @
5a52e913
...
...
@@ -433,7 +433,7 @@ oggflac_scan_file(const char *file,
static
void
oggflac_decode
(
struct
decoder
*
decoder
,
struct
input_stream
*
input_stream
)
{
if
(
ogg_stream_type_detect
(
input_stream
)
!=
FLAC
)
if
(
ogg_stream_type_detect
(
decoder
,
input_stream
)
!=
FLAC
)
return
;
/* rewind the stream, because ogg_stream_type_detect() has
...
...
src/decoder/ogg_common.c
View file @
5a52e913
...
...
@@ -25,13 +25,13 @@
#include "ogg_common.h"
enum
ogg_stream_type
ogg_stream_type_detect
(
struct
input_stream
*
is
)
ogg_stream_type_detect
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
)
{
/* oggflac detection based on code in ogg123 and this post
* http://lists.xiph.org/pipermail/flac/2004-December/000393.html
* ogg123 trunk still doesn't have this patch as of June 2005 */
unsigned
char
buf
[
41
];
size_t
r
=
decoder_read
(
NULL
,
is
,
buf
,
sizeof
(
buf
));
size_t
r
=
decoder_read
(
decoder
,
is
,
buf
,
sizeof
(
buf
));
if
(
r
<
sizeof
(
buf
)
||
memcmp
(
buf
,
"OggS"
,
4
)
!=
0
)
return
VORBIS
;
...
...
src/decoder/ogg_common.h
View file @
5a52e913
...
...
@@ -32,6 +32,6 @@ enum ogg_stream_type {
};
enum
ogg_stream_type
ogg_stream_type_detect
(
struct
input_stream
*
is
);
ogg_stream_type_detect
(
struct
decoder
*
decoder
,
struct
input_stream
*
is
);
#endif
/* _OGG_COMMON_H */
src/decoder/vorbis_decoder_plugin.c
View file @
5a52e913
...
...
@@ -184,7 +184,7 @@ vorbis_stream_decode(struct decoder *decoder,
const
vorbis_info
*
vi
;
enum
decoder_command
cmd
=
DECODE_COMMAND_NONE
;
if
(
ogg_stream_type_detect
(
input_stream
)
!=
VORBIS
)
if
(
ogg_stream_type_detect
(
decoder
,
input_stream
)
!=
VORBIS
)
return
;
/* rewind the stream, because ogg_stream_type_detect() has
...
...
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