ruby-vorbistagger.git
18 years agoCode cleanup.
Tilman Sauerbeck [Fri, 18 Aug 2006 13:49:38 +0000 (15:49 +0200)]
Code cleanup.

18 years agoClose and remove the temporary file if vcedit_write() fails.
Tilman Sauerbeck [Fri, 18 Aug 2006 13:45:19 +0000 (15:45 +0200)]
Close and remove the temporary file if vcedit_write() fails.

18 years agoCheck the error flag when reading data.
Tilman Sauerbeck [Fri, 18 Aug 2006 13:38:30 +0000 (15:38 +0200)]
Check the error flag when reading data.

18 years agoCode cleanup.
Tilman Sauerbeck [Fri, 18 Aug 2006 13:32:15 +0000 (15:32 +0200)]
Code cleanup.

18 years agoHandle short writes gracefully.
Tilman Sauerbeck [Fri, 18 Aug 2006 13:29:37 +0000 (15:29 +0200)]
Handle short writes gracefully.

18 years agoMade Ogg::Vorbis::Tagger#close return nil.
Tilman Sauerbeck [Thu, 17 Aug 2006 19:26:48 +0000 (21:26 +0200)]
Made Ogg::Vorbis::Tagger#close return nil.

18 years agoMade the Ogg::Vorbis::Tagger object inaccessable after #close was called.
Tilman Sauerbeck [Thu, 17 Aug 2006 19:23:07 +0000 (21:23 +0200)]
Made the Ogg::Vorbis::Tagger object inaccessable after #close was called.

18 years agoSlightly reworked the final write loop.
Tilman Sauerbeck [Thu, 17 Aug 2006 17:57:20 +0000 (19:57 +0200)]
Slightly reworked the final write loop.

18 years agoCheck the EOF flag on zero reads.
Tilman Sauerbeck [Thu, 17 Aug 2006 17:27:43 +0000 (19:27 +0200)]
Check the EOF flag on zero reads.

18 years agoCode cleanup.
Tilman Sauerbeck [Thu, 17 Aug 2006 17:00:42 +0000 (19:00 +0200)]
Code cleanup.

18 years agoReworked the loop that finds the first ogg page in the input stream.
Tilman Sauerbeck [Thu, 17 Aug 2006 16:30:51 +0000 (18:30 +0200)]
Reworked the loop that finds the first ogg page in the input stream.

The loop also handles short reads gracefully now.

18 years agoCode cleanup.
Tilman Sauerbeck [Thu, 17 Aug 2006 16:15:49 +0000 (18:15 +0200)]
Code cleanup.

18 years agoReject filenames that are longer than PATH_MAX.
Tilman Sauerbeck [Thu, 17 Aug 2006 16:07:29 +0000 (18:07 +0200)]
Reject filenames that are longer than PATH_MAX.

18 years agoUse a flexiable array to store the filename.
Tilman Sauerbeck [Thu, 17 Aug 2006 16:03:15 +0000 (18:03 +0200)]
Use a flexiable array to store the filename.

18 years agoSanitized memory allocation scheme.
Tilman Sauerbeck [Thu, 17 Aug 2006 15:51:37 +0000 (17:51 +0200)]
Sanitized memory allocation scheme.

18 years agoMade MainTest#test_open_non_ogg_file pass.
Tilman Sauerbeck [Thu, 17 Aug 2006 15:40:31 +0000 (17:40 +0200)]
Made MainTest#test_open_non_ogg_file pass.

18 years agoAdded tests that ensure sane behaviour with non-existing/invalid files.
Tilman Sauerbeck [Thu, 17 Aug 2006 15:30:28 +0000 (17:30 +0200)]
Added tests that ensure sane behaviour with non-existing/invalid files.

18 years agoReworked error handling.
Tilman Sauerbeck [Thu, 17 Aug 2006 15:24:13 +0000 (17:24 +0200)]
Reworked error handling.

vcedit functions now return an error code instead of setting lasterror.
Ogg::Vorbis::Tagger turns these error codes into their own exception
classes.

18 years agoSeparated vcedit_state_new() and vcedit_open() again.
Tilman Sauerbeck [Thu, 17 Aug 2006 15:10:43 +0000 (17:10 +0200)]
Separated vcedit_state_new() and vcedit_open() again.

18 years agoMake sure we aren't keeping the input file opened.
Tilman Sauerbeck [Wed, 16 Aug 2006 19:24:47 +0000 (21:24 +0200)]
Make sure we aren't keeping the input file opened.

18 years agoCleaned up memory allocations.
Tilman Sauerbeck [Wed, 16 Aug 2006 19:12:06 +0000 (21:12 +0200)]
Cleaned up memory allocations.

Now we don't allocate the same chunks of memory in every call to
vcedit_open(), but we allocate the memory with the vcedit_state object
and keep it throughout its life time.

18 years agoCode cleanup.
Tilman Sauerbeck [Wed, 16 Aug 2006 17:50:28 +0000 (19:50 +0200)]
Code cleanup.

18 years agoAdded two tests that ensure that writing comments doesn't corrupt files.
Tilman Sauerbeck [Wed, 16 Aug 2006 17:10:06 +0000 (19:10 +0200)]
Added two tests that ensure that writing comments doesn't corrupt files.

18 years agoAdded a sample Ogg Vorbis file, so we don't depend on oggenc in the tests.
Tilman Sauerbeck [Wed, 16 Aug 2006 17:09:55 +0000 (19:09 +0200)]
Added a sample Ogg Vorbis file, so we don't depend on oggenc in the tests.

18 years agoMade Ogg::Vorbis::Tagger#close available again.
Tilman Sauerbeck [Wed, 16 Aug 2006 15:15:40 +0000 (17:15 +0200)]
Made Ogg::Vorbis::Tagger#close available again.

18 years agoAdded a configure check for rb_hash_foreach().
Tilman Sauerbeck [Tue, 15 Aug 2006 18:23:48 +0000 (20:23 +0200)]
Added a configure check for rb_hash_foreach().

18 years agoAdded .gitignore.
Tilman Sauerbeck [Tue, 15 Aug 2006 17:51:54 +0000 (19:51 +0200)]
Added .gitignore.

18 years agoAdded Ogg::Vorbis::Comments#shift.
Tilman Sauerbeck [Tue, 15 Aug 2006 17:40:25 +0000 (19:40 +0200)]
Added Ogg::Vorbis::Comments#shift.

18 years agoAdded Ogg::Vorbis::Comments#merge!.
Tilman Sauerbeck [Tue, 15 Aug 2006 17:03:18 +0000 (19:03 +0200)]
Added Ogg::Vorbis::Comments#merge!.

18 years agoFixed error handling in Rake::ConfigureTask::FooConfigTest#lookup_flags.
Tilman Sauerbeck [Tue, 15 Aug 2006 16:20:21 +0000 (18:20 +0200)]
Fixed error handling in Rake::ConfigureTask::FooConfigTest#lookup_flags.

18 years agoDon't try to close the temporary file.
Tilman Sauerbeck [Tue, 15 Aug 2006 16:17:38 +0000 (18:17 +0200)]
Don't try to close the temporary file.

18 years agoReworked output file writing.
Tilman Sauerbeck [Mon, 14 Aug 2006 20:04:56 +0000 (22:04 +0200)]
Reworked output file writing.

Ogg::Vorbis::Tagger can only operate on files now, since read-write
support cannot be implemented properly with streams. This allowed
fixing a corruption bug, that would break Ogg Vorbis files when writing
comments to them.

18 years agoFixed reopening of stdout and stderr.
Tilman Sauerbeck [Mon, 14 Aug 2006 16:12:35 +0000 (18:12 +0200)]
Fixed reopening of stdout and stderr.

They are now reopened to /dev/null instead of an temporary file that can
never be removed.

18 years agoOnly pass a single argument to Kernel.exec.
Tilman Sauerbeck [Mon, 14 Aug 2006 16:08:37 +0000 (18:08 +0200)]
Only pass a single argument to Kernel.exec.

18 years agoUse a valid exit code in Rake::ConfigureTask::Test#can_exec_binary?.
Tilman Sauerbeck [Mon, 14 Aug 2006 16:00:19 +0000 (18:00 +0200)]
Use a valid exit code in Rake::ConfigureTask::Test#can_exec_binary?.

18 years agoReworked Ogg::Vorbis::Comments' vorbis_comment interface.
Tilman Sauerbeck [Sat, 12 Aug 2006 22:42:30 +0000 (00:42 +0200)]
Reworked Ogg::Vorbis::Comments' vorbis_comment interface.

Ogg::Vorbis::Comments doesn't need to hold a reference to the
vcedit_state structure. Instead, now a pointer to that struct is passed
to comments_sync(), too. This means we no longer need to make
Ogg::Vorbis::Comments a class of type T_DATA.

18 years agoDon't mark global variables.
Tilman Sauerbeck [Sat, 12 Aug 2006 20:44:41 +0000 (22:44 +0200)]
Don't mark global variables.

18 years agoAdded Gem support.
Tilman Sauerbeck [Sat, 12 Aug 2006 20:34:22 +0000 (22:34 +0200)]
Added Gem support.

18 years agoDelete the temporary file when we're done with it.
Tilman Sauerbeck [Sat, 12 Aug 2006 20:03:53 +0000 (22:03 +0200)]
Delete the temporary file when we're done with it.

18 years agoReturn either Qtrue or Qfalse from Ogg::Vorbis::Comments#empty?.
Tilman Sauerbeck [Fri, 11 Aug 2006 16:35:11 +0000 (18:35 +0200)]
Return either Qtrue or Qfalse from Ogg::Vorbis::Comments#empty?.

18 years agoDon't store the key-value pair array in an instance variable.
Tilman Sauerbeck [Fri, 11 Aug 2006 16:24:10 +0000 (18:24 +0200)]
Don't store the key-value pair array in an instance variable.

18 years agoAdded common aliases for Ogg::Vorbis::Comments#has_key?.
Tilman Sauerbeck [Fri, 11 Aug 2006 15:37:25 +0000 (17:37 +0200)]
Added common aliases for Ogg::Vorbis::Comments#has_key?.

Aliases added are: key?, include? and member?.

18 years agoSplit MainTest#test_modify_key into two smaller tests.
Tilman Sauerbeck [Fri, 11 Aug 2006 14:50:16 +0000 (16:50 +0200)]
Split MainTest#test_modify_key into two smaller tests.

18 years agoFreeze the key in newly added entries in Ogg::Vorbis::Comments#[]=.
Tilman Sauerbeck [Fri, 11 Aug 2006 14:47:55 +0000 (16:47 +0200)]
Freeze the key in newly added entries in Ogg::Vorbis::Comments#[]=.

This makes MainTest#test_modify_key pass.

18 years agoAdded MainTest#test_modify_key.
Tilman Sauerbeck [Fri, 11 Aug 2006 14:41:02 +0000 (16:41 +0200)]
Added MainTest#test_modify_key.

This test asserts that it's not possible to change the keys in the
key-value pair arrays.

18 years agoFreeze the key-value pair arrays in Ogg::Vorbis::Comments.
Tilman Sauerbeck [Fri, 11 Aug 2006 14:28:58 +0000 (16:28 +0200)]
Freeze the key-value pair arrays in Ogg::Vorbis::Comments.

This protects them from being modified, which should never be necessary.

18 years agoTweaked Ogg::Vorbis::Comments#inspect.
Tilman Sauerbeck [Fri, 11 Aug 2006 14:09:24 +0000 (16:09 +0200)]
Tweaked Ogg::Vorbis::Comments#inspect.

18 years agoChanged the initialize size of the IO buffer to 0.
Tilman Sauerbeck [Fri, 11 Aug 2006 13:42:30 +0000 (15:42 +0200)]
Changed the initialize size of the IO buffer to 0.

It will be resized at every access anyway. It would be nice if we
could have a static buffer, but Ruby's API doesn't allow it atm.

18 years agoMade the IO buffer global.
Tilman Sauerbeck [Fri, 11 Aug 2006 13:40:05 +0000 (15:40 +0200)]
Made the IO buffer global.

There's no need to give each Ogg::Vorbis::Tagger instance its own
buffer. This should help memory consumption when there's more than
one Ogg::Vorbis::Tagger object around. The downside is that the buffer
object will be kept alive forever.

18 years agoMade sure that all comments are well-formed before they are parsed.
Tilman Sauerbeck [Fri, 11 Aug 2006 13:34:19 +0000 (15:34 +0200)]
Made sure that all comments are well-formed before they are parsed.

ie, check that every comment has a '=' sign somewhere, but not at
position 0.

18 years agoInitial commit.
Tilman Sauerbeck [Thu, 10 Aug 2006 16:05:32 +0000 (18:05 +0200)]
Initial commit.