Commit 9246efce authored by Christophe Massiot's avatar Christophe Massiot

Patch courtesy of gibalou :

* demux/mpeg/ts.c, demux/mpeg/system.c: Proper initialization of
i_continuity_counter,
* access/udp.c: Fixed win32 behavior when --mtu is set to a too small value,
* demux/mpeg/ts.c: Fixed detection of PAT/PMT change.
parent 0562366c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* udp.c: raw UDP & RTP access plug-in * udp.c: raw UDP & RTP access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: udp.c,v 1.12 2003/02/07 23:36:55 marcari Exp $ * $Id: udp.c,v 1.13 2003/02/12 13:42:43 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Tristan Leteurtre <tooney@via.ecp.fr> * Tristan Leteurtre <tooney@via.ecp.fr>
...@@ -351,6 +351,18 @@ static ssize_t Read( input_thread_t * p_input, byte_t * p_buffer, size_t i_len ) ...@@ -351,6 +351,18 @@ static ssize_t Read( input_thread_t * p_input, byte_t * p_buffer, size_t i_len )
if( i_recv < 0 ) if( i_recv < 0 )
{ {
#ifdef WIN32
/* On win32 recv() will fail if the datagram doesn't fit inside
* the passed buffer, even though the buffer will be filled with
* the first part of the datagram. */
if( WSAGetLastError() == WSAEMSGSIZE )
{
msg_Err( p_input, "recv() failed. "
"Increase the mtu size (--mtu option)" );
i_recv = i_len;
}
else
#endif
msg_Err( p_input, "recv failed (%s)", strerror(errno) ); msg_Err( p_input, "recv failed (%s)", strerror(errno) );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpeg_ts.c : Transport Stream input module for vlc * mpeg_ts.c : Transport Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: ts.c,v 1.16 2003/02/08 19:10:21 massiot Exp $ * $Id: ts.c,v 1.17 2003/02/12 13:42:43 massiot Exp $
* *
* Authors: Henri Fallon <henri@via.ecp.fr> * Authors: Henri Fallon <henri@via.ecp.fr>
* Johan Bilien <jobi@via.ecp.fr> * Johan Bilien <jobi@via.ecp.fr>
...@@ -223,6 +223,7 @@ static int Activate( vlc_object_t * p_this ) ...@@ -223,6 +223,7 @@ static int Activate( vlc_object_t * p_this )
p_demux_data->i_psi_type = PSI_IS_PAT; p_demux_data->i_psi_type = PSI_IS_PAT;
p_demux_data->p_psi_section = malloc(sizeof(psi_section_t)); p_demux_data->p_psi_section = malloc(sizeof(psi_section_t));
p_demux_data->p_psi_section->b_is_complete = 1; p_demux_data->p_psi_section->b_is_complete = 1;
p_demux_data->i_continuity_counter = 0xFF;
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
...@@ -539,6 +540,7 @@ static void TSDecodePAT( input_thread_t * p_input, es_descriptor_t * p_es ) ...@@ -539,6 +540,7 @@ static void TSDecodePAT( input_thread_t * p_input, es_descriptor_t * p_es )
p_es_demux->p_psi_section = p_es_demux->p_psi_section =
malloc( sizeof( psi_section_t ) ); malloc( sizeof( psi_section_t ) );
p_es_demux->p_psi_section->b_is_complete = 0; p_es_demux->p_psi_section->b_is_complete = 0;
p_es_demux->i_continuity_counter = 0xFF;
} }
} }
...@@ -630,6 +632,7 @@ static void TSDecodePMT( input_thread_t * p_input, es_descriptor_t * p_es ) ...@@ -630,6 +632,7 @@ static void TSDecodePMT( input_thread_t * p_input, es_descriptor_t * p_es )
/* Add this ES to the program */ /* Add this ES to the program */
p_new_es = input_AddES( p_input, p_es->p_pgrm, p_new_es = input_AddES( p_input, p_es->p_pgrm,
(u16)i_pid, sizeof( es_ts_data_t ) ); (u16)i_pid, sizeof( es_ts_data_t ) );
((es_ts_data_t *)p_new_es->p_demux_data)->i_continuity_counter = 0xFF;
/* Tell the interface what kind of stream it is and select /* Tell the interface what kind of stream it is and select
* the required ones */ * the required ones */
...@@ -737,6 +740,13 @@ static void TSDecodePMT( input_thread_t * p_input, es_descriptor_t * p_es ) ...@@ -737,6 +740,13 @@ static void TSDecodePMT( input_thread_t * p_input, es_descriptor_t * p_es )
p_input->pf_set_program( p_input, p_es->p_pgrm ); p_input->pf_set_program( p_input, p_es->p_pgrm );
} }
/* if the pmt belongs to the currently selected program, we
* reselect it to update its ES */
else if( p_es->p_pgrm == p_input->stream.p_selected_program )
{
p_input->pf_set_program( p_input, p_es->p_pgrm );
}
/* inform interface that stream has changed */ /* inform interface that stream has changed */
p_input->stream.b_changed = 1; p_input->stream.b_changed = 1;
/* Remove lock */ /* Remove lock */
...@@ -1155,7 +1165,7 @@ static void TS_DVBPSI_HandlePAT( input_thread_t * p_input, ...@@ -1155,7 +1165,7 @@ static void TS_DVBPSI_HandlePAT( input_thread_t * p_input,
p_stream_data = (stream_ts_data_t *)p_input->stream.p_demux_data; p_stream_data = (stream_ts_data_t *)p_input->stream.p_demux_data;
if ( !p_new_pat->b_current_next || if ( ( p_new_pat->b_current_next && ( p_new_pat->i_version != p_stream_data->i_pat_version ) ) ||
p_stream_data->i_pat_version == PAT_UNINITIALIZED ) p_stream_data->i_pat_version == PAT_UNINITIALIZED )
{ {
/* Delete all programs */ /* Delete all programs */
...@@ -1204,6 +1214,7 @@ static void TS_DVBPSI_HandlePAT( input_thread_t * p_input, ...@@ -1204,6 +1214,7 @@ static void TS_DVBPSI_HandlePAT( input_thread_t * p_input,
} }
p_es_demux->p_psi_section->b_is_complete = 0; p_es_demux->p_psi_section->b_is_complete = 0;
p_es_demux->i_continuity_counter = 0xFF;
/* Create a PMT decoder */ /* Create a PMT decoder */
p_pgrm_demux->p_pmt_handle = (dvbpsi_handle *) p_pgrm_demux->p_pmt_handle = (dvbpsi_handle *)
...@@ -1253,7 +1264,7 @@ static void TS_DVBPSI_HandlePMT( input_thread_t * p_input, ...@@ -1253,7 +1264,7 @@ static void TS_DVBPSI_HandlePMT( input_thread_t * p_input,
p_pgrm_demux = (pgrm_ts_data_t *)p_pgrm->p_demux_data; p_pgrm_demux = (pgrm_ts_data_t *)p_pgrm->p_demux_data;
p_pgrm_demux->i_pcr_pid = p_new_pmt->i_pcr_pid; p_pgrm_demux->i_pcr_pid = p_new_pmt->i_pcr_pid;
if( !p_new_pmt->b_current_next || if( ( p_new_pmt->b_current_next && ( p_new_pmt->i_version != p_pgrm_demux->i_pmt_version ) ) ||
p_pgrm_demux->i_pmt_version == PMT_UNINITIALIZED ) p_pgrm_demux->i_pmt_version == PMT_UNINITIALIZED )
{ {
dvbpsi_descriptor_t *p_dr = p_new_pmt->p_first_descriptor; dvbpsi_descriptor_t *p_dr = p_new_pmt->p_first_descriptor;
...@@ -1278,6 +1289,8 @@ static void TS_DVBPSI_HandlePMT( input_thread_t * p_input, ...@@ -1278,6 +1289,8 @@ static void TS_DVBPSI_HandlePMT( input_thread_t * p_input,
p_input->b_error = 1; p_input->b_error = 1;
return; return;
} }
((es_ts_data_t *)p_new_es->p_demux_data)->i_continuity_counter = 0xFF;
switch( p_es->i_type ) switch( p_es->i_type )
{ {
case MPEG1_VIDEO_ES: case MPEG1_VIDEO_ES:
......
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