]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwindows/*: you can now specify input options in the stream output...
authorGildas Bazin <gbazin@videolan.org>
Thu, 24 Jul 2003 21:50:28 +0000 (21:50 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 24 Jul 2003 21:50:28 +0000 (21:50 +0000)
* modules/misc/freetype.c: bail out if no font has been specified.
* modules/demux/util/sub.h: don't forget to detach the demuxsub object.

modules/demux/util/sub.h
modules/gui/wxwindows/open.cpp
modules/gui/wxwindows/streamout.cpp
modules/gui/wxwindows/wxwindows.h
modules/misc/freetype.c

index ea99d76f4e60f259643f2ba8d9bc1d5c93032148..2b0f43c551e64a0198a48593478e7f1792d16217 100644 (file)
@@ -2,7 +2,7 @@
  * sub.h
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: sub.h,v 1.5 2003/07/23 23:05:25 gbazin Exp $
+ * $Id: sub.h,v 1.6 2003/07/24 21:50:28 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  * 
@@ -148,6 +148,7 @@ static inline
     else
     {
         msg_Warn( p_input, "failed to start subtitle demux" );
+        vlc_object_detach( p_sub );
         if( p_sub->p_module )
         {
             module_Unneed( p_sub, p_sub->p_module );
@@ -193,12 +194,13 @@ static inline int subtitle_Seek( subtitle_demux_t *p_sub, mtime_t i_date )
 static inline void subtitle_Close( subtitle_demux_t *p_sub )
 {
     msg_Info( p_sub, "subtitle stopped" );
-    if( p_sub->p_module )
-    {
-        module_Unneed( p_sub, p_sub->p_module );
-    }
     if( p_sub )
     {
+        vlc_object_detach( p_sub );
+        if( p_sub->p_module )
+        {
+            module_Unneed( p_sub, p_sub->p_module );
+        }
         vlc_object_destroy( p_sub );
     }
 }
index 80b35283cacb4f5c875f6f08c6df8fcc368f5473..16d13cf8ad1525d50ef11c5ac629db4c8c8620ed 100644 (file)
@@ -2,7 +2,7 @@
  * open.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: open.cpp,v 1.31 2003/07/24 17:31:59 gbazin Exp $
+ * $Id: open.cpp,v 1.32 2003/07/24 21:50:28 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -588,54 +588,6 @@ void OpenDialog::UpdateMRL( int i_access_method )
     mrl_combo->SetValue( mrltemp );
 }
 
-wxArrayString OpenDialog::SeparateEntries( wxString entries )
-{
-    vlc_bool_t b_quotes_mode = VLC_FALSE;
-
-    wxArrayString entries_array;
-    wxString entry;
-
-    wxStringTokenizer token( entries, wxT(" \t\r\n\""), wxTOKEN_RET_DELIMS );
-
-    while( token.HasMoreTokens() )
-    {
-        entry += token.GetNextToken();
-
-        if( entry.IsEmpty() ) continue;
-
-        if( !b_quotes_mode && entry.Last() == wxT('\"') )
-        {
-            /* Enters quotes mode */
-            entry.RemoveLast();
-            b_quotes_mode = VLC_TRUE;
-        }
-        else if( b_quotes_mode && entry.Last() == wxT('\"') )
-        {
-            /* Finished the quotes mode */
-            entry.RemoveLast();
-            if( !entry.IsEmpty() ) entries_array.Add( entry );
-            entry.Empty();
-            b_quotes_mode = VLC_FALSE;
-        }
-        else if( !b_quotes_mode && entry.Last() != wxT('\"') )
-        {
-            /* we found a non-quoted standalone string */
-            if( token.HasMoreTokens() ||
-                entry.Last() == wxT(' ') || entry.Last() == wxT('\t') ||
-                entry.Last() == wxT('\r') || entry.Last() == wxT('\n') )
-                entry.RemoveLast();
-            if( !entry.IsEmpty() ) entries_array.Add( entry );
-            entry.Empty();
-        }
-        else
-        {;}
-    }
-
-    if( !entry.IsEmpty() ) entries_array.Add( entry );
-
-    return entries_array;
-}
-
 /*****************************************************************************
  * Events methods.
  *****************************************************************************/
@@ -900,8 +852,7 @@ void OpenDialog::OnSoutSettings( wxCommandEvent& WXUNUSED(event) )
 
     if( sout_dialog && sout_dialog->ShowModal() == wxID_OK )
     {
-        sout_mrl.Empty();
-        sout_mrl.Add( wxString(wxT("sout=")) + sout_dialog->mrl );
+        sout_mrl = sout_dialog->GetOptions();
     }
 }
 
@@ -945,3 +896,54 @@ void OpenDialog::OnDemuxDumpChange( wxCommandEvent& WXUNUSED(event) )
     config_PutPsz( p_intf, "demuxdump-file",
                    demuxdump_textctrl->GetValue().mb_str() );
 }
+
+/*****************************************************************************
+ * Utility functions.
+ *****************************************************************************/
+wxArrayString SeparateEntries( wxString entries )
+{
+    vlc_bool_t b_quotes_mode = VLC_FALSE;
+
+    wxArrayString entries_array;
+    wxString entry;
+
+    wxStringTokenizer token( entries, wxT(" \t\r\n\""), wxTOKEN_RET_DELIMS );
+
+    while( token.HasMoreTokens() )
+    {
+        entry += token.GetNextToken();
+
+        if( entry.IsEmpty() ) continue;
+
+        if( !b_quotes_mode && entry.Last() == wxT('\"') )
+        {
+            /* Enters quotes mode */
+            entry.RemoveLast();
+            b_quotes_mode = VLC_TRUE;
+        }
+        else if( b_quotes_mode && entry.Last() == wxT('\"') )
+        {
+            /* Finished the quotes mode */
+            entry.RemoveLast();
+            if( !entry.IsEmpty() ) entries_array.Add( entry );
+            entry.Empty();
+            b_quotes_mode = VLC_FALSE;
+        }
+        else if( !b_quotes_mode && entry.Last() != wxT('\"') )
+        {
+            /* we found a non-quoted standalone string */
+            if( token.HasMoreTokens() ||
+                entry.Last() == wxT(' ') || entry.Last() == wxT('\t') ||
+                entry.Last() == wxT('\r') || entry.Last() == wxT('\n') )
+                entry.RemoveLast();
+            if( !entry.IsEmpty() ) entries_array.Add( entry );
+            entry.Empty();
+        }
+        else
+        {;}
+    }
+
+    if( !entry.IsEmpty() ) entries_array.Add( entry );
+
+    return entries_array;
+}
index 47d1406acea80c86f999c2822c20971ee5781ac9..a73345ef8da7303d5b72a055f71f8439b2cbc82c 100644 (file)
@@ -2,7 +2,7 @@
  * streamout.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: streamout.cpp,v 1.26 2003/07/20 21:28:52 gbazin Exp $
+ * $Id: streamout.cpp,v 1.27 2003/07/24 21:50:28 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
 
 #include <vlc/intf.h>
 
-#if defined MODULE_NAME_IS_skins
-#   include "../skins/src/skin_common.h"
-#endif
-
 #include "wxwindows.h"
 
 #ifndef wxRB_SINGLE
@@ -249,6 +245,11 @@ SoutDialog::~SoutDialog()
 {
 }
 
+wxArrayString SoutDialog::GetOptions()
+{
+   return SeparateEntries( mrl_combo->GetValue() );
+}
+
 /*****************************************************************************
  * Private methods.
  *****************************************************************************/
@@ -361,7 +362,7 @@ void SoutDialog::UpdateMRL()
     }
 
     if( !transcode.IsEmpty() || !duplicate.IsEmpty() )
-        mrl_combo->SetValue( wxT("#") + transcode + duplicate );
+        mrl_combo->SetValue( wxT(":sout=#") + transcode + duplicate );
     else
         mrl_combo->SetValue( wxT("") );
 }
@@ -710,9 +711,7 @@ wxPanel *SoutDialog::TranscodingPanel( wxWindow* parent )
 void SoutDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
 {
     mrl_combo->Append( mrl_combo->GetValue() );
-    mrl = mrl_combo->GetValue();
     EndModal( wxID_OK );
-    
 }
 
 void SoutDialog::OnCancel( wxCommandEvent& WXUNUSED(event) )
index a14750d79f7b353956c7c22f41089ef8b34eeea6..9e239940d541057775d0d9a472b572a1157364d2 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.48 2003/07/24 16:07:10 gbazin Exp $
+ * $Id: wxwindows.h,v 1.49 2003/07/24 21:50:28 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -65,7 +65,8 @@ class FileInfo;
 
 #endif
 
-#if !defined(MODULE_NAME_IS_skins)
+wxArrayString SeparateEntries( wxString );
+
 /*****************************************************************************
  * intf_sys_t: description and status of wxwindows interface
  *****************************************************************************/
@@ -100,7 +101,6 @@ struct intf_sys_t
     wxMenu              *p_popup_menu;
 
 };
-#endif /* !defined(MODULE_NAME_IS_skins) */
 
 /*****************************************************************************
  * Prototypes
@@ -259,7 +259,6 @@ private:
     wxPanel *SatPanel( wxWindow* parent );
 
     void UpdateMRL( int i_access_method );
-    wxArrayString SeparateEntries( wxString );
 
     /* Event handlers (these functions should _not_ be virtual) */
     void OnOk( wxCommandEvent& event );
@@ -347,7 +346,7 @@ public:
     SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
     virtual ~SoutDialog();
 
-    wxString mrl;
+    wxArrayString GetOptions();
 
 private:
     void UpdateMRL();
index 36e7e4bb309242dc5a77c7af84c387e8257ccac3..3b74715f121af7ec018fca5f62dcd63f874b8fd9 100644 (file)
@@ -2,7 +2,7 @@
  * freetype.c : Put text on the video, using freetype2
  *****************************************************************************
  * Copyright (C) 2002, 2003 VideoLAN
- * $Id: freetype.c,v 1.12 2003/07/24 19:30:27 sigmunau Exp $
+ * $Id: freetype.c,v 1.13 2003/07/24 21:50:28 gbazin Exp $
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *
@@ -154,6 +154,10 @@ static int Create( vlc_object_t *p_this )
         strcat( psz_fontfile, "\\fonts\\arial.ttf" );
 #elif SYS_DARWIN
         strcpy( psz_fontfile, DEFAULT_FONT );
+#else
+        msg_Err( p_vout, "user didn't specify a font" );
+        free( p_vout->p_text_renderer_data );
+        return VLC_EGENERIC;
 #endif
     }