2
===================================================================
3
--- /trunk/THANKS (revision 18854)
4
+++ /trunk/THANKS (revision 18855)
6
Arnaud Gomes-do-Vale <arnaud at carrosse.frmug.org> - autoconf patches
7
Arwed v. Merkatz <v.merkatz at gmx dot net> - Gamma correction for adjust filter
8
+Ats (through Trac) - libFLAC >= 1.1.3 API support
9
Aurelien - Patch for modules/stream_output/rtp.c proper test for NULL
10
Basil Achermann <vlc at acherma dot com> - Patch to handle esc and space key events from VLCControl (OSX)
11
Index: /trunk/modules/codec/flac.c
12
===================================================================
13
--- /trunk/modules/codec/flac.c (revision 18062)
14
+++ /trunk/modules/codec/flac.c (revision 18855)
16
#define MAX_FLAC_HEADER_SIZE 16
18
+#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT >= 8
19
+# define USE_NEW_FLAC_API
22
/*****************************************************************************
23
* decoder_sys_t : FLAC decoder descriptor
27
+#ifdef USE_NEW_FLAC_API
28
+ if( FLAC__stream_decoder_init_stream( p_sys->p_flac,
29
+ DecoderReadCallback,
34
+ DecoderWriteCallback,
35
+ DecoderMetadataCallback,
36
+ DecoderErrorCallback,
38
+ != FLAC__STREAM_DECODER_INIT_STATUS_OK )
40
+ msg_Err( p_dec, "FLAC__stream_decoder_init_stream() failed" );
41
+ FLAC__stream_decoder_delete( p_sys->p_flac );
43
+ return VLC_EGENERIC;
46
FLAC__stream_decoder_set_read_callback( p_sys->p_flac,
47
DecoderReadCallback );
50
FLAC__stream_decoder_init( p_sys->p_flac );
55
msg_Dbg( p_dec, "the decoder has reached the end of the stream." );
57
+#ifdef USE_NEW_FLAC_API
58
+ case FLAC__STREAM_DECODER_OGG_ERROR:
59
+ msg_Err( p_dec, "error occurred in the Ogg layer." );
61
+ case FLAC__STREAM_DECODER_SEEK_ERROR:
62
+ msg_Err( p_dec, "error occurred while seeking." );
65
case FLAC__STREAM_DECODER_ABORTED:
66
msg_Warn( p_dec, "the decoder was aborted by the read callback." );
68
+#ifndef USE_NEW_FLAC_API
69
case FLAC__STREAM_DECODER_UNPARSEABLE_STREAM:
70
msg_Warn( p_dec, "the decoder encountered reserved fields in use "
74
case FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR:
75
msg_Err( p_dec, "error when allocating memory." );
77
+#ifndef USE_NEW_FLAC_API
78
case FLAC__STREAM_DECODER_ALREADY_INITIALIZED:
79
msg_Err( p_dec, "FLAC__stream_decoder_init() was called when the "
81
"all callbacks being set." );
84
case FLAC__STREAM_DECODER_UNINITIALIZED:
85
msg_Err( p_dec, "decoder in uninitialized state." );
86
@@ -1185,5 +1221,10 @@
88
/* Create flac encoder */
89
- p_sys->p_flac = FLAC__stream_encoder_new();
90
+ if( !(p_sys->p_flac = FLAC__stream_encoder_new()) )
92
+ msg_Err( p_enc, "FLAC__stream_encoder_new() failed" );
94
+ return VLC_EGENERIC;
97
FLAC__stream_encoder_set_streamable_subset( p_sys->p_flac, 1 );
98
@@ -1195,4 +1236,22 @@
99
p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE;
101
+ /* Get and store the STREAMINFO metadata block as a p_extra */
102
+ p_sys->p_chain = 0;
104
+#ifdef USE_NEW_FLAC_API
105
+ if( FLAC__stream_encoder_init_stream( p_sys->p_flac,
106
+ EncoderWriteCallback,
109
+ EncoderMetadataCallback,
111
+ != FLAC__STREAM_ENCODER_INIT_STATUS_OK )
113
+ msg_Err( p_enc, "FLAC__stream_encoder_init_stream() failed" );
114
+ FLAC__stream_encoder_delete( p_sys->p_flac );
116
+ return VLC_EGENERIC;
119
FLAC__stream_encoder_set_write_callback( p_sys->p_flac,
120
EncoderWriteCallback );
121
@@ -1201,7 +1260,6 @@
122
FLAC__stream_encoder_set_client_data( p_sys->p_flac, p_enc );
124
- /* Get and store the STREAMINFO metadata block as a p_extra */
125
- p_sys->p_chain = 0;
126
FLAC__stream_encoder_init( p_sys->p_flac );