mxfinfo 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bea22e2b021d9cd49ac2f9296bb7915f61f6b1f8
4
- data.tar.gz: 79a38848422cdb2d3b355b7c6e2673bbb9c4580c
3
+ metadata.gz: 0e4abd9b37563e6d66e69ec0aa294f371da985ef
4
+ data.tar.gz: 8f928802c08546255e33dbfcb980b3be3aab80bd
5
5
  SHA512:
6
- metadata.gz: abc8197ebd32a392eae07a623916898fce01c30c5fea0ce277b5d4d895ebbb6c17aaf8b8de6f432b2e2ad99abce804cb4c7dd20a8893638afb68038a8a5696e0
7
- data.tar.gz: e34a0ef19c405937d2a48d9bd316c2cd657af9311a8400dd0baff92b29e2f4d34645268f687bf8eec5755d93a26258007a58a0e4b8a83ffb5d0d96b36b3a0adf
6
+ metadata.gz: 167098a4a1b25c1d5a4369a9f20ad42406b2d6c30ec20c2faa70df3b6560be1f61df60737c172ac87a9e3ec576ddeedc59cc8702840418223f20e59d2d69b542
7
+ data.tar.gz: f8e9f42b9b442acf1a54408723db8b516fc9d9b4f3c629f783964ac318a2f9390a907ec39ce6f0e9cce9d1601960aec5ffa8f727004717c5d4f85d165a045f3f
@@ -74,8 +74,12 @@ VALUE rb_str_from_label(const unsigned char *lbl, int len)
74
74
  { \
75
75
  AvidMXFInfo *info; \
76
76
  Data_Get_Struct(self, AvidMXFInfo, info); \
77
- return rb_rational_new(INT2FIX((info-> attr ).numerator), \
78
- INT2FIX((info-> attr ).denominator)); \
77
+ if((info->attr).denominator == 0) { \
78
+ return Qnil; \
79
+ } else { \
80
+ return rb_rational_new(INT2FIX((info-> attr ).numerator), \
81
+ INT2FIX((info-> attr ).denominator)); \
82
+ } \
79
83
  }
80
84
 
81
85
  #define CIO_INT_GETTER(name, attr) CIO_GENERIC_GETTER(INT2FIX, name, attr)
@@ -106,7 +110,7 @@ void* ami_read_info_without_gvl(void* ptr)
106
110
  return NULL;
107
111
  }
108
112
 
109
- static
113
+ static
110
114
  VALUE cio_new(VALUE class, VALUE path)
111
115
  {
112
116
  Check_Type(path, T_STRING);
@@ -144,7 +148,7 @@ VALUE cio_new(VALUE class, VALUE path)
144
148
  }
145
149
 
146
150
  return Qnil;
147
- }
151
+ }
148
152
  else
149
153
  {
150
154
  VALUE tdata = Data_Wrap_Struct(class, 0, cio_free, info);
@@ -205,7 +209,7 @@ VALUE cio_get_material_package_uid(VALUE self)
205
209
  unsigned char *uid = (unsigned char*) &info->materialPackageUID;
206
210
 
207
211
  VALUE ary = rb_ary_new2(32);
208
- for(unsigned int i = 0; i < 32; i++)
212
+ for(unsigned int i = 0; i < 32; i++)
209
213
  {
210
214
  rb_ary_store(ary, i, CHR2FIX(uid[i]));
211
215
  }
@@ -238,7 +242,7 @@ VALUE cio_get_aspect_ratio(VALUE self)
238
242
  if(info->isVideo && info->aspectRatio.denominator != 0)
239
243
  {
240
244
  return rb_rational_new(INT2FIX(info->aspectRatio.numerator),
241
- INT2FIX(info->aspectRatio.denominator));
245
+ INT2FIX(info->aspectRatio.denominator));
242
246
  }
243
247
  else
244
248
  {
@@ -286,11 +290,11 @@ VALUE cio_get_clip_track_string(VALUE self)
286
290
 
287
291
  void Init_mxfinfo()
288
292
  {
289
- m_mxfinfo = rb_define_module("MXFInfo");
293
+ m_mxfinfo = rb_define_module("MXFInfo");
290
294
 
291
295
  c_infoobject = rb_define_class_under(m_mxfinfo, "InfoObject", rb_cObject);
292
296
  rb_define_singleton_method(c_infoobject, "new", cio_new, 1);
293
-
297
+
294
298
  rb_define_method(c_infoobject, "clip_name", cio_get_clip_name, 0);
295
299
  rb_define_method(c_infoobject, "project_name", cio_get_project_name, 0);
296
300
  rb_define_method(c_infoobject, "clip_created", cio_get_clip_created, 0);
@@ -302,7 +306,7 @@ void Init_mxfinfo()
302
306
  /* int numUserComments */
303
307
  /* AvidTaggedValue *materialPackageAttributes */
304
308
  /* int numMaterialPackageAttributes */
305
-
309
+
306
310
  rb_define_method(c_infoobject, "num_video_tracks", cio_get_num_video_tracks, 0);
307
311
  rb_define_method(c_infoobject, "num_audio_tracks", cio_get_num_audio_tracks, 0);
308
312
  rb_define_method(c_infoobject, "tracks_string", cio_get_tracks_string, 0);
@@ -15,7 +15,7 @@ module MXFInfo
15
15
 
16
16
  class InfoObject
17
17
  alias_method :videotracks, :num_video_tracks
18
- alias_method :v_tracks, :num_video_tracks
18
+ alias_method :v_tracks, :num_video_tracks
19
19
  alias_method :video_tracks, :num_video_tracks
20
20
  alias_method :audiotracks, :num_audio_tracks
21
21
  alias_method :audio_tracks, :num_audio_tracks
@@ -1,4 +1,4 @@
1
1
  module MXFInfo
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mxfinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Dierker
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-10 00:00:00.000000000 Z
12
+ date: 2018-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 2.5.2
102
+ rubygems_version: 2.6.11
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: MXFinfo is a gem that wraps avidmxfinfo from libmxf in a native ruby extension.