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
63c3ebee
Commit
63c3ebee
authored
Nov 21, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flac, oggflac: use GLib instead of utils.h/log.h
parent
f15fc4e9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
32 deletions
+28
-32
_flac_common.c
src/decoder/_flac_common.c
+4
-5
_flac_common.h
src/decoder/_flac_common.h
+5
-0
flac_plugin.c
src/decoder/flac_plugin.c
+9
-14
oggflac_plugin.c
src/decoder/oggflac_plugin.c
+10
-13
No files found.
src/decoder/_flac_common.c
View file @
63c3ebee
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
*/
*/
#include "_flac_common.h"
#include "_flac_common.h"
#include "../log.h"
#include <FLAC/format.h>
#include <FLAC/format.h>
#include <FLAC/metadata.h>
#include <FLAC/metadata.h>
...
@@ -177,16 +176,16 @@ void flac_error_common_cb(const char *plugin,
...
@@ -177,16 +176,16 @@ void flac_error_common_cb(const char *plugin,
switch
(
status
)
{
switch
(
status
)
{
case
FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC
:
case
FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC
:
ERROR
(
"%s lost sync
\n
"
,
plugin
);
g_warning
(
"%s lost sync
\n
"
,
plugin
);
break
;
break
;
case
FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER
:
case
FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER
:
ERROR
(
"bad %s header
\n
"
,
plugin
);
g_warning
(
"bad %s header
\n
"
,
plugin
);
break
;
break
;
case
FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH
:
case
FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH
:
ERROR
(
"%s crc mismatch
\n
"
,
plugin
);
g_warning
(
"%s crc mismatch
\n
"
,
plugin
);
break
;
break
;
default:
default:
ERROR
(
"unknown %s error
\n
"
,
plugin
);
g_warning
(
"unknown %s error
\n
"
,
plugin
);
}
}
}
}
...
...
src/decoder/_flac_common.h
View file @
63c3ebee
...
@@ -24,6 +24,11 @@
...
@@ -24,6 +24,11 @@
#include "../decoder_api.h"
#include "../decoder_api.h"
#include <glib.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "flac"
#include <FLAC/export.h>
#include <FLAC/export.h>
#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7
#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7
# include <FLAC/seekable_stream_decoder.h>
# include <FLAC/seekable_stream_decoder.h>
...
...
src/decoder/flac_plugin.c
View file @
63c3ebee
...
@@ -17,8 +17,6 @@
...
@@ -17,8 +17,6 @@
*/
*/
#include "_flac_common.h"
#include "_flac_common.h"
#include "../utils.h"
#include "../log.h"
#include <assert.h>
#include <assert.h>
...
@@ -128,7 +126,8 @@ static void flacPrintErroredState(FLAC__SeekableStreamDecoderState state)
...
@@ -128,7 +126,8 @@ static void flacPrintErroredState(FLAC__SeekableStreamDecoderState state)
case
FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED
:
case
FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED
:
str
=
"decoder uninitialized"
;
str
=
"decoder uninitialized"
;
}
}
ERROR
(
"flac %s
\n
"
,
str
);
g_warning
(
"%s
\n
"
,
str
);
}
}
static
int
flac_init
(
FLAC__SeekableStreamDecoder
*
dec
,
static
int
flac_init
(
FLAC__SeekableStreamDecoder
*
dec
,
...
@@ -186,7 +185,8 @@ static void flacPrintErroredState(FLAC__StreamDecoderState state)
...
@@ -186,7 +185,8 @@ static void flacPrintErroredState(FLAC__StreamDecoderState state)
case
FLAC__STREAM_DECODER_UNINITIALIZED
:
case
FLAC__STREAM_DECODER_UNINITIALIZED
:
str
=
"decoder uninitialized"
;
str
=
"decoder uninitialized"
;
}
}
ERROR
(
"flac %s
\n
"
,
str
);
g_warning
(
"%s
\n
"
,
str
);
}
}
#endif
/* FLAC_API_VERSION_CURRENT >= 7 */
#endif
/* FLAC_API_VERSION_CURRENT >= 7 */
...
@@ -251,8 +251,7 @@ flacMetadataDup(const char *file, bool *vorbisCommentFound)
...
@@ -251,8 +251,7 @@ flacMetadataDup(const char *file, bool *vorbisCommentFound)
default:
default:
err
=
FLAC__Metadata_SimpleIteratorStatusString
[
s
];
err
=
FLAC__Metadata_SimpleIteratorStatusString
[
s
];
}
}
DEBUG
(
"flacMetadataDup: Reading '%s' "
g_debug
(
"Reading '%s' metadata gave the following error: %s
\n
"
,
"metadata gave the following error: %s
\n
"
,
file
,
err
);
file
,
err
);
FLAC__metadata_simple_iterator_delete
(
it
);
FLAC__metadata_simple_iterator_delete
(
it
);
return
ret
;
return
ret
;
...
@@ -288,8 +287,7 @@ static struct tag *flacTagDup(const char *file)
...
@@ -288,8 +287,7 @@ static struct tag *flacTagDup(const char *file)
ret
=
flacMetadataDup
(
file
,
&
foundVorbisComment
);
ret
=
flacMetadataDup
(
file
,
&
foundVorbisComment
);
if
(
!
ret
)
{
if
(
!
ret
)
{
DEBUG
(
"flacTagDup: Failed to grab information from: %s
\n
"
,
g_debug
(
"Failed to grab information from: %s
\n
"
,
file
);
file
);
return
NULL
;
return
NULL
;
}
}
if
(
!
foundVorbisComment
)
{
if
(
!
foundVorbisComment
)
{
...
@@ -319,7 +317,7 @@ flac_decode_internal(struct decoder * decoder, struct input_stream *inStream,
...
@@ -319,7 +317,7 @@ flac_decode_internal(struct decoder * decoder, struct input_stream *inStream,
#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7
#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7
if
(
!
FLAC__stream_decoder_set_metadata_respond
(
flacDec
,
FLAC__METADATA_TYPE_VORBIS_COMMENT
))
if
(
!
FLAC__stream_decoder_set_metadata_respond
(
flacDec
,
FLAC__METADATA_TYPE_VORBIS_COMMENT
))
{
{
DEBUG
(
__FILE__
":
Failed to set metadata respond
\n
"
);
g_debug
(
"
Failed to set metadata respond
\n
"
);
}
}
#endif
#endif
...
@@ -376,11 +374,8 @@ fail:
...
@@ -376,11 +374,8 @@ fail:
if
(
flacDec
)
if
(
flacDec
)
flac_delete
(
flacDec
);
flac_delete
(
flacDec
);
if
(
err
)
{
if
(
err
)
ERROR
(
"flac %s
\n
"
,
err
);
g_warning
(
"%s
\n
"
,
err
);
return
;
}
return
;
}
}
static
void
static
void
...
...
src/decoder/oggflac_plugin.c
View file @
63c3ebee
...
@@ -22,9 +22,6 @@
...
@@ -22,9 +22,6 @@
#include "_flac_common.h"
#include "_flac_common.h"
#include "_ogg_common.h"
#include "_ogg_common.h"
#include "../utils.h"
#include "../log.h"
#include <OggFLAC/seekable_stream_decoder.h>
#include <OggFLAC/seekable_stream_decoder.h>
static
void
oggflac_cleanup
(
FlacData
*
data
,
static
void
oggflac_cleanup
(
FlacData
*
data
,
...
@@ -120,25 +117,25 @@ static void oggflacPrintErroredState(OggFLAC__SeekableStreamDecoderState state)
...
@@ -120,25 +117,25 @@ static void oggflacPrintErroredState(OggFLAC__SeekableStreamDecoderState state)
{
{
switch
(
state
)
{
switch
(
state
)
{
case
OggFLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR
:
case
OggFLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR
:
ERROR
(
"oggflac allocation error
\n
"
);
g_warning
(
"oggflac allocation error
\n
"
);
break
;
break
;
case
OggFLAC__SEEKABLE_STREAM_DECODER_READ_ERROR
:
case
OggFLAC__SEEKABLE_STREAM_DECODER_READ_ERROR
:
ERROR
(
"oggflac read error
\n
"
);
g_warning
(
"oggflac read error
\n
"
);
break
;
break
;
case
OggFLAC__SEEKABLE_STREAM_DECODER_SEEK_ERROR
:
case
OggFLAC__SEEKABLE_STREAM_DECODER_SEEK_ERROR
:
ERROR
(
"oggflac seek error
\n
"
);
g_warning
(
"oggflac seek error
\n
"
);
break
;
break
;
case
OggFLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR
:
case
OggFLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR
:
ERROR
(
"oggflac seekable stream error
\n
"
);
g_warning
(
"oggflac seekable stream error
\n
"
);
break
;
break
;
case
OggFLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED
:
case
OggFLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED
:
ERROR
(
"oggflac decoder already initialized
\n
"
);
g_warning
(
"oggflac decoder already initialized
\n
"
);
break
;
break
;
case
OggFLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK
:
case
OggFLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK
:
ERROR
(
"invalid oggflac callback
\n
"
);
g_warning
(
"invalid oggflac callback
\n
"
);
break
;
break
;
case
OggFLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED
:
case
OggFLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED
:
ERROR
(
"oggflac decoder uninitialized
\n
"
);
g_warning
(
"oggflac decoder uninitialized
\n
"
);
break
;
break
;
case
OggFLAC__SEEKABLE_STREAM_DECODER_OK
:
case
OggFLAC__SEEKABLE_STREAM_DECODER_OK
:
case
OggFLAC__SEEKABLE_STREAM_DECODER_SEEKING
:
case
OggFLAC__SEEKABLE_STREAM_DECODER_SEEKING
:
...
@@ -233,17 +230,17 @@ static OggFLAC__SeekableStreamDecoder
...
@@ -233,17 +230,17 @@ static OggFLAC__SeekableStreamDecoder
(
void
*
)
data
);
(
void
*
)
data
);
if
(
!
s
)
{
if
(
!
s
)
{
ERROR
(
"oggflac problem before init()
\n
"
);
g_warning
(
"oggflac problem before init()
\n
"
);
goto
fail
;
goto
fail
;
}
}
if
(
OggFLAC__seekable_stream_decoder_init
(
decoder
)
!=
if
(
OggFLAC__seekable_stream_decoder_init
(
decoder
)
!=
OggFLAC__SEEKABLE_STREAM_DECODER_OK
)
{
OggFLAC__SEEKABLE_STREAM_DECODER_OK
)
{
ERROR
(
"oggflac problem doing init()
\n
"
);
g_warning
(
"oggflac problem doing init()
\n
"
);
goto
fail
;
goto
fail
;
}
}
if
(
!
OggFLAC__seekable_stream_decoder_process_until_end_of_metadata
if
(
!
OggFLAC__seekable_stream_decoder_process_until_end_of_metadata
(
decoder
))
{
(
decoder
))
{
ERROR
(
"oggflac problem reading metadata
\n
"
);
g_warning
(
"oggflac problem reading metadata
\n
"
);
goto
fail
;
goto
fail
;
}
}
...
...
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