[FFmpeg-devel] [PATCH] Split huge transcode() function into transcode_init(), transcode(), and transcode_deinit().

Michael Niedermayer michaelni
Sat Oct 16 22:04:15 CEST 2010


On Sat, Oct 16, 2010 at 01:22:09PM +0200, Stefano Sabatini wrote:
> ---
>  ffmpeg.c |  104 ++++++++++++++++++++++++++++++++++++++++---------------------
>  1 files changed, 68 insertions(+), 36 deletions(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index 9513c7f..fbc8415 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -1935,30 +1935,31 @@ static int copy_chapters(int infile, int outfile)
>      return 0;
>  }
>  
> +static int nb_istreams = 0, nb_ostreams = 0;
> +static AVInputStream **ist_table = NULL;
> +static AVOutputStream **ost_table = NULL;
> +static AVInputFile *file_table;
> +
>  /*
>   * The following code is the main loop of the file converter
>   */

iam against moving local variables to global ones
also i dont see the sense in spliting this function given that it seems to
require a new struct holding its local variables. thats not simplification like
that thats messification. If there is self contained code that can be split out
into seperate functions thats a good idea to do but simply spliting a function
like func_init() func_loop1() func_loop2() func_deinit() and move all locals
to globals is no improvment

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you really think that XML is the answer, then you definitly missunderstood
the question -- Attila Kinali
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20101016/eb12d1ad/attachment.pgp>



More information about the ffmpeg-devel mailing list