public
Description: I am in ur computar, encodin' and decodin' ur MP3z.
Homepage: http://icanhasaudio.com/
Clone URL: git://github.com/aaronp/icanhasaudio.git
Search Repo:
only rewinding output files that can be rewound
aaronp (author)
Sun May 11 15:45:15 -0700 2008
commit  5d25cea1f3419912e66b3eea69dd3cb30e4c92aa
tree    cda805c587467895d1a5534f6edf4bbdd24d6c8c
parent  423240a40bd838d85c0bc10e8056d22a978e454c
...
 
 
 
 
 
...
1
2
3
4
5
0
@@ -1 +1,6 @@
0
+.*.swp
0
+*.o
0
+Makefile
0
+*.bundle
0
+mkmf.log
...
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
0
@@ -1,3 +1,8 @@
0
+=== 0.1.1
0
+
0
+* 1 Bugfix
0
+ * Only rewinding output files if its possible.
0
+
0
 === 0.1.0
0
 
0
 * 1 major enhancement
...
17
18
19
20
 
21
22
23
...
17
18
19
 
20
21
22
23
0
@@ -17,7 +17,7 @@
0
 
0
 sleep 2
0
 
0
-raop = Net::RAOP::Client.new('192.168.1.173')
0
+raop = Net::RAOP::Client.new('10.0.1.1')
0
 raop.connect
0
 raop.play rd
0
 raop.disconnect
...
86
87
88
89
90
91
92
93
94
95
 
96
97
98
...
86
87
88
 
 
 
 
 
 
 
89
90
91
92
0
@@ -86,13 +86,7 @@
0
       wavsize *= i;
0
   }
0
 
0
- if(!raw && rb_respond_to(outf, rb_intern("seek")) == Qtrue) {
0
- rb_funcall( outf,
0
- rb_intern("seek"),
0
- 2,
0
- INT2NUM(0),
0
- rb_const_get(rb_cIO, rb_intern("SEEK_SET")) );
0
-
0
+ if(!raw && rb_funcall(self, rb_intern("attempt_rewind"), 1, outf)) {
0
     rewrite_header(headbuf, (int)wavsize);
0
     rb_funcall(outf, rb_intern("write"), 1, rb_str_new(headbuf, 44));
0
   }
...
10
11
12
 
 
 
 
 
 
 
 
 
 
13
...
10
11
12
13
14
15
16
17
18
19
20
21
22
23
0
@@ -10,5 +10,15 @@
0
     @bits = 16
0
     yield self if block_given?
0
   end
0
+
0
+ private
0
+ def attempt_rewind(outf)
0
+ begin
0
+ outf.seek(0, IO::SEEK_SET)
0
+ true
0
+ rescue
0
+ false
0
+ end
0
+ end
0
 end

Comments

    No one has commented yet.