<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
I put the following code inside my libvlc_MediaMeataChanged event
handler:<br>
<br>
signed long long int time = libvlc_media_player_get_buffered_time(mp);<br>
printf("buffer time: %lli\n", time); <br>
<br>
It always returned a buffer time of 0. Is this the expected result or
am I doing something wrong.<br>
I got the same result if I used an int instead of a signed long long.
libvlc_time_t is a int64_t which I believe is a singed long long.<br>
<br>
On 10-07-10 01:15 AM, Frank Enderle wrote:
<blockquote cite="mid:4C38100C.6030707@anamica.de" type="cite">
  <pre wrap="">the event is fired as soon as vlc gets the data from the streaming
server. however it does not take in account that the audio data will be
buffered and thus delayed. that's why there's a gap between the event
and the actual data being valid for the current stream position.

i solved this for me by applying a patch to vlc which gives me the
ability to see how much streamtime is buffered. when i get the event i
calculate when it becomes valid by adding the time left in the buffer to
the current (monotonic) timestamp and put the result in a ring buffer
which is frequently checked. when the title change gets valid it is
shown to the user and removed from the ring.

i played with the thought to add this as a patch to vlc itself so the
event is fired timecorrected, but i didn't do it because i think it is
the applications responsibility to deal with the delay since there might
be cases when it is a good idea to have the data early, for example if
you want to do some artwork prefetch. so i only added the ability to get
the time left in the buffers.

i sent the patch a while ago to the list, but i don't think it has been
incorporated to the git master (i might be wrong). i added you the patch
against vlc 1.1.0. it gives you a new function to get the buffered time
in ms.

libvlc_time_t
libvlc_media_player_get_buffered_time(libvlc_media_player_t *p_mi);

hope this helps

frank

Am 10.07.2010 01:17, schrieb Jason Butler:
  </pre>
  <blockquote type="cite">
    <pre wrap="">I am using libvlc 1.1.0 to play an audio steam on Linux. I want to get
the title, album, and artist every time the track changes so I am
hooking up a callback function to the libvlc_MediaMetaChanged event. The
problem is when the stream starts playing the libvlc_MediaMetaChanged
event is sent serveral times before all the track meta data is valid. If
I call  libvlc_media_get_meta(m,libvlc_meta_Artist), or
libvlc_media_get_meta(m,libvlc_meta_Album) too soon then I get a segment
fault.  I thought about waiting for the libvlc_MediaPlayerPlaying event
but libvlc_MediaMetaChanged event is still sent several times before the
album and artist data is valid.

Is there a way to check if the artist and album data is valid before
calling  libvlc_media_get_meta?
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
<a class="moz-txt-link-freetext" href="http://mailman.videolan.org/listinfo/vlc-devel">http://mailman.videolan.org/listinfo/vlc-devel</a>
    </pre>
  </blockquote>
  <pre wrap="">

  </pre>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
<a class="moz-txt-link-freetext" href="http://mailman.videolan.org/listinfo/vlc-devel">http://mailman.videolan.org/listinfo/vlc-devel</a>
  </pre>
</blockquote>
<br>
</body>
</html>