Commit e80d8803 authored by Erwan Tulou's avatar Erwan Tulou

mediadirs: display snapshots in the video widget

This patch replaces vlc://pause:10 (only working for qt4 in complete mode)
with fake:// --fake-file=... (working in any cases)
parent 40461fab
......@@ -299,28 +299,34 @@ void formatSnapshotItem( input_item_t *p_item )
if( !p_item )
return;
if( !p_item->p_meta )
p_item->p_meta = vlc_meta_New();
char* psz_file = NULL;
char* psz_option = NULL;
char* psz_uri = input_item_GetURI( p_item );
if( !psz_uri )
goto end;
/* copy the snapshot mrl as a ArtURL */
if( p_item->p_meta )
{
char* psz_uri = NULL;
psz_uri = input_item_GetURI( p_item );
if( psz_uri )
input_item_SetArtURL( p_item, psz_uri );
free( psz_uri );
psz_file = make_path( psz_uri );
if( !psz_file )
goto end;
if( asprintf( &psz_option, "fake-file=%s", psz_file ) == -1 )
{
psz_option = NULL;
goto end;
}
/**
* TODO: select the best mrl for displaying snapshots
* - vlc://pause:10 => snapshot are displayed as Art
* - file:///path/image.ext => snapshot are displayed as videos
**/
input_item_SetURI( p_item, "vlc://pause:10" );
/* display still image as a video */
input_item_SetURI( p_item, "fake://" );
input_item_AddOption( p_item, psz_option, VLC_INPUT_OPTION_TRUSTED );
// input_item_AddOption( p_item, "fake-duration=10000",
// VLC_INPUT_OPTION_TRUSTED );
end:
free( psz_option );
free( psz_file );
free( psz_uri );
}
......
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