1 http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-July/072472.html
3 --- ffmpeg-0.5/vhook/imlib2.c~ 2009-07-16 13:32:19.000000000 +0300
4 +++ ffmpeg-0.5/vhook/imlib2.c 2009-07-16 13:34:17.095314527 +0300
6 AVEvalExpr *eval_r, *eval_g, *eval_b, *eval_a;
7 char *expr_R, *expr_G, *expr_B, *expr_A;
12 struct CachedImage *cache;
13 Imlib_Image imageOverlaid;
14 - AVEvalExpr *eval_x, *eval_y;
15 - char *expr_x, *expr_y;
16 + AVEvalExpr *eval_x, *eval_y, *eval_X, *eval_Y;
17 + char *expr_x, *expr_y, *expr_X, *expr_Y;
19 int imageOverlaid_width, imageOverlaid_height;
23 ff_eval_free(ci->eval_x);
24 ff_eval_free(ci->eval_y);
25 + ff_eval_free(ci->eval_X);
26 + ff_eval_free(ci->eval_Y);
27 ff_eval_free(ci->eval_r);
28 ff_eval_free(ci->eval_g);
29 ff_eval_free(ci->eval_b);
34 + av_free(ci->expr_X);
35 + av_free(ci->expr_Y);
53 imlib_add_path_to_font_path(fp);
56 - while ((c = getopt(argc, argv, "R:G:B:A:C:c:f:F:t:x:y:i:")) > 0) {
57 + while ((c = getopt(argc, argv, "R:G:B:A:C:c:f:F:t:x:y:i:X:Y:")) > 0) {
60 ci->expr_R = av_strdup(optarg);
63 ci->expr_y = av_strdup(optarg);
66 + ci->expr_X = av_strdup(optarg);
69 + ci->expr_Y = av_strdup(optarg);
72 ci->fileImage = av_strdup(optarg);
75 ci->imageOverlaid_height = imlib_image_get_height();
78 + if (!(ci->eval_X = ff_parse(ci->expr_X, const_names, NULL, NULL, NULL, NULL, &error))){
79 + av_log(NULL, AV_LOG_ERROR, "Couldn't parse X expression '%s': %s\n", ci->expr_X, error);
83 + if (!(ci->eval_Y = ff_parse(ci->expr_Y, const_names, NULL, NULL, NULL, NULL, &error))){
84 + av_log(NULL, AV_LOG_ERROR, "Couldn't parse Y expression '%s': %s\n", ci->expr_Y, error);
88 if (!(ci->eval_x = ff_parse(ci->expr_x, const_names, NULL, NULL, NULL, NULL, &error))){
89 av_log(NULL, AV_LOG_ERROR, "Couldn't parse x expression '%s': %s\n", ci->expr_x, error);
92 ci->x = ff_parse_eval(ci->eval_x, const_values, ci);
93 ci->y = ff_parse_eval(ci->eval_y, const_values, ci);
95 + ci->X = ff_parse_eval(ci->eval_X, const_values, ci);
96 + ci->Y = ff_parse_eval(ci->eval_Y, const_values, ci);
99 ci->a = ff_parse_eval(ci->eval_a, const_values, ci);
100 @@ -464,10 +490,12 @@
103 if (ci->imageOverlaid) {
104 + if (ci->X == 0) ci->X = ci->imageOverlaid_width;
105 + if (ci->Y == 0) ci->Y = ci->imageOverlaid_height;
106 imlib_context_set_image(image);
107 imlib_blend_image_onto_image(ci->imageOverlaid, 0,
108 0, 0, ci->imageOverlaid_width, ci->imageOverlaid_height,
109 - ci->x, ci->y, ci->imageOverlaid_width, ci->imageOverlaid_height);
110 + ci->x, ci->y, ci->X, ci->Y);