video_file 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CMakeLists.txt +1 -1
- data/ext/video_file_ext/ext.c +2 -2
- data/ext/video_file_ext/vf-thumbnailer.c +6 -0
- data/lib/video_file/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b32f432c6b89bda31fae5d777f1ef5735abe6d1fa23903e3addb447245cf5121
|
4
|
+
data.tar.gz: 2f91edfb3d8fdacc146c2c48fbb22da9f0a920916ecc100524c2bb7b26d2c42a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bbe6bde902606c50a7253e4d40832f7b0bcfa165bd069ee134cc4d961266917c08f056d966c79e9cfea66fda1786b070ba1b179d51b980fa39eb7439829139f
|
7
|
+
data.tar.gz: efd352a10b247dee6275eeed60bb02b3afed09115797425866391a3cbb6b379755ddad7d3d213a2b44709bd68b043f1448578d1e5687fbe89654d8e2174cf15e
|
data/CMakeLists.txt
CHANGED
@@ -23,6 +23,6 @@ add_library(video_file_ext SHARED ${SOURCE_FILES})
|
|
23
23
|
|
24
24
|
set_target_properties(video_file_ext PROPERTIES PREFIX "")
|
25
25
|
set_target_properties(video_file_ext PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/lib")
|
26
|
-
target_compile_definitions(video_file_ext PRIVATE
|
26
|
+
target_compile_definitions(video_file_ext PRIVATE VF_ENABLE_DEBUG)
|
27
27
|
target_include_directories(video_file_ext PRIVATE ${RUBY_INCLUDE_DIRS})
|
28
28
|
target_link_libraries(video_file_ext ${LIBAV_LIBRARIES} ${JPEG_LIBRARIES} ${RUBY_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
data/ext/video_file_ext/ext.c
CHANGED
@@ -137,7 +137,7 @@ VALUE thumbnailer_m_initialize(int argc, VALUE* argv, VALUE self)
|
|
137
137
|
{
|
138
138
|
VALUE file = Qnil;
|
139
139
|
VALUE width = Qnil;
|
140
|
-
VALUE count =
|
140
|
+
VALUE count = Qnil;
|
141
141
|
rb_scan_args(argc, argv, "21", &file, &width, &count);
|
142
142
|
|
143
143
|
Check_TypedStruct(file, &file_type);
|
@@ -148,7 +148,7 @@ VALUE thumbnailer_m_initialize(int argc, VALUE* argv, VALUE self)
|
|
148
148
|
TypedData_Get_Struct(file, VfFile, &file_type, file_);
|
149
149
|
|
150
150
|
int width_ = FIX2INT(width);
|
151
|
-
unsigned n_ = FIX2UINT(count);
|
151
|
+
unsigned n_ = count == Qnil ? 1 : FIX2UINT(count);
|
152
152
|
|
153
153
|
if(!vf_thumbnailer_init(&thumbnailer->thumbnailer, file_, width_, n_)) {
|
154
154
|
rb_raise(eError, "%s", thumbnailer->thumbnailer.last_error_str);
|
@@ -97,6 +97,10 @@ vf_thumbnailer_init(VfThumbnailer* thumbnailer,
|
|
97
97
|
width = file->video_codec_context->width;
|
98
98
|
}
|
99
99
|
|
100
|
+
if(n == 0) {
|
101
|
+
n = 1;
|
102
|
+
}
|
103
|
+
|
100
104
|
thumbnailer->video_file = file;
|
101
105
|
thumbnailer->width = width;
|
102
106
|
thumbnailer->position = -1;
|
@@ -225,6 +229,8 @@ vf_thumbnailer_get_frame(VfThumbnailer* thumbnailer,
|
|
225
229
|
|
226
230
|
int64_t position = (int64_t)(AV_TIME_BASE * seconds);
|
227
231
|
if (format_context->duration < position || position < 0) {
|
232
|
+
VF_DEBUG("invalid position %ld (duration is: %ld)\n", position, format_context->duration);
|
233
|
+
strncpy(thumbnailer->last_error_str, "invalid position", sizeof(thumbnailer->last_error_str));
|
228
234
|
goto fail;
|
229
235
|
}
|
230
236
|
|
data/lib/video_file/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: video_file
|
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
|
- furunkel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|