MacOS X and VDR from linuxtv.org

Michael Langer milanger at mac.com
Wed Jan 2 10:29:04 CET 2002


Hi,

I 'fixed' a problem playing files generated with vdr. The fix (ok ok it 
is not a fix, it is a work around:->) consist of tree parts against 
vlc-0.9.2.

VDR or vdr means video disk recorder and records TV-Programs from a 
Satellite.

The symptons are
- stop playing after a few seconds,
- no sound
- after fixing nosound an stop playing there is still a delay between 
sound an video of aprox. 0.5 s.

According to the doku of vdr, these files consist of PES-Pakages (Sorry 
I'm not familiar with MPEG ), holding the streams for video and audio.

- the first fix is simply stopping the input thread filling new packages.
- the second fix is a little triky. It seem that the PES-Stream holds no 
'PACK_START_CODE'  block, wich leads the mpeg_adec module to timestamp 
the audio packages with 'LAST_MDATE ',  but those packets won't be 
played.

I don't understand the first error. What keeps vlc from stopping to fill 
the decoder fifos (DVD works).
The second error seems simple the TV-Programs have no begin, also no 
start code.
I also can't explain the third error, it seems the sound stream begins 
more early then the video stream which leads to a 'Miky Mouse'  sound in 
the first few seconds. After that the sound is late.

These fixes are certainly not a golden solution but I hope someone can 
point me in the right direction.
The fixes are at the back of these E-Mail. Which means I'm also not 
familiar with diff :-).

Michael

p.s. whre can i get the mpeg doku (maybe as pdf)?



first part fixes error

 >INPUT_MAX_ALLOCATION reached (125831013)
 >Out of memory

(src/input/input_dec.c)
/*************************************************************************
****
  * input_DecodePES
  
**************************************************************************
***
  * Put a PES in the decoder's fifo.
  
**************************************************************************
***/
void input_DecodePES( decoder_fifo_t * p_decoder_fifo, pes_packet_t * 
p_pes )
{
#if 1
     while (p_decoder_fifo->i_depth > 250)
     {
         vlc_cond_signal( &p_decoder_fifo->data_wait );  // keep the 
decoder online
         msleep( 10000 );						  // be cpu friendly
     }
#endif

     vlc_mutex_lock( &p_decoder_fifo->data_lock );

     p_pes->p_next = NULL;
     *p_decoder_fifo->pp_last = p_pes;
     p_decoder_fifo->pp_last = &p_pes->p_next;
     p_decoder_fifo->i_depth++;

     /* Warn the decoder that it's got work to do. */
     vlc_cond_signal( &p_decoder_fifo->data_wait );
     vlc_mutex_unlock( &p_decoder_fifo->data_lock );
}

second part fixed 'nosound'

(src/input/input_clock.c)
/*************************************************************************
****
  * input_ClockGetTS: manages a PTS or DTS
  
**************************************************************************
***/
mtime_t input_ClockGetTS( input_thread_t * p_input,
                           pgrm_descriptor_t * p_pgrm, mtime_t i_ts )
{
#if 0
     if( p_pgrm->i_synchro_state == SYNCHRO_OK )
     {
         return( ClockToSysdate( p_input, p_pgrm, i_ts + 
p_pgrm->delta_cr )
                  + DEFAULT_PTS_DELAY
                  + (p_main->i_desync > 0 ? p_main->i_desync : 0) );
     }
     else
     {
         return 0;
     }
#else
     if( p_pgrm->i_synchro_state != SYNCHRO_OK )
         input_ClockManageRef( p_input, p_pgrm, i_ts + DEFAULT_PTS_DELAY+ 
p_pgrm->delta_cr);

     return( ClockToSysdate( p_input, p_pgrm, i_ts + p_pgrm->delta_cr )
             + DEFAULT_PTS_DELAY
             + (p_main->i_desync > 0 ? p_main->i_desync : 0) );
#endif
}

third part fixes an delay between sound and video

static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * 
p_fifo,
                                  mtime_t aout_date )
{
...
  #if 1
l_delta = aout_date - p_fifo->date[p_fifo->l_start_frame] + 500000;
#else
l_delta = aout_date - p_fifo->date[p_fifo->l_start_frame] ;
#endif
...
}





More information about the vlc-devel mailing list