mediainfo-native 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e07d1c47c08b8c03b5dcc9ed8f0bbccab0dd78f1
|
4
|
+
data.tar.gz: 808c573cb2551e45722218a7c098e8861333293a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fbb4b6856edc400e8311819c5797663a89c08b3d6211015153b9a80d0b1c0d0a047eb7e7cff05c8e66944fcc2d8717d5e775d950fe1cec89356e6278e0e6e2c
|
7
|
+
data.tar.gz: c85706f602da7650333c6731098bbca440ec16bbbbca9f73014d8183f5fce8ceffe9c5ccdd4974414d92666ded9e18b0395389290d63c5bf23073583a4d6f7b2
|
@@ -8,6 +8,10 @@ unless have_library('mediainfo')
|
|
8
8
|
abort 'Failed to test-link against libmediainfo.'
|
9
9
|
end
|
10
10
|
|
11
|
+
unless have_library('pthread')
|
12
|
+
abort 'Failed to test-link against pthread.'
|
13
|
+
end
|
14
|
+
|
11
15
|
non_std_location = mediainfo_cfg.detect { |flag| flag =~ /^-L/ }
|
12
16
|
if non_std_location
|
13
17
|
non_std_location.gsub!('-L', '')
|
@@ -127,6 +127,8 @@ MediaInfoWrapper::MediaInfoWrapper()
|
|
127
127
|
mi = new MediaInfoDLL::MediaInfo();
|
128
128
|
mi->Option("Inform", "XML");
|
129
129
|
mi->Option("Complete", "1");
|
130
|
+
|
131
|
+
pthread_mutex_init(&streams_mutex, NULL);
|
130
132
|
}
|
131
133
|
|
132
134
|
MediaInfoWrapper::~MediaInfoWrapper()
|
@@ -134,10 +136,13 @@ MediaInfoWrapper::~MediaInfoWrapper()
|
|
134
136
|
if(file_opened)
|
135
137
|
close();
|
136
138
|
|
139
|
+
pthread_mutex_lock(&streams_mutex);
|
137
140
|
std::list<BaseStream*>::iterator it;
|
138
141
|
for(it = streams.begin(); it != streams.end(); ++it)
|
139
142
|
(*it)->notifyOfWrapperDestruction();
|
140
143
|
streams.clear();
|
144
|
+
pthread_mutex_unlock(&streams_mutex);
|
145
|
+
pthread_mutex_destroy(&streams_mutex);
|
141
146
|
|
142
147
|
if(mi != NULL)
|
143
148
|
delete mi;
|
@@ -204,7 +209,11 @@ VALUE MediaInfoWrapper::option() const
|
|
204
209
|
|
205
210
|
void MediaInfoWrapper::notifyOfStreamDestruction(BaseStream* stream)
|
206
211
|
{
|
207
|
-
|
212
|
+
// Might become EINVAL after destruction.
|
213
|
+
if(pthread_mutex_lock(&streams_mutex) == 0) {
|
214
|
+
streams.remove(stream);
|
215
|
+
pthread_mutex_unlock(&streams_mutex);
|
216
|
+
}
|
208
217
|
}
|
209
218
|
|
210
219
|
} /* namespace MediaInfoNative */
|
@@ -2,6 +2,7 @@
|
|
2
2
|
#define MEDIAINFO_NATIVE_MEDIAINFO_WRAPPER_H
|
3
3
|
|
4
4
|
#include <list>
|
5
|
+
#include <pthread.h>
|
5
6
|
#include <ruby.h>
|
6
7
|
#include "basestream.h"
|
7
8
|
|
@@ -29,7 +30,9 @@ public:
|
|
29
30
|
private:
|
30
31
|
bool file_opened;
|
31
32
|
MediaInfoDLL::MediaInfo* mi;
|
33
|
+
|
32
34
|
std::list<BaseStream*> streams;
|
35
|
+
pthread_mutex_t streams_mutex;
|
33
36
|
};
|
34
37
|
|
35
38
|
void Init_MediaInfoWrapper(VALUE mMediaInfoNative);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mediainfo-native
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FlavourSys Technology GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|