Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
vlc
Commits
677174e7
Commit
677174e7
authored
Feb 15, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for FLAC version 1.1.3 - fixes #921
parent
839ae28b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
3 deletions
+62
-3
THANKS
THANKS
+1
-0
modules/codec/flac.c
modules/codec/flac.c
+61
-3
No files found.
THANKS
View file @
677174e7
...
...
@@ -24,6 +24,7 @@ Arkadiusz Miskiewicz <misiek at pld.ORG.PL> - autoconf and Makefile patches
Ari Constâncio <ari.constancio at gmail d0t com> - Portuguese localisation
Arnaud Gomes-do-Vale <arnaud at carrosse.frmug.org> - autoconf patches
Arwed v. Merkatz <v.merkatz at gmx dot net> - Gamma correction for adjust filter
Ats (through Trac) - libFLAC >= 1.1.3 API support
Aurelien - Patch for modules/stream_output/rtp.c proper test for NULL
Basil Achermann <vlc at acherma dot com> - Patch to handle esc and space key events from VLCControl (OSX)
Barak Ori <barakori at gmail dot com> - Bidi fixes
...
...
modules/codec/flac.c
View file @
677174e7
...
...
@@ -41,6 +41,10 @@
#define MAX_FLAC_HEADER_SIZE 16
#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT >= 8
# define USE_NEW_FLAC_API
#endif
/*****************************************************************************
* decoder_sys_t : FLAC decoder descriptor
*****************************************************************************/
...
...
@@ -226,6 +230,25 @@ static int OpenDecoder( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
#ifdef USE_NEW_FLAC_API
if
(
FLAC__stream_decoder_init_stream
(
p_sys
->
p_flac
,
DecoderReadCallback
,
NULL
,
NULL
,
NULL
,
NULL
,
DecoderWriteCallback
,
DecoderMetadataCallback
,
DecoderErrorCallback
,
p_dec
)
!=
FLAC__STREAM_DECODER_INIT_STATUS_OK
)
{
msg_Err
(
p_dec
,
"FLAC__stream_decoder_init_stream() failed"
);
FLAC__stream_decoder_delete
(
p_sys
->
p_flac
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
#else
FLAC__stream_decoder_set_read_callback
(
p_sys
->
p_flac
,
DecoderReadCallback
);
FLAC__stream_decoder_set_write_callback
(
p_sys
->
p_flac
,
...
...
@@ -237,6 +260,7 @@ static int OpenDecoder( vlc_object_t *p_this )
FLAC__stream_decoder_set_client_data
(
p_sys
->
p_flac
,
p_dec
);
FLAC__stream_decoder_init
(
p_sys
->
p_flac
);
#endif
#endif
/* Set output properties */
...
...
@@ -731,16 +755,27 @@ static void decoder_state_error( decoder_t *p_dec,
case
FLAC__STREAM_DECODER_END_OF_STREAM
:
msg_Dbg
(
p_dec
,
"the decoder has reached the end of the stream."
);
break
;
#ifdef USE_NEW_FLAC_API
case
FLAC__STREAM_DECODER_OGG_ERROR
:
msg_Err
(
p_dec
,
"error occurred in the Ogg layer."
);
break
;
case
FLAC__STREAM_DECODER_SEEK_ERROR
:
msg_Err
(
p_dec
,
"error occurred while seeking."
);
break
;
#endif
case
FLAC__STREAM_DECODER_ABORTED
:
msg_Warn
(
p_dec
,
"the decoder was aborted by the read callback."
);
break
;
#ifndef USE_NEW_FLAC_API
case
FLAC__STREAM_DECODER_UNPARSEABLE_STREAM
:
msg_Warn
(
p_dec
,
"the decoder encountered reserved fields in use "
"in the stream."
);
break
;
#endif
case
FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR
:
msg_Err
(
p_dec
,
"error when allocating memory."
);
break
;
#ifndef USE_NEW_FLAC_API
case
FLAC__STREAM_DECODER_ALREADY_INITIALIZED
:
msg_Err
(
p_dec
,
"FLAC__stream_decoder_init() was called when the "
"decoder was already initialized, usually because "
...
...
@@ -750,6 +785,7 @@ static void decoder_state_error( decoder_t *p_dec,
msg_Err
(
p_dec
,
"FLAC__stream_decoder_init() was called without "
"all callbacks being set."
);
break
;
#endif
case
FLAC__STREAM_DECODER_UNINITIALIZED
:
msg_Err
(
p_dec
,
"decoder in uninitialized state."
);
break
;
...
...
@@ -1184,7 +1220,12 @@ static int OpenEncoder( vlc_object_t *p_this )
p_sys
->
i_samples_delay
=
0
;
/* Create flac encoder */
p_sys
->
p_flac
=
FLAC__stream_encoder_new
();
if
(
!
(
p_sys
->
p_flac
=
FLAC__stream_encoder_new
())
)
{
msg_Err
(
p_enc
,
"FLAC__stream_encoder_new() failed"
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
FLAC__stream_encoder_set_streamable_subset
(
p_sys
->
p_flac
,
1
);
FLAC__stream_encoder_set_channels
(
p_sys
->
p_flac
,
...
...
@@ -1194,15 +1235,32 @@ static int OpenEncoder( vlc_object_t *p_this )
FLAC__stream_encoder_set_bits_per_sample
(
p_sys
->
p_flac
,
16
);
p_enc
->
fmt_in
.
i_codec
=
AOUT_FMT_S16_NE
;
/* Get and store the STREAMINFO metadata block as a p_extra */
p_sys
->
p_chain
=
0
;
#ifdef USE_NEW_FLAC_API
if
(
FLAC__stream_encoder_init_stream
(
p_sys
->
p_flac
,
EncoderWriteCallback
,
NULL
,
NULL
,
EncoderMetadataCallback
,
p_enc
)
!=
FLAC__STREAM_ENCODER_INIT_STATUS_OK
)
{
msg_Err
(
p_enc
,
"FLAC__stream_encoder_init_stream() failed"
);
FLAC__stream_encoder_delete
(
p_sys
->
p_flac
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
#else
FLAC__stream_encoder_set_write_callback
(
p_sys
->
p_flac
,
EncoderWriteCallback
);
FLAC__stream_encoder_set_metadata_callback
(
p_sys
->
p_flac
,
EncoderMetadataCallback
);
FLAC__stream_encoder_set_client_data
(
p_sys
->
p_flac
,
p_enc
);
/* Get and store the STREAMINFO metadata block as a p_extra */
p_sys
->
p_chain
=
0
;
FLAC__stream_encoder_init
(
p_sys
->
p_flac
);
#endif
return
VLC_SUCCESS
;
}
...
...
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