Unified · Split
| @@ -294,13 +294,16 @@ int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const · 293 unmodified lines | |||
| 294 | for (i = 0; i < graph->filter_count; i++) { | 294 | for (i = 0; i < graph->filter_count; i++) { |
| 295 | AVFilterContext *filter = graph->filters[i]; | 295 | AVFilterContext *filter = graph->filters[i]; |
| 296 | if(filter && (!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name))){ | 296 | if(filter && (!strcmp(target, "all") || !strcmp(target, filter->name) || !strcmp(target, filter->filter->name))){ |
| 297 | AVFilterCommand **que = &filter->command_queue; | 297 | AVFilterCommand **que = &filter->command_queue, *next; |
| 298 | while(*que) que = &(*que)->next; | 298 | while(*que && (*que)->time <= ts) |
| 299 | que = &(*que)->next; | ||
| 300 | next= *que; | ||
| 299 | *que= av_mallocz(sizeof(AVFilterCommand)); | 301 | *que= av_mallocz(sizeof(AVFilterCommand)); |
| 300 | (*que)->command = av_strdup(command); | 302 | (*que)->command = av_strdup(command); |
| 301 | (*que)->arg = av_strdup(arg); | 303 | (*que)->arg = av_strdup(arg); |
| 302 | (*que)->time = ts; | 304 | (*que)->time = ts; |
| 303 | (*que)->flags = flags; | 305 | (*que)->flags = flags; |
| 306 | (*que)->next = next; | ||
| 304 | if(flags & AVFILTER_CMD_FLAG_ONE) | 307 | if(flags & AVFILTER_CMD_FLAG_ONE) |
| 305 | return 0; | 308 | return 0; |
| 306 | } | 309 | } |