]> git.pld-linux.org Git - packages/DirectFB.git/blob - DirectFB-libtimidity.patch
Release 6 (by relup.sh)
[packages/DirectFB.git] / DirectFB-libtimidity.patch
1 --- DirectFB-1.7.7/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_timidity.c.orig       2013-12-19 01:16:24.000000000 +0100
2 +++ DirectFB-1.7.7/interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_timidity.c    2017-12-17 20:40:00.879730101 +0100
3 @@ -114,6 +114,29 @@
4  }
5  
6  static int
7 +seek_callback( void *ctx, long offset, int whence )
8 +{
9 +     IFusionSoundMusicProvider_Timidity_data *data = ctx;
10 +     if (direct_stream_seekable( data->st )) {
11 +         long newpos;
12 +         switch (whence) {
13 +              case SEEK_SET: newpos = offset; break;
14 +              case SEEK_CUR: newpos = direct_stream_offset( data->st ) + offset; break;
15 +              case SEEK_END: newpos = direct_stream_length( data->st ) + offset; break;
16 +              default: return -1;
17 +         }
18 +          direct_stream_seek( data->st, newpos );
19 +     } else return -1; // not seekable
20 +}
21 +
22 +static long
23 +tell_callback( void *ctx )
24 +{
25 +     IFusionSoundMusicProvider_Timidity_data *data = ctx;
26 +     return direct_stream_offset( data->st );
27 +}
28 +
29 +static int
30  close_callback( void *ctx )
31  {
32       return 0;
33 @@ -363,7 +386,7 @@
34       Timidity_Stop( data, false );
35       
36       direct_stream_seek( data->st, 0 );
37 -     stream = mid_istream_open_callbacks( read_callback, close_callback, data );
38 +     stream = mid_istream_open_callbacks( read_callback, seek_callback, tell_callback, close_callback, data );
39       if (!stream) {
40            D_ERROR( "IFusionSoundMusicProvider_Timidity: couldn't open input stream!\n" );
41            pthread_mutex_unlock( &data->lock );
42 @@ -510,7 +533,7 @@
43       Timidity_Stop( data, false );
44  
45       direct_stream_seek( data->st, 0 );
46 -     stream = mid_istream_open_callbacks( read_callback, close_callback, data );
47 +     stream = mid_istream_open_callbacks( read_callback, seek_callback, tell_callback, close_callback, data );
48       if (!stream) {
49            D_ERROR( "IFusionSoundMusicProvider_Timidity: couldn't open input stream!\n" );
50            pthread_mutex_unlock( &data->lock );
This page took 0.0892579999999999 seconds and 3 git commands to generate.