Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for 1.9, expose Response#offset #7

Merged
merged 5 commits into from
Apr 16, 2014

Conversation

marcbowes
Copy link
Contributor

#5 describes how String#[] is broken under Ruby > 1.8. This is fixed to work in all versions.
#6 describes how @client_time_receive is not accessible and is an integer.

In addition to these fixes, I've also swapped to using IO#select to get a more accurate timestamp reading and fixed the "Originating Timestamp" field to be based off a float.

All tests pass on Rubies 1.8 .. 2.1 on my Ubuntu machine.

In Ruby 1.8, hi[0] returns h has a byte.
http://ruby-doc.org/core-1.8.7/String.html\#method-i-5B-5D

In Ruby 1.9 and 2.x, #[] returns a slience
http://www.ruby-doc.org/core-2.1.1/String.html\#method-i-5B-5D

All versions respond to #bytes, so this change respresents a
backwards compatible change and bugfix on newer Rubies

closes zencoder#5
I found this to give a more accurate timestamp because the stamp is set
immediately upon the wakeup that data is available, rather than after
the data has been transfered to userspace.

As a result, the timestamp is now passed into the Response object when
it is constructed.

closes zencoder#6
The test is quite hard if your clock is in sync. I'm not sure the right
way to actually do this because we're using a pool of NTP servers and
ntpdate and Net::NTP could hit different servers.

I think this is good enough for now to verify that things actually
work and return reasonable results.

closes zencoder#6
brandonarbini pushed a commit that referenced this pull request Apr 16, 2014
Fix for 1.9, expose Response#offset. Fixes #5 and fixes #6.
@brandonarbini brandonarbini merged commit 58a3f88 into zencoder:master Apr 16, 2014
@marcbowes
Copy link
Contributor Author

Are you planning on releasing a new version?

@brandonarbini
Copy link
Contributor

Just pushed a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants