Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-29 22:51:31 +0400
committerMichael Niedermayer <michaelni@gmx.at>2011-08-29 22:55:22 +0400
commitea36c44e84496a35562dab6cb03d2ca9a938224f (patch)
tree2199ee88e30165c1bb8100bc3e243ce4aad35e49 /libavfilter/avfiltergraph.c
parent37f9de59d1e793fac4cbb37045a2a34bb977b0cc (diff)
avfilter_graph_queue_command: Allow queueing commands out of order
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/avfiltergraph.c')
-rw-r--r--libavfilter/avfiltergraph.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 430f0d1699..075e15672c 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -294,13 +294,16 @@ int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const
for (i = 0; i < graph->filter_count; i++) {
AVFilterContext *filter = graph->filters[i];
if(filter && (!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name))){
- AVFilterCommand **que = &filter->command_queue;
- while(*que) que = &(*que)->next;
+ AVFilterCommand **que = &filter->command_queue, *next;
+ while(*que && (*que)->time <= ts)
+ que = &(*que)->next;
+ next= *que;
*que= av_mallocz(sizeof(AVFilterCommand));
(*que)->command = av_strdup(command);
(*que)->arg = av_strdup(arg);
(*que)->time = ts;
(*que)->flags = flags;
+ (*que)->next = next;
if(flags & AVFILTER_CMD_FLAG_ONE)
return 0;
}