Commit f6c80a75 authored by Stéphane Borel's avatar Stéphane Borel

-Various bug fixes in dvd_netlist. Some bugs seem to remain though.

-New function input_ToggleES for interaction with interface.
-Changes in gnome interface : navigation menus are now splited, there
are radio item in menus and the code should be better.
-First step for dvd_ifo rewritting. Now allocation/disallocation is
being done as it has to be.
-Fixed a bug in title management that make dvd like Seven work.
parent e38b7772
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.28 2001/03/07 10:31:10 stef Exp $
* $Id: input_ext-intf.h,v 1.29 2001/04/01 07:31:38 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -353,3 +353,6 @@ void input_Seek ( struct input_thread_s *, off_t );
void input_DumpStream( struct input_thread_s * );
char * input_OffsetToTime( struct input_thread_s *, char * psz_buffer, off_t );
int input_ChangeES ( struct input_thread_s *, struct es_descriptor_s *, int );
int input_ToggleES ( struct input_thread_s *,
struct es_descriptor_s *,
boolean_t );
This diff is collapsed.
This diff is collapsed.
......@@ -7,7 +7,7 @@
* will only be given back to netlist when refcount is zero.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
* $Id: dvd_netlist.c,v 1.3 2001/03/22 01:23:03 stef Exp $
* $Id: dvd_netlist.c,v 1.4 2001/04/01 07:31:38 stef Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
* Stphane Borel <stef@videolan.org>
......@@ -357,7 +357,7 @@ struct data_packet_s * DVDNewPacket( void * p_method_data,
{
dvd_netlist_t * p_netlist;
struct data_packet_s * p_packet;
//intf_ErrMsg( "netlist: New packet" );
/* cast */
p_netlist = (dvd_netlist_t *)p_method_data;
......@@ -382,14 +382,18 @@ struct data_packet_s * DVDNewPacket( void * p_method_data,
p_packet = p_netlist->pp_free_data[p_netlist->i_data_start];
p_packet->p_buffer =
p_netlist->p_free_iovec[p_netlist->i_iovec_start].iov_base;
p_netlist->p_free_iovec[p_netlist->i_iovec_start].iov_base;
p_packet->p_payload_start = p_packet->p_buffer;
p_packet->p_payload_end =
p_packet->p_buffer + i_buffer_size;
p_packet->p_buffer + i_buffer_size;
p_packet->p_next = NULL;
p_packet->b_discard_payload = 0;
p_packet->pi_refcount = p_netlist->pi_refcount + p_netlist->i_iovec_start;
(*p_packet->pi_refcount)++;
p_netlist->i_iovec_start ++;
p_netlist->i_iovec_start &= p_netlist->i_nb_iovec;
......@@ -411,6 +415,7 @@ struct pes_packet_s * DVDNewPES( void * p_method_data )
dvd_netlist_t * p_netlist;
pes_packet_t * p_return;
//intf_ErrMsg( "netlist: New pes" );
/* cast */
p_netlist = (dvd_netlist_t *)p_method_data;
......@@ -433,9 +438,10 @@ struct pes_packet_s * DVDNewPES( void * p_method_data )
vlc_mutex_unlock (&p_netlist->lock);
/* initialize PES */
p_return->b_data_alignment =
p_return->b_discontinuity =
p_return->i_pts = p_return->i_dts = 0;
p_return->b_data_alignment = 0;
p_return->b_discontinuity = 0;
p_return->i_pts = 0;
p_return->i_dts = 0;
p_return->i_pes_size = 0;
p_return->p_first = NULL;
......@@ -462,6 +468,9 @@ void DVDDeletePacket( void * p_method_data, data_packet_t * p_data )
p_netlist->pp_free_data[p_netlist->i_data_end] = p_data;
p_data->p_next = NULL;
p_data->b_discard_payload = 0;
/* Update reference counter */
(*p_data->pi_refcount)--;
......@@ -510,7 +519,7 @@ void DVDDeletePES( void * p_method_data, pes_packet_t * p_pes )
/* Update reference counter */
(*p_current_packet->pi_refcount)--;
if( (*p_current_packet->pi_refcount) == 0 )
if( (*p_current_packet->pi_refcount) <= 0 )
{
p_netlist->i_iovec_end++;
p_netlist->i_iovec_end &= p_netlist->i_nb_iovec;
......@@ -520,6 +529,7 @@ void DVDDeletePES( void * p_method_data, pes_packet_t * p_pes )
p_next_packet = p_current_packet->p_next;
p_current_packet->p_next = NULL;
p_current_packet->b_discard_payload = 0;
p_current_packet = p_next_packet;
}
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* input_dvd.h: thread structure of the DVD plugin
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_dvd.h,v 1.13 2001/03/21 13:42:33 sam Exp $
* $Id: input_dvd.h,v 1.14 2001/04/01 07:31:38 stef Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
......@@ -41,6 +41,7 @@ typedef struct thread_dvd_data_s
/* Navigation information */
int i_title;
int i_vts_title;
int i_program_chain;
int i_chapter_nb;
int i_chapter;
......@@ -59,17 +60,16 @@ typedef struct thread_dvd_data_s
struct css_s * p_css;
/* Structure that contains all information of the DVD */
struct ifo_s ifo;
struct ifo_s * p_ifo;
} thread_dvd_data_t;
/*****************************************************************************
* Prototypes in dvd_ifo.c
*****************************************************************************/
struct ifo_s IfoInit ( int );
int IfoReadVTS ( struct ifo_s * );
void IfoRead ( struct ifo_s * );
void IfoEnd ( ifo_t * );
int IfoInit ( struct ifo_s **, int );
int IfoTitleSet ( struct ifo_s * );
void IfoEnd ( struct ifo_s * );
/*****************************************************************************
* Prototypes in dvd_css.c
......
......@@ -2,9 +2,10 @@
* gnome_callbacks.c : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.c,v 1.18 2001/03/21 13:42:34 sam Exp $
* $Id: gnome_callbacks.c,v 1.19 2001/04/01 07:31:38 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -244,7 +245,10 @@ on_menubar_audio_toggle (GtkCheckMenuItem *menuitem,
p_es = (es_descriptor_t*)user_data;
input_ChangeES( p_intf->p_input, p_es, 1 );
if( p_intf->p_sys->b_menus_ready )
{
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
}
}
......@@ -257,7 +261,10 @@ on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem,
p_es = (es_descriptor_t*)user_data;
input_ChangeES( p_intf->p_input, p_es, 2 );
if( p_intf->p_sys->b_menus_ready )
{
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
}
}
......@@ -267,9 +274,13 @@ on_menubar_title_toggle (GtkCheckMenuItem *menuitem,
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)user_data );
p_intf->p_sys->b_menus_update = 1;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
if( menuitem->active && p_intf->p_sys->b_menus_ready )
{
p_intf->p_input->pf_set_area( p_intf->p_input,
(input_area_t*)user_data );
p_intf->p_sys->b_menus_update = 1;
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
}
......@@ -281,9 +292,12 @@ on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
gint i_chapter = (gint)user_data;
p_area->i_part = i_chapter;
if( menuitem->active && p_intf->p_sys->b_menus_ready )
{
p_area->i_part = i_chapter;
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
}
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
......@@ -558,7 +572,10 @@ on_popup_audio_toggle (GtkCheckMenuItem *menuitem,
p_es = (es_descriptor_t*)user_data;
input_ChangeES( p_intf->p_input, p_es, 1 );
if( p_intf->p_sys->b_menus_ready )
{
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
}
}
......@@ -571,7 +588,10 @@ on_popup_subtitle_toggle (GtkCheckMenuItem *menuitem,
p_es = (es_descriptor_t*)user_data;
input_ChangeES( p_intf->p_input, p_es, 2 );
if( p_intf->p_sys->b_menus_ready )
{
input_ToggleES( p_intf->p_input, p_es, menuitem->active );
}
}
......@@ -579,14 +599,15 @@ void
on_popup_navigation_toggle (GtkCheckMenuItem *menuitem,
gpointer user_data)
{
if( menuitem->active )
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
if( menuitem->active && p_intf->p_sys->b_menus_ready )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
input_area_t * p_area;
gint i_title;
gint i_chapter;
i_title = (gint)(user_data) / 100 ;
i_title = (gint)(user_data) / 100;
i_chapter = (gint)(user_data) - ( 100 * i_title );
if( i_title != p_intf->p_input->stream.p_selected_area->i_id )
......@@ -598,7 +619,7 @@ on_popup_navigation_toggle (GtkCheckMenuItem *menuitem,
p_area->i_part = i_chapter;
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
}
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* intf_gnome.h: private Gnome interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.h,v 1.3 2001/03/15 01:42:19 sam Exp $
* $Id: intf_gnome.h,v 1.4 2001/04/01 07:31:38 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -37,7 +37,8 @@ typedef struct intf_sys_s
boolean_t b_window_changed; /* window display toggled ? */
boolean_t b_playlist_changed; /* playlist display toggled ? */
boolean_t b_slider_free; /* slider status */
boolean_t b_menus_update;
boolean_t b_menus_update; /* do we need to update menus */
boolean_t b_menus_ready; /* has the update been commpleted */
/* Windows and widgets */
GtkWidget * p_window; /* main window */
......
......@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ext-intf.c,v 1.17 2001/03/21 13:42:34 sam Exp $
* $Id: input_ext-intf.c,v 1.18 2001/04/01 07:31:38 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -296,3 +296,33 @@ int input_ChangeES( input_thread_t * p_input, es_descriptor_t * p_es,
return 0;
}
/*****************************************************************************
* input_ToggleES: answers to a user request with calls to (Un)SelectES
*****************************************************************************
* Useful since the interface plugins know p_es.
* It only works for audio & spu ( to be sure nothing nasty is being done ).
* b_select is a boolean to know if we have to select or unselect ES
*****************************************************************************/
int input_ToggleES( input_thread_t * p_input, es_descriptor_t * p_es,
boolean_t b_select )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
if( p_es != NULL && ( p_es->b_audio || p_es->b_spu ) )
{
if( b_select )
{
input_SelectES( p_input, p_es );
}
else
{
input_UnselectES( p_input, p_es );
}
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
return 0;
}
......@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.41 2001/03/15 01:42:20 sam Exp $
* $Id: input_programs.c,v 1.42 2001/04/01 07:31:38 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -269,7 +269,7 @@ input_area_t * input_AddArea( input_thread_t * p_input )
p_input->stream.pp_areas[i_area_index]->i_size = 0;
p_input->stream.pp_areas[i_area_index]->i_tell = 0;
p_input->stream.pp_areas[i_area_index]->i_seek = NO_SEEK;
p_input->stream.pp_areas[i_area_index]->i_part_nb = 0;
p_input->stream.pp_areas[i_area_index]->i_part_nb = 1;
p_input->stream.pp_areas[i_area_index]->i_part= 0;
return p_input->stream.pp_areas[i_area_index];
......@@ -368,6 +368,7 @@ es_descriptor_t * input_AddES( input_thread_t * p_input,
/* Init its values */
p_es->i_id = i_es_id;
p_es->psz_desc[0] = '\0';
p_es->p_pes = NULL;
p_es->p_decoder_fifo = NULL;
p_es->b_audio = 0;
......@@ -591,6 +592,12 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
decoder_capabilities_t decoder;
void * p_config;
if( p_es == NULL )
{
intf_ErrMsg( "Nothing to do in input_SelectES" );
return -1;
}
#ifdef DEBUG_INPUT
intf_DbgMsg( "Selecting ES 0x%x", p_es->i_id );
#endif
......@@ -683,6 +690,12 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es )
int i_index = 0;
if( p_es == NULL )
{
intf_ErrMsg( "Nothing to do in input_UnselectES" );
return -1;
}
#ifdef DEBUG_INPUT
intf_DbgMsg( "Unselecting ES 0x%x", p_es->i_id );
#endif
......@@ -693,12 +706,10 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es )
return( -1 );
}
/* Release lock, not to block the input thread. */
vlc_mutex_unlock( &p_input->stream.stream_lock );
input_EndDecoder( p_input, p_es );
vlc_mutex_lock( &p_input->stream.stream_lock );
if( p_es->p_decoder_fifo == NULL )
if( ( p_es->p_decoder_fifo == NULL ) &&
( p_input->stream.i_selected_es_number > 0 ) )
{
p_input->stream.i_selected_es_number--;
......@@ -715,11 +726,14 @@ int input_UnselectES( input_thread_t * p_input, es_descriptor_t * p_es )
p_input->stream.pp_selected_es,
p_input->stream.i_selected_es_number
* sizeof(es_descriptor_t *) );
if( p_input->stream.pp_selected_es == NULL )
{
intf_ErrMsg( "Unable to realloc memory in input_UnSelectES" );
return(-1);
intf_ErrMsg( "No more selected ES in input_UnselectES" );
vlc_mutex_unlock( &p_input->stream.stream_lock );
return( 1 );
}
}
return( 0 );
}
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