Mercurial > audlegacy
comparison Plugins/Input/flac/plugin.c @ 414:7fa1738514d5 trunk
[svn] Convert all input plugins (except timidity & wav-sndfile) to produce_audio.
author | chainsaw |
---|---|
date | Tue, 10 Jan 2006 12:22:40 -0800 |
parents | 7e81e9ef40f2 |
children | 3787176f9875 |
comparison
equal
deleted
inserted
replaced
413:97ba91ee699e | 414:7fa1738514d5 |
---|---|
22 #include <glib.h> | 22 #include <glib.h> |
23 #include <pwd.h> | 23 #include <pwd.h> |
24 #include <sys/types.h> | 24 #include <sys/types.h> |
25 #include <unistd.h> | 25 #include <unistd.h> |
26 | 26 |
27 #include <audacious/plugin.h> | 27 #include "audacious/plugin.h" |
28 #include <libaudacious/util.h> | 28 #include "audacious/output.h" |
29 #include <libaudacious/configdb.h> | 29 #include "libaudacious/util.h" |
30 #include <libaudacious/titlestring.h> | 30 #include "libaudacious/configdb.h" |
31 #include <libaudacious/vfs.h> | 31 #include "libaudacious/titlestring.h" |
32 #include "libaudacious/vfs.h" | |
32 | 33 |
33 #ifdef HAVE_CONFIG_H | 34 #ifdef HAVE_CONFIG_H |
34 #include <config.h> | 35 #include <config.h> |
35 #endif | 36 #endif |
36 | 37 |
488 FLAC__byte *sample_buffer_start = sample_buffer_ + sample_buffer_first_ * file_info_.channels * file_info_.sample_format_bytes_per_sample; | 489 FLAC__byte *sample_buffer_start = sample_buffer_ + sample_buffer_first_ * file_info_.channels * file_info_.sample_format_bytes_per_sample; |
489 unsigned written_time, bh_index_w; | 490 unsigned written_time, bh_index_w; |
490 FLAC__uint64 decode_position; | 491 FLAC__uint64 decode_position; |
491 | 492 |
492 sample_buffer_first_ += n; | 493 sample_buffer_first_ += n; |
493 flac_ip.add_vis_pcm(flac_ip.output->written_time(), file_info_.sample_format, file_info_.channels, bytes, sample_buffer_start); | |
494 while(flac_ip.output->buffer_free() < (int)bytes && file_info_.is_playing && file_info_.seek_to_in_sec == -1) | 494 while(flac_ip.output->buffer_free() < (int)bytes && file_info_.is_playing && file_info_.seek_to_in_sec == -1) |
495 xmms_usleep(10000); | 495 xmms_usleep(10000); |
496 if(file_info_.is_playing && file_info_.seek_to_in_sec == -1) | 496 if(file_info_.is_playing && file_info_.seek_to_in_sec == -1) |
497 flac_ip.output->write_audio(sample_buffer_start, bytes); | 497 produce_audio(flac_ip.output->written_time(), file_info_.sample_format, |
498 file_info_.channels, bytes, sample_buffer_start, NULL); | |
498 | 499 |
499 /* compute current bitrate */ | 500 /* compute current bitrate */ |
500 | 501 |
501 written_time = flac_ip.output->written_time(); | 502 written_time = flac_ip.output->written_time(); |
502 bh_index_w = written_time / BITRATE_HIST_SEGMENT_MSEC % BITRATE_HIST_SIZE; | 503 bh_index_w = written_time / BITRATE_HIST_SEGMENT_MSEC % BITRATE_HIST_SIZE; |