~ubuntu-branches/ubuntu/natty/vlc/natty

« back to all changes in this revision

Viewing changes to modules/demux/pva.c

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2010-06-25 01:09:16 UTC
  • mfrom: (1.1.30 upstream)
  • Revision ID: james.westby@ubuntu.com-20100625010916-asxhep2mutg6g6pd
Tags: 1.1.0-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - build and install the libx264 plugin
  - add Xb-Npp header to vlc package
  - Add apport hook to include more vlc dependencies in bug reports
* Drop xulrunner patches.
* Drop 502_xulrunner_191.diff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * pva.c: PVA demuxer
3
3
 *****************************************************************************
4
4
 * Copyright (C) 2004 the VideoLAN team
5
 
 * $Id: 68093d98df0e8ab65dd9887d1874c48d29ef2f02 $
 
5
 * $Id: b02f8ddff17820d5a8e270ce64eef2f9ff9d9505 $
6
6
 *
7
7
 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8
8
 *
98
98
    p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
99
99
 
100
100
    /* Register one audio and one video stream */
101
 
    es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC( 'm', 'p', 'g', 'a' ) );
 
101
    es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_MPGA );
 
102
    fmt.b_packetized = false;
102
103
    p_sys->p_audio = es_out_Add( p_demux->out, &fmt );
103
104
 
104
 
    es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC( 'm', 'p', 'g', 'v' ) );
 
105
    es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_MPGV );
 
106
    fmt.b_packetized = false;
105
107
    p_sys->p_video = es_out_Add( p_demux->out, &fmt );
106
108
 
107
109
    p_sys->i_vc    = -1;
207
209
                if( ( p_frame = p_sys->p_es ) )
208
210
                {
209
211
 
210
 
                    if( p_frame->i_pts > 0 && !p_sys->b_pcr_audio )
 
212
                    if( p_frame->i_pts > VLC_TS_INVALID && !p_sys->b_pcr_audio )
211
213
                    {
212
214
                        es_out_Control( p_demux->out, ES_OUT_SET_PCR, (int64_t)p_frame->i_pts);
213
215
                    }
221
223
            {
222
224
                p_frame->p_buffer += i_skip;
223
225
                p_frame->i_buffer -= i_skip;
224
 
                if( i_pts > 0 ) p_frame->i_pts = i_pts * 100 / 9;
 
226
                if( i_pts >= 0 )
 
227
                    p_frame->i_pts = VLC_TS_0 + i_pts * 100 / 9;
225
228
                block_ChainAppend( &p_sys->p_es, p_frame );
226
229
            }
227
230
            break;
285
288
            if( ( i64 = stream_Size( p_demux->s ) ) > 0 )
286
289
            {
287
290
                pf = (double*) va_arg( args, double* );
288
 
                *pf = (double)stream_Tell( p_demux->s ) / (double)i64;
 
291
                double current = stream_Tell( p_demux->s );
 
292
                *pf = current / (double)i64;
289
293
                return VLC_SUCCESS;
290
294
            }
291
295
            return VLC_EGENERIC;
378
382
    uint8_t     hdr[30];
379
383
    int         i_pes_size;
380
384
 
381
 
    int         i_skip;
 
385
    unsigned    i_skip;
382
386
    mtime_t     i_dts = -1;
383
387
    mtime_t     i_pts = -1;
384
388
 
426
430
    p_pes->i_buffer -= i_skip;
427
431
    p_pes->p_buffer += i_skip;
428
432
 
429
 
    if( i_dts >= 0 ) p_pes->i_dts = i_dts * 100 / 9;
430
 
    if( i_pts >= 0 ) p_pes->i_pts = i_pts * 100 / 9;
 
433
    if( i_dts >= 0 )
 
434
        p_pes->i_dts = VLC_TS_0 + i_dts * 100 / 9;
 
435
    if( i_pts >= 0 )
 
436
        p_pes->i_pts = VLC_TS_0 + i_pts * 100 / 9;
431
437
 
432
438
    /* Set PCR */
433
439
    if( p_pes->i_pts > 0 )