[FFmpeg-cvslog] r25380 - trunk/libavformat/utils.c

Michael Niedermayer michaelni
Thu Oct 7 00:02:12 CEST 2010


On Wed, Oct 06, 2010 at 10:52:26PM +0200, aurel wrote:
> Author: aurel
> Date: Wed Oct  6 22:52:26 2010
> New Revision: 25380
> 
> Log:
> dynamically use nb_streams instead of static use of MAX_STREAMS
> 
> Modified:
>    trunk/libavformat/utils.c
> 
> Modified: trunk/libavformat/utils.c
> ==============================================================================
> --- trunk/libavformat/utils.c	Wed Oct  6 22:49:25 2010	(r25379)
> +++ trunk/libavformat/utils.c	Wed Oct  6 22:52:26 2010	(r25380)
> @@ -1879,19 +1879,24 @@ static void av_estimate_timings_from_bit
>  /* only usable for MPEG-PS streams */
>  static void av_estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
>  {
> +    unsigned int nb_streams = ic->nb_streams;
>      AVPacket pkt1, *pkt = &pkt1;

useless

[..]
> @@ -2172,13 +2178,18 @@ int av_find_stream_info(AVFormatContext
>      AVStream *st;
>      AVPacket pkt1, *pkt;
>      int64_t old_offset = url_ftell(ic->pb);
> +    unsigned int nb_streams = ic->nb_streams;
>      struct {
>          int64_t last_dts;

same


>          int64_t duration_gcd;
>          int duration_count;
>          double duration_error[MAX_STD_TIMEBASES];
>          int64_t codec_info_duration;
> -    } info[MAX_STREAMS] = {{0}};
> +    } *info, *tmp_info;


this struct too belongs in AVStream, allocated in av_new_stream()
freed at the end of find_stream_info()

peppering teh code with checks if a stream was
added after every call to lavf and then reallocating arrays is very hackish
and fragile

[...]
-- 
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://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20101007/7714a3c7/attachment-0001.pgp>



More information about the ffmpeg-cvslog mailing list