[vlc] Re: How get the total time of stream without playing it??

Sigmund Augdal sigmunau at stud.ntnu.no
Thu Jun 12 17:03:44 CEST 2003


First of all, this is implementation specific discussion and should be done
in vlc-devel at videolan.org.

second thing: I think this is a very very ugly way to do this, and I don't
think the static variables will be the biggest problems with it. Some points:
VLC_Init() may take very long time to finnish (since it reads all the
plugins and stuff). The while loop may in some cases never finnish ( i.e. if 
the stream is a udp:// stream ). You also need to pass the output of
VLC_Create to VLC_Init() and VLC_Play() as the 0 object is allready used by
vlc core.

Except for this it is just plain ugly. Work is being done to clean up the
input layer so that implementing this kind of functionality will be much
easier, but don't expect it to be ready very soon.

Sigmund

On Thu, Jun 12, 2003 at 01:42:40PM +0200, Igor Andruszkiewicz wrote:
> I have stupid idea for a such function.
> 
> VLC_Create
> VLC_Init(0,"--noaudio --novideo /movie/movie.avi");
> VLC_Play(0);
> 
> while (position.i_size <= 0)
>  input_Tell(...,&position);
> 
> VLC_Stop( 0 );
> VLC_Destroy( 0 );
> 
> But here is a problem !!! The static variable !!!
> 
> static libvlc_t libvlc;
> static vlc_t *  p_static_vlc;
> 
> Igor
> 
> > There is no truly generic way to do this. Some streams vlc can play may even
> > last indeffinitly. The best thing for you is probably to have a look at the
> > input_OffsetToTime function.
> > 
> > Sigmund
> > 
> > On Thu, Jun 12, 2003 at 12:09:39PM +0200, Igor Andruszkiewicz wrote:
> > > Hi
> > > 
> > >   How can I get the total time of stream without playing it ?? (I can 
> > > do it by input_Tell() but stream should be open).  Has the VLC function
> > > like VLC_GetTotalTime(int i_object, const char * file) ???
> > > 
> > > Thanks for help:)
> > > 
> > > 
> > > Igor
> > > 
> > > -- 
> > > This is the vlc mailing-list, see http://www.videolan.org/vlc/
> > > To unsubscribe, please read http://www.videolan.org/support/lists.html
> > > If you are in trouble, please contact <postmaster at videolan.org>
> 
> -- 
> This is the vlc mailing-list, see http://www.videolan.org/vlc/
> To unsubscribe, please read http://www.videolan.org/support/lists.html
> If you are in trouble, please contact <postmaster at videolan.org>
-- 
This is the vlc mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/support/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc mailing list