-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathffmpeg-force-input-threading.patch
More file actions
54 lines (46 loc) · 1.53 KB
/
ffmpeg-force-input-threading.patch
File metadata and controls
54 lines (46 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From e4fe70eb4beb0cef616da790df00e47a94c7f1a7 Mon Sep 17 00:00:00 2001
From: Patrick Keroulas <patrick.keroulas@gmail.com>
Date: Fri, 16 Nov 2018 16:57:38 -0500
Subject: ffmpeg: force input threading
---
fftools/ffmpeg.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index e7384f052a..a00709979d 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -23,6 +23,8 @@
* multimedia converter based on the FFmpeg libraries
*/
+#define _GNU_SOURCE // needed for thread_setname_np
+
#include "config.h"
#include <ctype.h>
#include <string.h>
@@ -3717,8 +3719,9 @@ static int init_input_thread(int i)
int ret;
InputFile *f = input_files[i];
+ /* we want to force a seperate input thread even with only one input */
if (f->thread_queue_size < 0)
- f->thread_queue_size = (nb_input_files > 1 ? 8 : 0);
+ f->thread_queue_size = 8; //(nb_input_files > 1 ? 8 : 0);
if (!f->thread_queue_size)
return 0;
@@ -3735,6 +3738,7 @@ static int init_input_thread(int i)
av_thread_message_queue_free(&f->in_thread_queue);
return AVERROR(ret);
}
+ pthread_setname_np(f->thread, "ffmpeg-input");
return 0;
}
@@ -3781,7 +3785,8 @@ static int get_input_packet(InputFile *f, AVPacket **pkt)
}
#if HAVE_THREADS
- if (f->thread_queue_size)
+ /* we use a seperate input thread even with only one input */
+ // if (f->thread_queue_size)
return get_input_packet_mt(f, pkt);
#endif
*pkt = f->pkt;
--
2.25.1