Changeset 37a5e7dbe5af4a4af03309a2834182e212a8ef15

Show
Ignore:
Timestamp:
26/08/08 23:27:56 (3 months ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1219786076 +0200
git-parent:

[5924aed641610a3b0ac37fd903b722a97b25891b]

git-author:
Laurent Aimar <fenrir@videolan.org> 1219752712 +0200
Message:

Added nsv stream record mode support.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/nsv.c

    r00b9584 r37a5e7d  
    7373    int64_t     i_time; 
    7474    int64_t     i_pcr_inc; 
     75 
     76    bool b_start_record; 
    7577}; 
    7678 
     
    121123    p_sys->i_pcr_inc = 0; 
    122124 
     125    p_sys->b_start_record = false; 
     126 
    123127    return VLC_SUCCESS; 
    124128} 
     
    160164        { 
    161165            if( ReadNSVf( p_demux ) ) 
    162             { 
    163166                return -1; 
    164             } 
    165167        } 
    166168        else if( !memcmp( p_peek, "NSVs", 4 ) ) 
    167169        { 
     170            if( p_sys->b_start_record ) 
     171            { 
     172                /* Enable recording once synchronized */ 
     173                stream_Control( p_demux->s, STREAM_SET_RECORD_STATE, true, "nsv" ); 
     174                p_sys->b_start_record = false; 
     175            } 
     176 
    168177            if( ReadNSVs( p_demux ) ) 
    169             { 
    170178                return -1; 
    171             } 
    172179            break; 
    173180        } 
     
    186193            msg_Err( p_demux, "invalid signature 0x%x (%4.4s)", GetDWLE( p_peek ), (const char*)p_peek ); 
    187194            if( ReSynch( p_demux ) ) 
    188             { 
    189195                return -1; 
    190             } 
    191196        } 
    192197    } 
     
    317322    demux_sys_t *p_sys = p_demux->p_sys; 
    318323    double f, *pf; 
     324    bool b_bool, *pb_bool; 
    319325    int64_t i64, *pi64; 
    320326 
     
    372378            *pf = (double)1000000.0 / (double)p_sys->i_pcr_inc; 
    373379            return VLC_SUCCESS; 
     380 
     381        case DEMUX_CAN_RECORD: 
     382            pb_bool = (bool*)va_arg( args, bool * ); 
     383            *pb_bool = true; 
     384            return VLC_SUCCESS; 
     385 
     386        case DEMUX_SET_RECORD_STATE: 
     387            b_bool = (bool)va_arg( args, int ); 
     388 
     389            if( !b_bool ) 
     390                stream_Control( p_demux->s, STREAM_SET_RECORD_STATE, false ); 
     391            p_sys->b_start_record = b_bool; 
     392            return VLC_SUCCESS; 
     393 
    374394 
    375395        case DEMUX_SET_TIME: