Commit 2255350f authored by Gildas Bazin's avatar Gildas Bazin

ALL: backport of 13058,13059,13070,13088,13090,13091,13099 from trunk.

parent 83c0719b
......@@ -191,8 +191,17 @@ int E_(OpenDemux)( vlc_object_t *p_this )
vlc_fourcc_t fcc;
if( !E_(GetVlcFourcc)( cc->codec_id, NULL, &fcc, NULL ) )
{
fcc = VLC_FOURCC( 'u', 'n', 'd', 'f' );
/* Special case for raw video data */
if( cc->codec_id == CODEC_ID_RAWVIDEO )
{
msg_Dbg( p_demux, "raw video, pixel format: %i", cc->pix_fmt );
fcc = E_(GetVlcChroma)( cc->pix_fmt );
}
}
switch( cc->codec_type )
{
case CODEC_TYPE_AUDIO:
......
......@@ -236,6 +236,7 @@ static int Open ( vlc_object_t *p_this )
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 )
{
......@@ -253,6 +254,7 @@ static int Open ( vlc_object_t *p_this )
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 );
......@@ -265,8 +267,12 @@ static int Open ( vlc_object_t *p_this )
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;
......
......@@ -204,6 +204,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
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;
......@@ -483,15 +484,23 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
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;
......@@ -518,7 +527,11 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
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
{
......@@ -532,23 +545,23 @@ void Playlist::AppendItem( wxCommandEvent& event )
{
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,
......@@ -747,6 +760,8 @@ void Playlist::Rebuild( vlc_bool_t b_root )
{
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 )
......@@ -851,21 +866,13 @@ void Playlist::DeleteTreeItem( wxTreeItemId item )
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 );
......@@ -1078,7 +1085,11 @@ void Playlist::OnActivateItem( wxTreeEvent& event )
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);
......@@ -1505,9 +1516,16 @@ static int ItemAppended( vlc_object_t *p_this, const char *psz_variable,
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 );
......
......@@ -878,6 +878,7 @@ public:
void AppendItem( wxCommandEvent& );
bool b_need_update;
int i_items_to_append;
private:
void RemoveItem( int );
......
......@@ -1500,6 +1500,8 @@ static int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_t *id )
/* Close the encoder.
* We'll open it only when we have the first frame. */
module_Unneed( id->p_encoder, id->p_encoder->p_module );
if( id->p_encoder->fmt_out.p_extra )
free( id->p_encoder->fmt_out.p_extra );
id->p_encoder->p_module = NULL;
if( p_sys->i_threads >= 1 )
......
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