Changeset ad0117b6be6bb0b5256748eb54efa7f6f3ab79f4
- 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
| r1aad6e6 |
rad0117b |
|
| 144 | 144 | Patrick McLean <chutzpah at gentoo d0t org> - Libcdio update patch |
|---|
| 145 | 145 | Paul Corke <paul.corke at datatote dot co do uk> - pvr patch for newer ivtv drivers |
|---|
| | 146 | Paul Corke <paul.corke at datatote dot co do uk> - dv patch to keep up with the hardware |
|---|
| 146 | 147 | Paul Mackerras <paulus at linuxcare.com.au> - AltiVec IDCT and motion |
|---|
| 147 | 148 | Pavlov Konstantin “thresh” - several Linux build system fixes |
|---|
| rd3fe7f2 |
rad0117b |
|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Gildas Bazin <gbazin@netcourrier.com> |
|---|
| | 8 | * Paul Corke <paul dot corke at datatote dot co dot uk> |
|---|
| 8 | 9 | * |
|---|
| 9 | 10 | * This program is free software; you can redistribute it and/or modify |
|---|
| … | … | |
| 33 | 34 | * Module descriptor |
|---|
| 34 | 35 | *****************************************************************************/ |
|---|
| | 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 | |
|---|
| 35 | 40 | static int Open ( vlc_object_t * ); |
|---|
| 36 | 41 | static void Close( vlc_object_t * ); |
|---|
| … | … | |
| 42 | 47 | set_category( CAT_INPUT ); |
|---|
| 43 | 48 | set_subcategory( SUBCAT_INPUT_DEMUX ); |
|---|
| | 49 | add_bool( "rawdv-hurry-up", 0, NULL, HURRYUP_TEXT, HURRYUP_LONGTEXT, VLC_FALSE ); |
|---|
| 44 | 50 | set_callbacks( Open, Close ); |
|---|
| 45 | 51 | add_shortcut( "rawdv" ); |
|---|
| … | … | |
| 105 | 111 | /* program clock reference (in units of 90kHz) */ |
|---|
| 106 | 112 | mtime_t i_pcr; |
|---|
| | 113 | vlc_bool_t b_hurry_up; |
|---|
| 107 | 114 | }; |
|---|
| 108 | 115 | |
|---|
| … | … | |
| 197 | 204 | p_peek += 72; /* skip rest of DIF block */ |
|---|
| 198 | 205 | |
|---|
| 199 | | |
|---|
| 200 | 206 | /* Set p_input field */ |
|---|
| 201 | 207 | p_demux->pf_demux = Demux; |
|---|
| 202 | 208 | p_demux->pf_control = Control; |
|---|
| 203 | 209 | 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" ); |
|---|
| 204 | 215 | |
|---|
| 205 | 216 | p_sys->i_dsf = dv_header.dsf; |
|---|
| … | … | |
| 265 | 276 | demux_sys_t *p_sys = p_demux->p_sys; |
|---|
| 266 | 277 | |
|---|
| | 278 | var_Destroy( p_demux, "rawdv-hurry-up"); |
|---|
| 267 | 279 | free( p_sys ); |
|---|
| 268 | 280 | } |
|---|
| … | … | |
| 279 | 291 | vlc_bool_t b_audio = VLC_FALSE; |
|---|
| 280 | 292 | |
|---|
| | 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 | |
|---|
| 281 | 299 | /* Call the pace control */ |
|---|
| 282 | 300 | 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 ) |
|---|
| 285 | 303 | { |
|---|
| 286 | 304 | /* EOF */ |
|---|
| … | … | |
| 310 | 328 | es_out_Send( p_demux->out, p_sys->p_es_video, p_block ); |
|---|
| 311 | 329 | |
|---|
| 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 | } |
|---|
| 313 | 334 | |
|---|
| 314 | 335 | return 1; |
|---|
| … | … | |
| 473 | 494 | return p_block; |
|---|
| 474 | 495 | } |
|---|
| 475 | | |
|---|
| 476 | | |
|---|