{
p_item = _p_item;
b_cleaned = true;
+ i_runs = 0;
setWindowTitle( qtr( "Media information" ) );
resize( 600 , 480 );
/* Call update by hand, so info is shown from current item too */
if( THEMIM->getInput() )
- update( input_GetItem(THEMIM->getInput()), true, true );
+ update( input_GetItem(THEMIM->getInput() ), true, true );
+ if( stats )
+ ON_TIMEOUT( updateOnTimeOut() );
}
MediaInfoDialog::~MediaInfoDialog()
vlc_object_release( p_input );
}
+void MediaInfoDialog::updateOnTimeOut()
+{
+ /* Timer runs at 150 ms, dont' update more than 2 times per second */
+ i_runs++;
+ if( i_runs % 4 != 0 ) return;
+
+ /* Get Input and clear if non-existant */
+ input_thread_t *p_input = THEMIM->getInput();
+
+ if( p_input && !p_input->b_dead )
+ {
+ vlc_object_yield( p_input );
+ update( input_GetItem(p_input), false, false);
+ vlc_object_release( p_input );
+ }
+}
+
void MediaInfoDialog::update( input_item_t *p_item,
bool update_info,
bool update_meta )