Anton Khirnov | 1 Sep 2011 11:03

[PATCH 3/9] cmdutils: add support for caller-provided option context.

This is the first step to removing the globals plague from avtools.
---
 avconv.c   |    4 ++--
 avplay.c   |    4 ++--
 avprobe.c  |    4 ++--
 avserver.c |    2 +-
 cmdutils.c |   14 +++++++++-----
 cmdutils.h |   10 ++++++++--
 ffmpeg.c   |    4 ++--
 7 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/avconv.c b/avconv.c
index 1c34c5f..2d3f3f4 100644
--- a/avconv.c
+++ b/avconv.c
 <at>  <at>  -3403,7 +3403,7  <at>  <at>  static int read_avserver_streams(AVFormatContext *s, const char *filename)
     return 0;
 }

-static void opt_output_file(const char *filename)
+static void opt_output_file(void *obj, const char *filename)
 {
     AVFormatContext *oc;
     int i, err;
 <at>  <at>  -4143,7 +4143,7  <at>  <at>  int main(int argc, char **argv)
     show_banner();

     /* parse options */
-    parse_options(argc, argv, options, opt_output_file);
+    parse_options(NULL, argc, argv, options, opt_output_file);
(Continue reading)

Alex Converse | 2 Sep 2011 19:47
Picon
Gravatar

Re: [PATCH 3/9] cmdutils: add support for caller-provided option context.

On Thu, Sep 1, 2011 at 2:03 AM, Anton Khirnov <anton@...> wrote:
>
> This is the first step to removing the globals plague from avtools.
> ---
>  avconv.c   |    4 ++--
>  avplay.c   |    4 ++--
>  avprobe.c  |    4 ++--
>  avserver.c |    2 +-
>  cmdutils.c |   14 +++++++++-----
>  cmdutils.h |   10 ++++++++--
>  ffmpeg.c   |    4 ++--
>  7 files changed, 26 insertions(+), 16 deletions(-)
>
> diff --git a/avconv.c b/avconv.c
> index 1c34c5f..2d3f3f4 100644
> --- a/avconv.c
> +++ b/avconv.c
>  <at>  <at>  -3403,7 +3403,7  <at>  <at>  static int read_avserver_streams(AVFormatContext *s, const char *filename)
>     return 0;
>  }
>
> -static void opt_output_file(const char *filename)
> +static void opt_output_file(void *obj, const char *filename)
>  {
>     AVFormatContext *oc;
>     int i, err;

Perhaps we can come up with a better name than "obj" for the options
context. octx? optctx?
(Continue reading)

Anton Khirnov | 2 Sep 2011 20:18

Re: [PATCH 3/9] cmdutils: add support for caller-provided option context.


On Fri, 2 Sep 2011 10:47:45 -0700, Alex Converse <alex.converse <at> gmail.com> wrote:
> On Thu, Sep 1, 2011 at 2:03 AM, Anton Khirnov <anton <at> khirnov.net> wrote:
> >
> > This is the first step to removing the globals plague from avtools.
> > ---
> >  avconv.c   |    4 ++--
> >  avplay.c   |    4 ++--
> >  avprobe.c  |    4 ++--
> >  avserver.c |    2 +-
> >  cmdutils.c |   14 +++++++++-----
> >  cmdutils.h |   10 ++++++++--
> >  ffmpeg.c   |    4 ++--
> >  7 files changed, 26 insertions(+), 16 deletions(-)
> >
> > diff --git a/avconv.c b/avconv.c
> > index 1c34c5f..2d3f3f4 100644
> > --- a/avconv.c
> > +++ b/avconv.c
> >  <at>  <at>  -3403,7 +3403,7  <at>  <at>  static int read_avserver_streams(AVFormatContext *s, const char *filename)
> >     return 0;
> >  }
> >
> > -static void opt_output_file(const char *filename)
> > +static void opt_output_file(void *obj, const char *filename)
> >  {
> >     AVFormatContext *oc;
> >     int i, err;
> 
> Perhaps we can come up with a better name than "obj" for the options
(Continue reading)

Anton Khirnov | 2 Sep 2011 22:37

[PATCH] cmdutils: add support for caller-provided option context.

This is the first step to removing the globals plague from avtools.
---
 avconv.c   |    4 ++--
 avplay.c   |    4 ++--
 avprobe.c  |    4 ++--
 avserver.c |    2 +-
 cmdutils.c |   14 +++++++++-----
 cmdutils.h |   10 ++++++++--
 ffmpeg.c   |    4 ++--
 7 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/avconv.c b/avconv.c
index 33da836..92273f1 100644
--- a/avconv.c
+++ b/avconv.c
 <at>  <at>  -3403,7 +3403,7  <at>  <at>  static int read_avserver_streams(AVFormatContext *s, const char *filename)
     return 0;
 }

-static void opt_output_file(const char *filename)
+static void opt_output_file(void *optctx, const char *filename)
 {
     AVFormatContext *oc;
     int i, err;
 <at>  <at>  -4143,7 +4143,7  <at>  <at>  int main(int argc, char **argv)
     show_banner();

     /* parse options */
-    parse_options(argc, argv, options, opt_output_file);
+    parse_options(NULL, argc, argv, options, opt_output_file);
(Continue reading)

Alex Converse | 2 Sep 2011 23:24
Picon
Gravatar

Re: [PATCH] cmdutils: add support for caller-provided option context.

On Fri, Sep 2, 2011 at 1:37 PM, Anton Khirnov <anton@...> wrote:
>
> This is the first step to removing the globals plague from avtools.
> ---
>  avconv.c   |    4 ++--
>  avplay.c   |    4 ++--
>  avprobe.c  |    4 ++--
>  avserver.c |    2 +-
>  cmdutils.c |   14 +++++++++-----
>  cmdutils.h |   10 ++++++++--
>  ffmpeg.c   |    4 ++--
>  7 files changed, 26 insertions(+), 16 deletions(-)
>

OK

Gmane