return VLC_EGENERIC;
}
+#if X264_BUILD < 37
if( p_enc->fmt_in.video.i_width % 16 != 0 ||
p_enc->fmt_in.video.i_height % 16!= 0 )
{
p_enc->fmt_in.video.i_width >> 4 << 4,
p_enc->fmt_in.video.i_height >> 4 << 4 );
}
+#endif
sout_CfgParse( p_enc, SOUT_CFG_PREFIX, ppsz_sout_options, p_enc->p_cfg );
p_sys->i_last_ref_pts = 0;
x264_param_default( &p_sys->param );
- p_sys->param.i_width = p_enc->fmt_in.video.i_width >> 4 << 4;
- p_sys->param.i_height = p_enc->fmt_in.video.i_height >> 4 << 4;
+ p_sys->param.i_width = p_enc->fmt_in.video.i_width;
+ p_sys->param.i_height = p_enc->fmt_in.video.i_height;
+#if X264_BUILD < 37
+ p_sys->param.i_width = p_sys->param.i_width >> 4 << 4;
+ p_sys->param.i_height = p_sys->param.i_height >> 4 << 4;
+#endif
var_Get( p_enc, SOUT_CFG_PREFIX "qp-min", &val );
if( val.i_int >= 1 && val.i_int <= 51 ) i_qmin = val.i_int;
i_update_counter = 0;
i_sort_mode = MODE_NONE;
b_need_update = VLC_FALSE;
+ i_items_to_append = 0;
p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL ) return;
LockPlaylist( p_intf->p_sys, p_playlist );
playlist_item_t *p_item = playlist_ItemGetById( p_playlist,
((PlaylistItem *)p_data)->i_id );
- if( !p_item ) return;
+ if( !p_item )
+ {
+ UnlockPlaylist( p_intf->p_sys, p_playlist );
+ return;
+ }
wxString msg;
wxString duration = wxU( "" );
char *psz_author = vlc_input_item_GetInfo( &p_item->input,
_("Meta-information"),
_("Artist"));
- if( psz_author == NULL )
+ if( !psz_author )
+ {
+ UnlockPlaylist( p_intf->p_sys, p_playlist );
return;
+ }
+
char psz_duration[MSTRTIME_MAX_SIZE];
mtime_t dur = p_item->input.i_duration;
if( p_playlist->status.p_item == p_item )
{
treectrl->SetItemBold( item, true );
- treectrl->EnsureVisible( item );
+ while( treectrl->GetItemParent( item ).IsOk() )
+ {
+ item = treectrl->GetItemParent( item );
+ treectrl->Expand( item );
+ }
}
else
{
{
playlist_add_t *p_add = (playlist_add_t *)event.GetClientData();
playlist_item_t *p_item = NULL;
+ wxTreeItemId item, node;
- wxTreeItemId item,node;
+ i_items_to_append--;
- if( p_add->i_view != i_current_view )
- {
- goto update;
- }
+ /* No need to do anything if the playlist is going to be rebuilt */
+ if( b_need_update ) return;
+
+ if( p_add->i_view != i_current_view ) goto update;
node = FindItem( treectrl->GetRootItem(), p_add->i_node );
- if( !node.IsOk() )
- {
- goto update;
- }
+ if( !node.IsOk() ) goto update;
p_item = playlist_ItemGetById( p_playlist, p_add->i_item );
- if( !p_item )
- goto update;
+ if( !p_item ) goto update;
+
+ item = FindItem( treectrl->GetRootItem(), p_add->i_item );
+ if( item.IsOk() ) goto update;
item = treectrl->AppendItem( node,
wxL2U( p_item->input.psz_name ), -1,-1,
{
playlist_view_t *p_view;
+ i_items_to_append = 0;
+
/* We can remove the callbacks before locking, anyway, we won't
* miss anything */
if( b_root )
return;
}
- if( p_item->i_children == -1 )
- {
- UnlockPlaylist( p_intf->p_sys, p_playlist );
- DeleteItem( p_item->input.i_id );
- }
- else
- {
- UnlockPlaylist( p_intf->p_sys, p_playlist );
- DeleteNode( p_item );
- }
+ if( p_item->i_children == -1 ) DeleteItem( p_item->input.i_id );
+ else DeleteNode( p_item );
+
RemoveItem( item );
+ UnlockPlaylist( p_intf->p_sys, p_playlist );
}
-
-
void Playlist::DeleteItem( int item_id )
{
playlist_LockDelete( p_playlist, item_id );
LockPlaylist( p_intf->p_sys, p_playlist );
- if( !( p_wxitem && p_wxparent ) ) return;
+ if( !( p_wxitem && p_wxparent ) )
+ {
+ UnlockPlaylist( p_intf->p_sys, p_playlist );
+ return;
+ }
p_item2 = playlist_ItemGetById(p_playlist, p_wxitem->i_id);
p_node2 = playlist_ItemGetById(p_playlist, p_wxparent->i_id);
Playlist *p_playlist_dialog = (Playlist *)param;
playlist_add_t *p_add = (playlist_add_t *)malloc(sizeof( playlist_add_t));
-
memcpy( p_add, nval.p_address, sizeof( playlist_add_t ) );
+ if( p_playlist_dialog->i_items_to_append++ > 50 )
+ {
+ /* Too many items waiting to be added, it will be quicker to rebuild
+ * the whole playlist */
+ p_playlist_dialog->b_need_update = VLC_TRUE;
+ return VLC_SUCCESS;
+ }
+
wxCommandEvent event( wxEVT_PLAYLIST, AppendItem_Event );
event.SetClientData( (void *)p_add );
p_playlist_dialog->AddPendingEvent( event );