diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/main/extractor.c | 10 | ||||
-rw-r--r-- | src/main/extractor_ipc.h | 10 | ||||
-rw-r--r-- | src/main/extractor_ipc_gnu.c | 8 | ||||
-rw-r--r-- | src/main/extractor_plugin_main.c | 12 | ||||
-rw-r--r-- | src/plugins/previewopus_extractor.c | 13 |
6 files changed, 31 insertions, 25 deletions
@@ -1,3 +1,6 @@ | |||
1 | Tue 02 Jun 2020 11:14:43 PM CEST | ||
2 | Fixed missing initialization of duration in Opus extractor. -CG | ||
3 | |||
1 | Fri 23 Aug 2019 09:34:35 AM CEST | 4 | Fri 23 Aug 2019 09:34:35 AM CEST |
2 | Fix invalid read for malformed DVI files (#5846). -CG | 5 | Fix invalid read for malformed DVI files (#5846). -CG |
3 | 6 | ||
diff --git a/src/main/extractor.c b/src/main/extractor.c index cb64b95..89d734d 100644 --- a/src/main/extractor.c +++ b/src/main/extractor.c | |||
@@ -419,13 +419,7 @@ do_extract (struct EXTRACTOR_PluginList *plugins, | |||
419 | pos->channel = NULL; | 419 | pos->channel = NULL; |
420 | } | 420 | } |
421 | } | 421 | } |
422 | if (-1 == ready) | 422 | done = 0; |
423 | { | ||
424 | LOG ("Failed to initialize IPC shared memory, cannot extract\n"); | ||
425 | done = 1; | ||
426 | } | ||
427 | else | ||
428 | done = 0; | ||
429 | while (! done) | 423 | while (! done) |
430 | { | 424 | { |
431 | struct EXTRACTOR_Channel *channels[plugin_count]; | 425 | struct EXTRACTOR_Channel *channels[plugin_count]; |
@@ -521,7 +515,7 @@ do_extract (struct EXTRACTOR_PluginList *plugins, | |||
521 | } | 515 | } |
522 | } | 516 | } |
523 | /* if 'prp.file_finished', send 'abort' to plugins; | 517 | /* if 'prp.file_finished', send 'abort' to plugins; |
524 | if not, send 'seek' notification to plugins in range */ | 518 | if not, send 'seek' notification to plugins in range */ |
525 | for (pos = plugins; NULL != pos; pos = pos->next) | 519 | for (pos = plugins; NULL != pos; pos = pos->next) |
526 | { | 520 | { |
527 | if (NULL == (channel = pos->channel)) | 521 | if (NULL == (channel = pos->channel)) |
diff --git a/src/main/extractor_ipc.h b/src/main/extractor_ipc.h index 8e7fe09..691898b 100644 --- a/src/main/extractor_ipc.h +++ b/src/main/extractor_ipc.h | |||
@@ -92,7 +92,7 @@ | |||
92 | struct InitMessage | 92 | struct InitMessage |
93 | { | 93 | { |
94 | /** | 94 | /** |
95 | * Set to MESSAGE_INIT_STATE. | 95 | * Set to #MESSAGE_INIT_STATE. |
96 | */ | 96 | */ |
97 | unsigned char opcode; | 97 | unsigned char opcode; |
98 | 98 | ||
@@ -133,7 +133,7 @@ struct InitMessage | |||
133 | struct StartMessage | 133 | struct StartMessage |
134 | { | 134 | { |
135 | /** | 135 | /** |
136 | * Set to MESSAGE_EXTRACT_START. | 136 | * Set to #MESSAGE_EXTRACT_START. |
137 | */ | 137 | */ |
138 | unsigned char opcode; | 138 | unsigned char opcode; |
139 | 139 | ||
@@ -171,7 +171,7 @@ struct StartMessage | |||
171 | struct UpdateMessage | 171 | struct UpdateMessage |
172 | { | 172 | { |
173 | /** | 173 | /** |
174 | * Set to MESSAGE_UPDATED_SHM. | 174 | * Set to #MESSAGE_UPDATED_SHM. |
175 | */ | 175 | */ |
176 | unsigned char opcode; | 176 | unsigned char opcode; |
177 | 177 | ||
@@ -221,7 +221,7 @@ struct UpdateMessage | |||
221 | struct SeekRequestMessage | 221 | struct SeekRequestMessage |
222 | { | 222 | { |
223 | /** | 223 | /** |
224 | * Set to MESSAGE_SEEK. | 224 | * Set to #MESSAGE_SEEK. |
225 | */ | 225 | */ |
226 | unsigned char opcode; | 226 | unsigned char opcode; |
227 | 227 | ||
@@ -263,7 +263,7 @@ struct SeekRequestMessage | |||
263 | struct MetaMessage | 263 | struct MetaMessage |
264 | { | 264 | { |
265 | /** | 265 | /** |
266 | * Set to MESSAGE_META. | 266 | * Set to #MESSAGE_META. |
267 | */ | 267 | */ |
268 | unsigned char opcode; | 268 | unsigned char opcode; |
269 | 269 | ||
diff --git a/src/main/extractor_ipc_gnu.c b/src/main/extractor_ipc_gnu.c index 5400636..06e4a1b 100644 --- a/src/main/extractor_ipc_gnu.c +++ b/src/main/extractor_ipc_gnu.c | |||
@@ -145,7 +145,7 @@ EXTRACTOR_IPC_shared_memory_create_ (size_t size) | |||
145 | #if SOMEBSD | 145 | #if SOMEBSD |
146 | /* this works on FreeBSD, not sure about others... */ | 146 | /* this works on FreeBSD, not sure about others... */ |
147 | tpath = getenv ("TMPDIR"); | 147 | tpath = getenv ("TMPDIR"); |
148 | if (tpath == NULL) | 148 | if (NULL == tpath) |
149 | tpath = "/tmp/"; | 149 | tpath = "/tmp/"; |
150 | #else | 150 | #else |
151 | tpath = "/"; /* Linux */ | 151 | tpath = "/"; /* Linux */ |
@@ -153,10 +153,12 @@ EXTRACTOR_IPC_shared_memory_create_ (size_t size) | |||
153 | snprintf (shm->shm_name, | 153 | snprintf (shm->shm_name, |
154 | MAX_SHM_NAME, | 154 | MAX_SHM_NAME, |
155 | "%sLE-%u-%u", | 155 | "%sLE-%u-%u", |
156 | tpath, getpid (), | 156 | tpath, |
157 | getpid (), | ||
157 | (unsigned int) RANDOM ()); | 158 | (unsigned int) RANDOM ()); |
158 | if (-1 == (shm->shm_id = shm_open (shm->shm_name, | 159 | if (-1 == (shm->shm_id = shm_open (shm->shm_name, |
159 | O_RDWR | O_CREAT, S_IRUSR | S_IWUSR))) | 160 | O_RDWR | O_CREAT, |
161 | S_IRUSR | S_IWUSR))) | ||
160 | { | 162 | { |
161 | LOG_STRERROR_FILE ("shm_open", | 163 | LOG_STRERROR_FILE ("shm_open", |
162 | shm->shm_name); | 164 | shm->shm_name); |
diff --git a/src/main/extractor_plugin_main.c b/src/main/extractor_plugin_main.c index fd4912f..b7b2996 100644 --- a/src/main/extractor_plugin_main.c +++ b/src/main/extractor_plugin_main.c | |||
@@ -120,7 +120,9 @@ plugin_env_seek (void *cls, | |||
120 | int whence) | 120 | int whence) |
121 | { | 121 | { |
122 | struct ProcessingContext *pc = cls; | 122 | struct ProcessingContext *pc = cls; |
123 | struct SeekRequestMessage srm; | 123 | struct SeekRequestMessage srm = { |
124 | .opcode = MESSAGE_SEEK | ||
125 | }; | ||
124 | struct UpdateMessage um; | 126 | struct UpdateMessage um; |
125 | uint64_t npos; | 127 | uint64_t npos; |
126 | unsigned char reply; | 128 | unsigned char reply; |
@@ -380,7 +382,9 @@ plugin_env_send_proc (void *cls, | |||
380 | static int | 382 | static int |
381 | handle_init_message (struct ProcessingContext *pc) | 383 | handle_init_message (struct ProcessingContext *pc) |
382 | { | 384 | { |
383 | struct InitMessage init; | 385 | struct InitMessage init = { |
386 | .opcode = MESSAGE_INIT_STATE | ||
387 | }; | ||
384 | 388 | ||
385 | if (NULL != pc->shm) | 389 | if (NULL != pc->shm) |
386 | { | 390 | { |
@@ -457,7 +461,9 @@ handle_init_message (struct ProcessingContext *pc) | |||
457 | static int | 461 | static int |
458 | handle_start_message (struct ProcessingContext *pc) | 462 | handle_start_message (struct ProcessingContext *pc) |
459 | { | 463 | { |
460 | struct StartMessage start; | 464 | struct StartMessage start = { |
465 | .opcode = MESSAGE_EXTRACT_START | ||
466 | }; | ||
461 | struct EXTRACTOR_ExtractContext ec; | 467 | struct EXTRACTOR_ExtractContext ec; |
462 | char done; | 468 | char done; |
463 | 469 | ||
diff --git a/src/plugins/previewopus_extractor.c b/src/plugins/previewopus_extractor.c index 0b9ab0b..9423dcd 100644 --- a/src/plugins/previewopus_extractor.c +++ b/src/plugins/previewopus_extractor.c | |||
@@ -232,6 +232,7 @@ open_output_file ( | |||
232 | #if DEBUG | 232 | #if DEBUG |
233 | fprintf (stderr, "Could not find output file format\n"); | 233 | fprintf (stderr, "Could not find output file format\n"); |
234 | #endif | 234 | #endif |
235 | error = AVERROR (ENOSYS); | ||
235 | goto cleanup; | 236 | goto cleanup; |
236 | } | 237 | } |
237 | 238 | ||
@@ -241,6 +242,7 @@ open_output_file ( | |||
241 | #if DEBUG | 242 | #if DEBUG |
242 | fprintf (stderr, "Could not find an OPUS encoder.\n"); | 243 | fprintf (stderr, "Could not find an OPUS encoder.\n"); |
243 | #endif | 244 | #endif |
245 | error = AVERROR (ENOSYS); | ||
244 | goto cleanup; | 246 | goto cleanup; |
245 | } | 247 | } |
246 | 248 | ||
@@ -1061,8 +1063,8 @@ extract_audio (struct EXTRACTOR_ExtractContext *ec) | |||
1061 | } | 1063 | } |
1062 | else | 1064 | else |
1063 | { | 1065 | { |
1064 | #if DEBUG | ||
1065 | duration = format_ctx->duration; | 1066 | duration = format_ctx->duration; |
1067 | #if DEBUG | ||
1066 | fprintf (stderr, | 1068 | fprintf (stderr, |
1067 | "Duration: %lld\n", | 1069 | "Duration: %lld\n", |
1068 | format_ctx->duration); | 1070 | format_ctx->duration); |
@@ -1131,7 +1133,8 @@ extract_audio (struct EXTRACTOR_ExtractContext *ec) | |||
1131 | * If we have enough samples for the encoder, we encode them. | 1133 | * If we have enough samples for the encoder, we encode them. |
1132 | * At the end of the file, we pass the remaining samples to | 1134 | * At the end of the file, we pass the remaining samples to |
1133 | * the encoder. | 1135 | * the encoder. |
1134 | */while (av_audio_fifo_size (fifo) >= output_frame_size || | 1136 | */// |
1137 | while (av_audio_fifo_size (fifo) >= output_frame_size || | ||
1135 | (finished && av_audio_fifo_size (fifo) > 0)) | 1138 | (finished && av_audio_fifo_size (fifo) > 0)) |
1136 | { | 1139 | { |
1137 | /** | 1140 | /** |
@@ -1201,10 +1204,8 @@ cleanup: | |||
1201 | if (output_codec_context) | 1204 | if (output_codec_context) |
1202 | avcodec_close (output_codec_context); | 1205 | avcodec_close (output_codec_context); |
1203 | 1206 | ||
1204 | if (codec_ctx) | 1207 | avcodec_close (codec_ctx); |
1205 | avcodec_close (codec_ctx); | 1208 | avformat_close_input (&format_ctx); |
1206 | if (format_ctx) | ||
1207 | avformat_close_input (&format_ctx); | ||
1208 | av_free (io_ctx); | 1209 | av_free (io_ctx); |
1209 | } | 1210 | } |
1210 | 1211 | ||