]> git.sesse.net Git - vlc/commitdiff
Merge branch 1.0-bugfix
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 23 May 2009 09:43:00 +0000 (12:43 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 23 May 2009 09:43:00 +0000 (12:43 +0300)
modules/LIST
modules/gui/macosx/controls.h
modules/gui/macosx/controls.m
modules/video_filter/alphamask.c
src/control/media_player.c
src/input/demux.c

index a48901895f34ebc4c8d2ca33156479a521cedf7b..b1b258c506c05d9b2a0ecbf1fd2219c4c65a1892 100644 (file)
@@ -230,6 +230,7 @@ $Id$
  * osdmenu: video_filter for displaying and streaming a On Screen Display menu
  * oss: audio output module using the OSS /dev/dsp interface
  * packetizer_copy: Simple copy packetizer
+ * packetizer_dirac: Dirac video packetizer
  * packetizer_h264: H264 video packetizer
  * packetizer_mlp: MLP/TrueHD audio packetizer
  * packetizer_mpeg4audio: MPEG4 audio packetizer
index b6c15093600791dbc537f7c9e2bf28e35cc2c424..9b40fdc6ef5e7e1c625c36677a4da49454cacfdb 100644 (file)
     IBOutlet id o_specificTime_mi;
 
     VLCFSPanel *o_fs_panel;
+    BOOL b_lockAspectRatio;
 }
 - (void)controlTintChanged;
 
 - (id)voutView;
+- (BOOL)aspectRatioIsLocked;
 
 - (IBAction)play:(id)sender;
 - (IBAction)stop:(id)sender;
@@ -93,6 +95,7 @@
 
 - (IBAction)telxTransparent:(id)sender;
 - (IBAction)telxNavLink:(id)sender;
+- (IBAction)lockVideosAspectRatio:(id)sender;
 - (IBAction)addSubtitleFile:(id)sender;
 
 - (BOOL)keyEvent:(NSEvent *)o_event;
index aa06beb8e34c36d4a8c0266ea79ec38b5886921e..ef16ff5d6a7b0ad9bd98d528752ebe56286892ee 100644 (file)
@@ -50,6 +50,7 @@
 {
     [super init];
     o_fs_panel = [[VLCFSPanel alloc] init];
+    b_lockAspectRatio = YES;
     return self;
 }
 
     return [[o_voutView retain] autorelease];
 }
 
+- (BOOL)aspectRatioIsLocked
+{
+    return b_lockAspectRatio;
+}
+
 - (IBAction)stop:(id)sender
 {
     intf_thread_t * p_intf = VLCIntf;
     }
 }
 
+- (IBAction)lockVideosAspectRatio:(id)sender
+{
+    if( [sender state] == NSOffState )
+        [sender setState: NSOnState];
+    else
+        [sender setState: NSOffState];
+
+    b_lockAspectRatio = !b_lockAspectRatio;
+}
+
 - (IBAction)addSubtitleFile:(id)sender
 {
     NSInteger i_returnValue = 0;
             if( input_AddSubtitle( p_input, [[[openPanel filenames] objectAtIndex: i] UTF8String], TRUE ) )
                 msg_Warn( VLCIntf, "unable to load subtitles from '%s'",
                          [[[openPanel filenames] objectAtIndex: i] UTF8String] );
-            i++;
         }
     }
 }
     /* make (un)sensitive */
     [o_parent setEnabled: ( val_list.p_list->i_count > 1 )];
 
+    /* Aspect Ratio */
+    if( [[o_parent title] isEqualToString: _NS("Aspect-ratio")] == YES )
+    {
+        NSMenuItem *o_lmi_tmp2;
+        o_lmi_tmp2 = [o_menu addItemWithTitle: _NS("Lock Aspect Ratio") action: @selector(lockVideosAspectRatio:) keyEquivalent: @""];
+        [o_lmi_tmp2 setTarget: self];
+        [o_lmi_tmp2 setEnabled: YES];
+        [o_lmi_tmp2 setState: b_lockAspectRatio];
+        [o_parent setEnabled: YES];
+        [o_menu addItem: [NSMenuItem separatorItem]];
+    }
+
     /* special case for the subtitles items */
     if( [[o_parent title] isEqualToString: _NS("Subtitles Track")] == YES )
     {
index b9ddcd9445fe63b5dd012e7bd71485effab168ec..a280e14e7682cfd8b83a712e0e34f38cdad38807 100644 (file)
@@ -107,7 +107,8 @@ static int Create( vlc_object_t *p_this )
     config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,
                        p_filter->p_cfg );
 
-    p_sys->p_mask = NULL;
+    psz_string =
+        var_CreateGetStringCommand( p_filter, CFG_PREFIX "mask" );
     if( psz_string && *psz_string )
     {
         LoadMask( p_filter, psz_string );
@@ -115,11 +116,11 @@ static int Create( vlc_object_t *p_this )
             msg_Err( p_filter, "Error while loading mask (%s).",
                      psz_string );
     }
+    else
+       p_sys->p_mask = NULL;
     free( psz_string );
 
     vlc_mutex_init( &p_sys->mask_lock );
-    psz_string =
-        var_CreateGetStringCommand( p_filter, CFG_PREFIX "mask" );
     var_AddCallback( p_filter, CFG_PREFIX "mask", MaskCallback,
                      p_filter );
     p_filter->pf_video_filter = Filter;
index 1e053e23b4eabf4520c6c2330b82ca8319cb2337..82fab1e3579f3a9e92e1445a78b7f962c01d8290 100644 (file)
@@ -282,6 +282,7 @@ libvlc_media_player_new( libvlc_instance_t * p_libvlc_instance,
     p_mi->drawable.agl = 0;
     p_mi->drawable.xid = 0;
     p_mi->drawable.hwnd = NULL;
+    p_mi->drawable.nsobject = NULL;
     p_mi->p_libvlc_instance = p_libvlc_instance;
     p_mi->p_input_thread = NULL;
     p_mi->i_refcount = 1;
index 3d210ffe62c28dbbcaf05257cb29f46900f89528..4d983212f84ebcb8731dd693ad5c06e975a7122a 100644 (file)
@@ -234,7 +234,7 @@ int demux_vaControlHelper( stream_t *s,
 
         case DEMUX_GET_TIME:
             pi64 = (int64_t*)va_arg( args, int64_t * );
-            if( i_bitrate > 0 && i_end > i_start )
+            if( i_bitrate > 0 && i_tell >= i_start )
             {
                 *pi64 = INT64_C(8000000) * (i_tell - i_start) / i_bitrate;
                 return VLC_SUCCESS;