Commit 72d43142 authored by Christophe Massiot's avatar Christophe Massiot

* MPEG-1 aspect ratio patch, courtesy of Vladimir Chernyshov

  <greengrass@writeme.com> ;
* Seeking patch for X11, courtesy of Peter Surda <shurdeek@panorama.sth.ac.at>.
parent 003c2ab3
......@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: vpar_headers.c,v 1.4 2001/12/10 04:53:11 sam Exp $
* $Id: vpar_headers.c,v 1.5 2001/12/10 10:58:54 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -381,6 +381,43 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
else
{
/* It's an MPEG-1 stream. Put adequate parameters. */
int i_xyratio;
static int pi_mpeg1ratio[15] = {
10000,
10000,
6735,
7031,
7615,
8055,
8437,
8935,
9157,
9815,
10255,
10695,
10950,
11575,
12015
};
if( p_vpar->sequence.i_aspect_ratio > 1 )
{
i_xyratio = p_vpar->sequence.i_height *
pi_mpeg1ratio[p_vpar->sequence.i_aspect_ratio] /
p_vpar->sequence.i_width;
if( 7450 < i_xyratio && i_xyratio < 7550 )
{
p_vpar->sequence.i_aspect_ratio = 2;
}
else if( 5575 < i_xyratio && i_xyratio < 5675 )
{
p_vpar->sequence.i_aspect_ratio = 3;
}
else if( 4475 < i_xyratio && i_xyratio < 4575 )
{
p_vpar->sequence.i_aspect_ratio = 4;
}
}
p_vpar->sequence.b_mpeg2 = 0;
p_vpar->sequence.b_progressive = 1;
......
......@@ -2,7 +2,7 @@
* vout_common.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: vout_common.c,v 1.1 2001/12/09 17:01:37 sam Exp $
* $Id: vout_common.c,v 1.2 2001/12/10 10:58:54 massiot Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -90,6 +90,24 @@
* X11 events and allows window resizing. It returns a non null value on
* error.
*****************************************************************************/
static __inline__ void vout_Seek( int i_seek )
{
int i_tell = p_main->p_intf->p_input->stream.p_selected_area->i_tell;
i_tell += i_seek * 50 * p_main->p_intf->p_input->stream.i_mux_rate;
if( i_tell < p_main->p_intf->p_input->stream.p_selected_area->i_start )
{
i_tell = p_main->p_intf->p_input->stream.p_selected_area->i_start;
}
else if( i_tell > p_main->p_intf->p_input->stream.p_selected_area->i_size )
{
i_tell = p_main->p_intf->p_input->stream.p_selected_area->i_size;
}
input_Seek( p_main->p_intf->p_input, i_tell );
}
int _M( vout_Manage ) ( vout_thread_t *p_vout )
{
XEvent xevent; /* X11 event */
......@@ -151,6 +169,37 @@ int _M( vout_Manage ) ( vout_thread_t *p_vout )
case XK_Menu:
p_main->p_intf->b_menu_change = 1;
break;
case XK_Left:
vout_Seek( -5 );
break;
case XK_Right:
vout_Seek( 5 );
break;
case XK_Up:
vout_Seek( 60 );
break;
case XK_Down:
vout_Seek( -60 );
break;
case XK_Home:
input_Seek( p_main->p_intf->p_input,
p_main->p_intf->p_input->stream.p_selected_area->i_start );
break;
case XK_End:
input_Seek( p_main->p_intf->p_input,
p_main->p_intf->p_input->stream.p_selected_area->i_size );
break;
case XK_Page_Up:
vout_Seek( 900 );
break;
case XK_Page_Down:
vout_Seek( -900 );
break;
case XK_space:
input_SetStatus( p_main->p_intf->p_input,
INPUT_STATUS_PAUSE );
break;
default:
/* "Normal Keys"
* The reason why I use this instead of XK_0 is that
......
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