[FFmpeg-devel] [PATCH 3/3] ffmpeg/ffmpeg_opt: add spec opencl device option to ffmpeg 20130408 new

Michael Niedermayer michaelni at gmx.at
Tue Apr 9 02:39:38 CEST 2013


On Mon, Apr 08, 2013 at 05:26:34PM +0800, Wei Gao wrote:
> sorry, I found that the previous has a bug in opt_opencl(), resubmit.

>  ffmpeg_opt.c |   31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> a28767916eb0e41cff4f629b3241237a5d9d97ea  0003-add-spec-opencl-device-option-to-ffmpeg-20130408-new.patch
> From e7b23e372f5a7ee612daace85a5ff37bddf7cbe6 Mon Sep 17 00:00:00 2001
> From: highgod0401 <highgod0401 at gmail.com>
> Date: Mon, 8 Apr 2013 17:22:47 +0800
> Subject: [PATCH 3/3] add spec opencl device option to ffmpeg 20130408 new
> 
> ---
>  ffmpeg_opt.c | 31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
> index 63a238d..d8fbdd0 100644
> --- a/ffmpeg_opt.c
> +++ b/ffmpeg_opt.c
> @@ -41,6 +41,9 @@
>  #include "libavutil/parseutils.h"
>  #include "libavutil/pixdesc.h"
>  #include "libavutil/pixfmt.h"
> +#if CONFIG_OPENCL
> +#include "libavutil/opencl.h"
> +#endif
>  
>  #define MATCH_PER_STREAM_OPT(name, type, outvar, fmtctx, st)\
>  {\
> @@ -317,6 +320,30 @@ static int opt_attach(void *optctx, const char *opt, const char *arg)
>      return 0;
>  }
>  
> +#if CONFIG_OPENCL
> +static int opt_opencl(void *optctx, const char *opt, const char *arg)
> +{
> +    char *content[2] = {0};
> +    const char *temp = arg;
> +    int i, ret = 0;
> +    while (*temp) {
> +        for (i = 0; i < FF_ARRAY_ELEMS(content); i++) {
    
> +            content[i] = av_get_token(&temp, "=,:[\n");
> +            temp++;
> +            if (!(*temp)) {

iam not sure this is safe, consider temp is just a " ", IIRC
av_get_token will skip over it anbd temp will point to 0 temp++
will then point to a byte after the array

[...]


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130409/1b92fd0d/attachment.asc>


More information about the ffmpeg-devel mailing list