input_stream: non-blocking I/O
Add GMutex, GCond attributes which will be used by callers to conditionally wait on the stream. Remove the (now-useless) plugin method buffer(), wait on GCond instead. Lock the input_stream before each method call. Do the same with the playlist plugins.
This commit is contained in:
NEWS
src
archive
archive_plugin.carchive_plugin.hdecoder
audiofile_decoder_plugin.cfaad_decoder_plugin.cffmpeg_decoder_plugin.cflac_decoder_plugin.cmad_decoder_plugin.cmodplug_decoder_plugin.cmp4ff_decoder_plugin.cmpcdec_decoder_plugin.cpcm_decoder_plugin.csndfile_decoder_plugin.cvorbis_decoder_plugin.cwavpack_decoder_plugin.c
decoder_api.cdecoder_thread.cinput
archive_input_plugin.ccdio_paranoia_input_plugin.ccurl_input_plugin.cdespotify_input_plugin.cffmpeg_input_plugin.cfile_input_plugin.cmms_input_plugin.crewind_input_plugin.csoup_input_plugin.c
input_internal.cinput_internal.hinput_plugin.hinput_stream.cinput_stream.hplaylist
asx_playlist_plugin.ccue_playlist_plugin.cdespotify_playlist_plugin.cflac_playlist_plugin.clastfm_playlist_plugin.cpls_playlist_plugin.crss_playlist_plugin.cxspf_playlist_plugin.c
playlist_any.cplaylist_any.hplaylist_list.cplaylist_list.hplaylist_mapper.cplaylist_mapper.hplaylist_plugin.hplaylist_print.cplaylist_queue.csong_update.ctext_input_stream.ctest
@@ -46,7 +46,9 @@ file_quark(void)
|
||||
}
|
||||
|
||||
static struct input_stream *
|
||||
input_file_open(const char *filename, GError **error_r)
|
||||
input_file_open(const char *filename,
|
||||
GMutex *mutex, GCond *cond,
|
||||
GError **error_r)
|
||||
{
|
||||
int fd, ret;
|
||||
struct stat st;
|
||||
@@ -85,7 +87,8 @@ input_file_open(const char *filename, GError **error_r)
|
||||
#endif
|
||||
|
||||
fis = g_new(struct file_input_stream, 1);
|
||||
input_stream_init(&fis->base, &input_plugin_file, filename);
|
||||
input_stream_init(&fis->base, &input_plugin_file, filename,
|
||||
mutex, cond);
|
||||
|
||||
fis->base.size = st.st_size;
|
||||
fis->base.seekable = true;
|
||||
|
Reference in New Issue
Block a user