]>
Commit | Line | Data |
---|---|---|
27c3df7f SS |
1 | --- vlc-0.8.6/modules/codec/flac.c.orig 2007-01-02 01:06:46.000000000 +0000 |
2 | +++ vlc-0.8.6/modules/codec/flac.c 2007-01-02 01:43:51.000000000 +0000 | |
3 | @@ -225,17 +225,17 @@ | |
4 | return VLC_EGENERIC; | |
5 | } | |
6 | ||
7 | - FLAC__stream_decoder_set_read_callback( p_sys->p_flac, | |
8 | - DecoderReadCallback ); | |
9 | - FLAC__stream_decoder_set_write_callback( p_sys->p_flac, | |
10 | - DecoderWriteCallback ); | |
11 | - FLAC__stream_decoder_set_metadata_callback( p_sys->p_flac, | |
12 | - DecoderMetadataCallback ); | |
13 | - FLAC__stream_decoder_set_error_callback( p_sys->p_flac, | |
14 | - DecoderErrorCallback ); | |
15 | - FLAC__stream_decoder_set_client_data( p_sys->p_flac, p_dec ); | |
16 | - | |
17 | - FLAC__stream_decoder_init( p_sys->p_flac ); | |
18 | + FLAC__stream_decoder_init_stream( p_sys->p_flac, | |
19 | + DecoderReadCallback, | |
20 | + NULL, | |
21 | + NULL, | |
22 | + NULL, | |
23 | + NULL, | |
24 | + DecoderWriteCallback, | |
25 | + DecoderMetadataCallback, | |
26 | + DecoderErrorCallback, | |
27 | + p_dec | |
28 | + ); | |
29 | #endif | |
30 | ||
31 | /* Set output properties */ | |
32 | @@ -730,25 +730,18 @@ | |
33 | case FLAC__STREAM_DECODER_END_OF_STREAM: | |
34 | msg_Dbg( p_dec, "the decoder has reached the end of the stream." ); | |
35 | break; | |
36 | + case FLAC__STREAM_DECODER_OGG_ERROR: | |
37 | + msg_Dbg( p_dec, "the decoder got ogg error." ); | |
38 | + break; | |
39 | + case FLAC__STREAM_DECODER_SEEK_ERROR: | |
40 | + msg_Dbg( p_dec, "the decoder got seek error." ); | |
41 | + break; | |
42 | case FLAC__STREAM_DECODER_ABORTED: | |
43 | msg_Warn( p_dec, "the decoder was aborted by the read callback." ); | |
44 | break; | |
45 | - case FLAC__STREAM_DECODER_UNPARSEABLE_STREAM: | |
46 | - msg_Warn( p_dec, "the decoder encountered reserved fields in use " | |
47 | - "in the stream." ); | |
48 | - break; | |
49 | case FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR: | |
50 | msg_Err( p_dec, "error when allocating memory." ); | |
51 | break; | |
52 | - case FLAC__STREAM_DECODER_ALREADY_INITIALIZED: | |
53 | - msg_Err( p_dec, "FLAC__stream_decoder_init() was called when the " | |
54 | - "decoder was already initialized, usually because " | |
55 | - "FLAC__stream_decoder_finish() was not called." ); | |
56 | - break; | |
57 | - case FLAC__STREAM_DECODER_INVALID_CALLBACK: | |
58 | - msg_Err( p_dec, "FLAC__stream_decoder_init() was called without " | |
59 | - "all callbacks being set." ); | |
60 | - break; | |
61 | case FLAC__STREAM_DECODER_UNINITIALIZED: | |
62 | msg_Err( p_dec, "decoder in uninitialized state." ); | |
63 | break; | |
64 | @@ -1193,15 +1186,14 @@ | |
65 | FLAC__stream_encoder_set_bits_per_sample( p_sys->p_flac, 16 ); | |
66 | p_enc->fmt_in.i_codec = AOUT_FMT_S16_NE; | |
67 | ||
68 | - FLAC__stream_encoder_set_write_callback( p_sys->p_flac, | |
69 | - EncoderWriteCallback ); | |
70 | - FLAC__stream_encoder_set_metadata_callback( p_sys->p_flac, | |
71 | - EncoderMetadataCallback ); | |
72 | - FLAC__stream_encoder_set_client_data( p_sys->p_flac, p_enc ); | |
73 | - | |
74 | /* Get and store the STREAMINFO metadata block as a p_extra */ | |
75 | p_sys->p_chain = 0; | |
76 | - FLAC__stream_encoder_init( p_sys->p_flac ); | |
77 | + FLAC__stream_encoder_init_stream( p_sys->p_flac , | |
78 | + EncoderWriteCallback, | |
79 | + NULL, | |
80 | + NULL, | |
81 | + EncoderMetadataCallback, | |
82 | + p_enc); | |
83 | ||
84 | return VLC_SUCCESS; | |
85 | } |