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 ) ...@@ -299,28 +299,34 @@ void formatSnapshotItem( input_item_t *p_item )
if( !p_item ) if( !p_item )
return; return;
if( !p_item->p_meta ) char* psz_file = NULL;
p_item->p_meta = vlc_meta_New(); char* psz_option = NULL;
char* psz_uri = input_item_GetURI( p_item );
if( !psz_uri )
goto end;
/* copy the snapshot mrl as a ArtURL */ /* 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 ); 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;
} }
/** /* display still image as a video */
* TODO: select the best mrl for displaying snapshots input_item_SetURI( p_item, "fake://" );
* - vlc://pause:10 => snapshot are displayed as Art input_item_AddOption( p_item, psz_option, VLC_INPUT_OPTION_TRUSTED );
* - file:///path/image.ext => snapshot are displayed as videos
**/
input_item_SetURI( p_item, "vlc://pause:10" );
// input_item_AddOption( p_item, "fake-duration=10000", end:
// VLC_INPUT_OPTION_TRUSTED ); 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