[xiph-commits] r3285 -
libfishsound/branches/1.0-stable-flac/src/libfishsound
conrad at svn.annodex.net
conrad at svn.annodex.net
Tue Dec 4 17:35:39 PST 2007
Author: conrad
Date: 2007-12-04 17:35:39 -0800 (Tue, 04 Dec 2007)
New Revision: 3285
Modified:
libfishsound/branches/1.0-stable-flac/src/libfishsound/flac.c
Log:
raw commit of libfishsound-flac-2.patch (build fails)
Modified: libfishsound/branches/1.0-stable-flac/src/libfishsound/flac.c
===================================================================
--- libfishsound/branches/1.0-stable-flac/src/libfishsound/flac.c 2007-12-05 01:35:10 UTC (rev 3284)
+++ libfishsound/branches/1.0-stable-flac/src/libfishsound/flac.c 2007-12-05 01:35:39 UTC (rev 3285)
@@ -40,7 +40,7 @@
return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
} else if (fi->bufferlength < 1) {
#ifdef DEBUG
- fprintf(stderr, "no data\n");
+ fprintf(stderr, "no data, %d\n",fi->bufferlength);
#endif
return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
}
@@ -58,6 +58,7 @@
#ifdef DEBUG
fprintf(stderr, "fs_flac_write_callback\n");
#endif
+ fsound->frameno += frame->header.blocksize*frame->header.channels;
switch (fsound->pcm_type) {
case FISH_SOUND_PCM_SHORT:
if (fsound->callback.decoded_short) {
@@ -272,6 +273,7 @@
fsound->user_data);
}
} else {
+ fsound->frameno += samples;
encoded (fsound, (unsigned char *)buffer, (long)bytes,
fsound->user_data);
}
@@ -358,7 +360,7 @@
fs_flac_enc_headers (fsound);
// FLAC__stream_encoder_process_interleaved(fi->fse, pcm, frames);
fi->packetno++;
- return 0;
+ return frames;
}
static long
@@ -381,7 +383,7 @@
fs_flac_enc_headers (fsound);
FLAC__stream_encoder_process_interleaved(fi->fse, buffer, frames);
fi->packetno++;
- return 0;
+ return frames;
}
#endif
@@ -492,16 +494,30 @@
}
static int
+fs_flac_update (FishSound * fsound, int interleave, FishSoundPCM pcm_type)
+{
+ return 0;
+}
+
+static int
fs_flac_reset (FishSound * fsound)
{
FishSoundFlacInfo * fi = (FishSoundFlacInfo *)fsound->codec_data;
+ /*
if (fsound->mode == FISH_SOUND_DECODE) {
FLAC__stream_decoder_reset(fi->fsd);
} else if (fsound->mode == FISH_SOUND_ENCODE) {
}
+ */
return 0;
}
+static long
+fs_flac_flush (FishSound * fsound)
+{
+ return 0;
+}
+
static FishSound *
fs_flac_init (FishSound * fsound)
{
@@ -543,6 +559,7 @@
codec->init = fs_flac_init;
codec->del = fs_flac_delete;
codec->reset = fs_flac_reset;
+ codec->update = fs_flac_update;
codec->command = fs_flac_command;
codec->decode = fs_flac_decode;
codec->encode_s = NULL;
@@ -553,7 +570,7 @@
codec->encode_f_ilv = fs_flac_encode_f_ilv;
codec->encode_d = NULL;
codec->encode_d_ilv = NULL;
- codec->flush = NULL;
+ codec->flush = fs_flac_flush;
return codec;
}
More information about the commits
mailing list