Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/flvtool2
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#! /usr/bin/env ruby
#! /usr/bin/ruby1.9.1
require 'flvtool2'

2 changes: 1 addition & 1 deletion lib/flv/amf_string_buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def write__AMF_object(object)
write__UI8 3

object.instance_variables.each do |variable|
write__AMF_key variable.gsub('@', '')
write__AMF_key variable.to_s.gsub('@', '')
write__AMF_data object.instance_variable_get( variable.intern )
end

Expand Down
20 changes: 11 additions & 9 deletions lib/flv/core_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ def to_s
class IO
def read__UI8(position = nil)
seek position unless position.nil?
readchar
readbyte
end

def read__UI16(position = nil)
seek position unless position.nil?
(readchar << 8) + readchar
(readbyte << 8) + readbyte
end

def read__UI24(position = nil)
seek position unless position.nil?
(readchar << 16) + (readchar << 8) + readchar
(readbyte << 16) + (readbyte << 8) + readbyte
end

def read__UI32(position = nil)
seek position unless position.nil?
(readchar << 24) + (readchar << 16) + (readchar << 8) + readchar
(readbyte << 24) + (readbyte << 16) + (readbyte << 8) + readbyte
end

def read__STRING(length, position = nil)
Expand Down Expand Up @@ -111,28 +111,30 @@ def write__STRING(string, position = nil)
end

class ARGFWrapper
def readbyte
ARGF.readbyte
end
def readchar
ARGF.readchar
end

def read(length)
ARGF.read(length)
end

def read__UI8
readchar
readbyte
end

def read__UI16
(readchar << 8) + readchar
(readbyte << 8) + readbyte
end

def read__UI24
(readchar << 16) + (readchar << 8) + readchar
(readbyte << 16) + (readbyte << 8) + readbyte
end

def read__UI32
(readchar << 24) + (readchar << 16) + (readchar << 8) + readchar
(readbyte << 24) + (readbyte << 16) + (readbyte << 8) + readbyte
end

def read__STRING(length)
Expand Down
4 changes: 4 additions & 0 deletions lib/flvtool2/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def execute!(options)


def add(options, stream, in_path, out_path)
if options.class != Hash
puts "-A needs Tag file\n"
return
end
tag_structures = MiXML.parse( File.open( options[:tag_file], File::RDONLY ) { |file| file.readlines }.join )

add_tag = Proc.new do |data|
Expand Down
2 changes: 1 addition & 1 deletion lib/mixml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def self.normalize_cdata(branch)
hash
end
else
if branch[:cdata] && branch.size == 1
if branch.class != String && branch[:cdata] && branch.size == 1
branch[:cdata]
else
branch
Expand Down
2 changes: 1 addition & 1 deletion lib/miyaml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def self.dump_object(object, indent = 0)
yaml = ''

if object.class == Object
object = object.instance_variables.inject( {} ) { |hash, var| hash[var.gsub('@', '')] = object.instance_variable_get(var); hash }
object = object.instance_variables.inject( {} ) { |hash, var| hash[var.to_s.gsub('@', '')] = object.instance_variable_get(var); hash }
end

case object
Expand Down
2 changes: 1 addition & 1 deletion setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ def ToplevelInstaller.load_rbconfig
else
require 'rbconfig'
end
::Config::CONFIG
::RbConfig::CONFIG
end

def initialize(ardir_root, config)
Expand Down
Binary file modified test/31163.flv
Binary file not shown.