[Ffmpeg-devel] nb_streams is never initialized?
Brian Brice
bbrice
Tue Feb 28 17:43:54 CET 2006
Gerald Dalley wrote:
> The nb_streams field does not seem to be initialized. I downloaded
> the latest source from CVS on 28 Feb 2006 and ran
>
> ./configure --enable-encoder=vc9 --enable-libogg --enable-vorbis
> --enable-theora --enable-faad --enable-xvid --enable-dts --enable-pp
> --enable-pthreads --enable-gpl make sudo make install
>
> If I then just start using the recommended "using libavcodec" style
> instructions, but look at the nb_streams, I see bogus values. I'm
> attaching an example of the problem since the mplayer ftp server is
> not allowing me to create a directory as instructed. I've attaching
> "badNbStreams.cpp" and a data file "cinepak.avi" (it's small--13k)
> that show the problem. To run it, do the following:
>
> g++ badNbStreams.cpp -I/usr/local/include -L/usr/local/lib -lavformat
> -lavcodec ./a.out
>
> And I get the following printed to the console
>
> There are 134556816 streams after opening the file. Input #0, avi,
> from 'cinepak.avi': Duration: 00:00:00.3, bitrate: 345 kb/s Stream
> #0.0: Video: cinepak, 160x120, 29.97 fps There are 134556816 streams
> after finding stream info.
I get some pretty different output than you:
There are 1 streams after opening the file.
Input #0, avi, from 'cinepak.avi':
Duration: 00:00:00.3, start: 0.000000, bitrate: 345 kb/s
Stream #0.0, 29.97 fps(r): Video: cinepak, yuv420p, 160x120
There are 1 streams after finding stream info.
I'm testing in Windows also.
> I've grepped the ffmpeg source tree, and as far as I can tell,
> nb_streams is only ever initialized when using ffm.c. I did
It's initialized in a huge memset(ptr, 0, size) for the AVFormatContext
inside av_alloc_format_context(), not explicitly set to 0 as you were
probably looking for. I'm not sure why our outputs differ.
--
Brian Brice
In order to know recursion, you must first know recursion...
More information about the ffmpeg-devel
mailing list