xine_play / xine_get_pos_length woes

View: New views
1 Messages — Rating Filter:   Alert me  

xine_play / xine_get_pos_length woes

by Frank Enderle-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,

i'm currently developing an application for a project where i use lib-xine
(which is really great btw). however, i encountered one strange behaviour.

background: i need to know the length of a stream actually before i play
it to do some calculations. so if the streams provides a length i'd like to
know it. everything works fine when i open the mrl for the first time and
then ask using get_pos_length for the stream length. but when i open the
stream for the second time (after closing it of course) i alwass get 0 as
length and the correct length is not reported until i started playing the
stream.

some pseudo code:

loop:
  xine_open("file.mp3");
  xine_get_pos_len(); <-- in the first loop returns correct information,
afterwards it's 0
  ... do some calculations with length
  xine_play();
  ... wait till finished playing
  xine_close();
  goto loop

i'm a little bit stuck here since i don't know how to get the length
before starting to play. i'm going to cache the length for now, but i feel
this is not the perfect way to go. so maybe someone know anything that
helps; maybe it's even a bug - i don't know, but i'd like to ;)

thanks and regards,

frank

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
xine-devel mailing list
xine-devel@...
https://lists.sourceforge.net/lists/listinfo/xine-devel