Changeset ad0117b6be6bb0b5256748eb54efa7f6f3ab79f4

Show
Ignore:
Timestamp:
25/04/07 21:15:39 (2 years ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1177528539 +0000
git-parent:

[eaf3e693968f6d9aaea7cf2c38ed02712753f704]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1177528539 +0000
Message:

Patch from Paul Corke for rawdv to advance the timestamp when it is about to fall behind because the hardware sometimes skips a frame on a live feed. Renamed - -rawdv-realtime to --rawdv-hurry-up because its working is similar to --sout-transcode-hurry-up. Also fixed a potential memory leak.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • THANKS

    r1aad6e6 rad0117b  
    144144Patrick McLean <chutzpah at gentoo d0t org> - Libcdio update patch 
    145145Paul Corke <paul.corke at datatote dot co do uk> - pvr patch for newer ivtv drivers 
     146Paul Corke <paul.corke at datatote dot co do uk> - dv patch to keep up with the hardware 
    146147Paul Mackerras <paulus at linuxcare.com.au> - AltiVec IDCT and motion 
    147148Pavlov Konstantin “thresh” - several Linux build system fixes 
  • modules/demux/rawdv.c

    rd3fe7f2 rad0117b  
    66 * 
    77 * Authors: Gildas Bazin <gbazin@netcourrier.com> 
     8 *          Paul Corke <paul dot corke at datatote dot co dot uk> 
    89 * 
    910 * This program is free software; you can redistribute it and/or modify 
     
    3334 * Module descriptor 
    3435 *****************************************************************************/ 
     36#define HURRYUP_TEXT N_( "Hurry up" ) 
     37#define HURRYUP_LONGTEXT N_( "The demuxer will advance timestamps if the " \ 
     38                "input can't keep up with the rate." ) 
     39 
    3540static int  Open ( vlc_object_t * ); 
    3641static void Close( vlc_object_t * ); 
     
    4247    set_category( CAT_INPUT ); 
    4348    set_subcategory( SUBCAT_INPUT_DEMUX ); 
     49    add_bool( "rawdv-hurry-up", 0, NULL, HURRYUP_TEXT, HURRYUP_LONGTEXT, VLC_FALSE ); 
    4450    set_callbacks( Open, Close ); 
    4551    add_shortcut( "rawdv" ); 
     
    105111    /* program clock reference (in units of 90kHz) */ 
    106112    mtime_t i_pcr; 
     113    vlc_bool_t b_hurry_up; 
    107114}; 
    108115 
     
    197204    p_peek += 72;                                  /* skip rest of DIF block */ 
    198205 
    199  
    200206    /* Set p_input field */ 
    201207    p_demux->pf_demux   = Demux; 
    202208    p_demux->pf_control = Control; 
    203209    p_demux->p_sys      = p_sys = malloc( sizeof( demux_sys_t ) ); 
     210    if( !p_sys ) 
     211        return VLC_ENOMEM; 
     212 
     213    p_sys->b_hurry_up = var_CreateGetBool( p_demux, "rawdv-hurry-up" ); 
     214    msg_Dbg( p_demux, "Realtime DV Source: %s", (p_sys->b_hurry_up)?"Yes":"No" ); 
    204215 
    205216    p_sys->i_dsf = dv_header.dsf; 
     
    265276    demux_sys_t *p_sys  = p_demux->p_sys; 
    266277 
     278    var_Destroy( p_demux, "rawdv-hurry-up"); 
    267279    free( p_sys ); 
    268280} 
     
    279291    vlc_bool_t  b_audio = VLC_FALSE; 
    280292 
     293    if( p_sys->b_hurry_up ) 
     294    { 
     295         /* 3 frames */ 
     296        p_sys->i_pcr = mdate() + (p_sys->i_dsf ? 120000 : 90000); 
     297    } 
     298 
    281299    /* Call the pace control */ 
    282300    es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pcr ); 
    283  
    284     if( ( p_block = stream_Block( p_demux->s, p_sys->frame_size ) ) == NULL ) 
     301    p_block = stream_Block( p_demux->s, p_sys->frame_size ); 
     302    if( p_block == NULL ) 
    285303    { 
    286304        /* EOF */ 
     
    310328    es_out_Send( p_demux->out, p_sys->p_es_video, p_block ); 
    311329 
    312     p_sys->i_pcr += ( I64C(1000000) / p_sys->f_rate ); 
     330    if( !p_sys->b_hurry_up ) 
     331    { 
     332        p_sys->i_pcr += ( I64C(1000000) / p_sys->f_rate ); 
     333    } 
    313334 
    314335    return 1; 
     
    473494    return p_block; 
    474495} 
    475  
    476