Commit 5232e588 authored by Yoann Peronneau's avatar Yoann Peronneau

* modules/control/hotkeys.c: Fixed a bug with hotkey 't': length was

sometimes not display, although it was known.
parent 596da306
...@@ -408,35 +408,25 @@ static void Run( intf_thread_t *p_intf ) ...@@ -408,35 +408,25 @@ static void Run( intf_thread_t *p_intf )
} }
else if( i_action == ACTIONID_POSITION ) else if( i_action == ACTIONID_POSITION )
{ {
playlist_t *p_playlist =
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
char psz_duration[MSTRTIME_MAX_SIZE]; char psz_duration[MSTRTIME_MAX_SIZE];
char psz_time[MSTRTIME_MAX_SIZE]; char psz_time[MSTRTIME_MAX_SIZE];
vlc_value_t time; vlc_value_t time;
mtime_t i_seconds; mtime_t i_seconds;
var_Get( p_input, "time", &time ); var_Get( p_input, "time", &time );
if( p_playlist )
{
mtime_t dur =
p_playlist->pp_items[p_playlist->i_index]->input.i_duration;
i_seconds = time.i_time / 1000000; i_seconds = time.i_time / 1000000;
secstotimestr ( psz_time, i_seconds ); secstotimestr ( psz_time, i_seconds );
if( dur != -1 ) var_Get( p_input, "length", &time );
if( time.i_time > 0 )
{ {
secstotimestr( psz_duration, dur / 1000000 ); secstotimestr( psz_duration, time.i_time / 1000000 );
vout_OSDMessage( p_playlist, "%s / %s", vout_OSDMessage( p_input, "%s / %s",
psz_time, psz_duration ); psz_time, psz_duration );
} }
else if( i_seconds > 0 ) else if( i_seconds > 0 )
{ {
vout_OSDMessage( p_playlist, psz_time ); vout_OSDMessage( p_input, psz_time );
}
vlc_object_release( p_playlist );
} }
} }
else if( i_action >= ACTIONID_PLAY_BOOKMARK1 && else if( i_action >= ACTIONID_PLAY_BOOKMARK1 &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment