[FFmpeg-devel] [PATCH] Remove hard limit on number of files

Michael Niedermayer michaelni
Sun Feb 7 01:51:33 CET 2010


On Sat, Feb 06, 2010 at 03:52:51PM -0200, Lucas Clemente Vella wrote:
> Michael Niedermayer escreveu:
[...]

> 
> > [...]
> >> @@ -1676,13 +1699,17 @@ static int av_encode(AVFormatContext **output_files,
> >>      AVCodecContext *codec, *icodec;
> >>      AVOutputStream *ost, **ost_table = NULL;
> >>      AVInputStream *ist, **ist_table = NULL;
> >> -    AVInputFile *file_table;
> >> +    AVInputFile *file_table= NULL;
> >> +    uint8_t *no_packet= NULL;
> >>      char error[1024];
> >>      int key;
> >>      int want_sdp = 1;
> >> -    uint8_t no_packet[MAX_FILES]={0};
> >>      int no_packet_count=0;
> >>  
> >> +    no_packet= av_mallocz(nb_input_files * sizeof(uint8_t));
> >> +    if (!no_packet)
> >> +        goto fail;
> >> +
> > 
> > again, an array instead of the struct you added
> 
> This array is local. The fields I moved to the struct where globals.

id like to keep ffmpeg.c simple and clean so that it
can be maintained that is without all the duplicate structs and arrays
iam ok with the addition of a single additional array of structs for
output files, unless this can be avoided (there already is one for input files)
beyond that i prefer to keep the MAX_FILES define


[...]
> >>          default:
> >>              abort();
> >>          }
> >>      }
> >>  
> >> -    input_files[nb_input_files] = ic;
> >> -    input_files_ts_offset[nb_input_files] = input_ts_offset - (copy_ts ? 0 : timestamp);
> >> +    fc->input_file_ts_offset = input_ts_offset - (copy_ts ? 0 : timestamp);
> >>      /* dump the file content */
> >>      if (verbose >= 0)
> >>          dump_format(ic, nb_input_files, filename, 0);
> > 
> > the setting of ic dissappears.
> 
> It is in the beginning of the function:
> 
>      /* get default parameters from command line */
> -    ic = avformat_alloc_context();
> +    ic = fc->format = avformat_alloc_context();
>      if (!ic) {
> 

and why do you not leave it where it is?

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100207/b0b70600/attachment.pgp>



More information about the ffmpeg-devel mailing list