<html><body bgcolor="#FFFFFF"><div><br>Hello Rune,</div><div><br>El 20/12/2010, a las 16:14, Rune Botten <<a href="mailto:rbotten@gmail.com">rbotten@gmail.com</a>> escribió:<br><br></div><div></div><blockquote type="cite"><div><span>---</span><br><span> .../macosx/framework/Headers/Public/VLCMedia.h | 12 ++++++--</span><br><span> projects/macosx/framework/Sources/VLCMedia.m | 30 +++++++++++++++++++-</span><br><span> 2 files changed, 38 insertions(+), 4 deletions(-)</span><br><span></span><br><span>diff --git a/projects/macosx/framework/Headers/Public/VLCMedia.h b/projects/macosx/framework/Headers/Public/VLCMedia.h</span><br><span>index 1322332..29e9578 100644</span><br><span>--- a/projects/macosx/framework/Headers/Public/VLCMedia.h</span><br><span>+++ b/projects/macosx/framework/Headers/Public/VLCMedia.h</span><br><span>@@ -332,15 +332,21 @@ extern NSString *VLCMediaTracksInformationTypeUnknown;</span><br><span> */</span><br><span> - (void)parse;</span><br><span></span><br><span>-/**************************************************************************</span><br><span>+/**</span><br><span> * Add options to the media, that will be used to determine how</span><br><span> * VLCMediaPlayer will read the media. This allow to use VLC advanced</span><br><span> * reading/streaming options in a per-media basis</span><br><span> *</span><br><span> * The options are detailed in vlc --long-help, for instance "--sout-all"</span><br><span> * And on the web: <a href="http://wiki.videolan.org/VLC_command-line_help"><a href="http://wiki.videolan.org/VLC_command-line_help">http://wiki.videolan.org/VLC_command-line_help</a></a></span><br><span>-</span><br><span>-**************************************************************************/</span><br><span>+*/</span><br><span> - (void) addOptions:(NSDictionary*) options;</span><br><span></span><br><span>+/**</span><br><span>+ * Getter for statistics information</span><br><span>+ * Returns a NSDictionary with NSNumbers for values.</span><br><span>+ *</span><br><span>+ */</span><br><span>+- (NSDictionary*) getStats;</span><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#0023A3"><br></font></font></div></blockquote><div><br></div><div>The "get" prefix is superfluous, and doesn't match our coding style.</div><div><br></div><blockquote type="cite"><div><span> @end</span><br><span>diff --git a/projects/macosx/framework/Sources/VLCMedia.m b/projects/macosx/framework/Sources/VLCMedia.m</span><br><span>index 958591e..eaf0dd3 100644</span><br><span>--- a/projects/macosx/framework/Sources/VLCMedia.m</span><br><span>+++ b/projects/macosx/framework/Sources/VLCMedia.m</span><br><span>@@ -240,7 +240,7 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)</span><br><span> libvlc_event_detach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self);</span><br><span> libvlc_event_detach(p_em, libvlc_MediaStateChanged, HandleMediaStateChanged, self);</span><br><span> libvlc_event_detach(p_em, libvlc_MediaSubItemAdded, HandleMediaSubItemAdded, self);</span><br><span>- libvlc_event_detach(p_em, libvlc_MediaParsedChanged, HandleMediaParsedChanged, self);</span><br><span>+ libvlc_event_detach(p_em, libvlc_MediaParsedChanged, HandleMediaParsedChanged, self);</span><br><span> [[VLCEventManager sharedManager] cancelCallToObject:self];</span><br><span></span><br><span> // Testing to see if the pointer exists is not required, if the pointer is null</span><br><span>@@ -338,6 +338,34 @@ static void HandleMediaParsedChanged(const libvlc_event_t * event, void * self)</span><br><span> }</span><br><span> }</span><br><span></span><br><span>+- (NSDictionary*) getStats</span><br><span>+{</span><br><span>+ if(!p_md)</span><br><span>+ return NULL;</span><br><span>+</span><br><span>+ NSMutableDictionary *d = [NSMutableDictionary dictionary];</span><br><span>+ libvlc_media_stats_t p_stats;</span><br><span>+ libvlc_media_get_stats(p_md, &p_stats);</span><br><span>+</span><br><span>+ [d setObject:[NSNumber numberWithFloat: p_stats.f_demux_bitrate] forKey:@"demux_bitrate"];</span><br></div></blockquote><div><br></div><div>While we are at it, could we use upper case for key name (demuxBitrate)?</div><div><br></div><div>Thanks for the patches!</div><div><br></div><div>Pierre.</div></body></html>