Possible inconsistency in mediacontrol_set_rate
Posted: 01 Sep 2008 12:01
I am using VLC built from source vlc_0.9.0-git20080726-1.tar.gz on
Elive Linux, Intel Core2 6400 @2.13GHz, 2GB RAM.
While trying a simple program compiled against libvlc, I came across
the following problem.
The function mediacontrol_set_rate as defined in
mediacontrol_audio_video.c, line 304, accepts an integer argument
rate, representing the playback rate in percent. It then calls
libvlc_media_player_set_rate with this value multiplied by 10:
libvlc_media_player_set_rate( self->p_media_player, rate * 10, &ex );
Unfortunately, libvlc_media_player_set_rate expects a float rate, as
defined in media_player.c, line 916.
Using directly libvlc_media_player_set_rate with float rate works fine.
A simple change in mediacontrol_audio_video.c:
313c313
< libvlc_media_player_set_rate( self->p_media_player, rate * 10, &ex );
---
> libvlc_media_player_set_rate( self->p_media_player, rate * 0.01, &ex );
fixes the problem for me.
I checked vlc-snapshot-branch-0.9.1-git-20080901.tar.gz and this
inconsistency is still there. I could not find anything relevant
searching in the forums and the tickets.
Saluto.
Elive Linux, Intel Core2 6400 @2.13GHz, 2GB RAM.
While trying a simple program compiled against libvlc, I came across
the following problem.
The function mediacontrol_set_rate as defined in
mediacontrol_audio_video.c, line 304, accepts an integer argument
rate, representing the playback rate in percent. It then calls
libvlc_media_player_set_rate with this value multiplied by 10:
libvlc_media_player_set_rate( self->p_media_player, rate * 10, &ex );
Unfortunately, libvlc_media_player_set_rate expects a float rate, as
defined in media_player.c, line 916.
Using directly libvlc_media_player_set_rate with float rate works fine.
A simple change in mediacontrol_audio_video.c:
313c313
< libvlc_media_player_set_rate( self->p_media_player, rate * 10, &ex );
---
> libvlc_media_player_set_rate( self->p_media_player, rate * 0.01, &ex );
fixes the problem for me.
I checked vlc-snapshot-branch-0.9.1-git-20080901.tar.gz and this
inconsistency is still there. I could not find anything relevant
searching in the forums and the tickets.
Saluto.