Changeset 069f260a8179fa8f3462c121c6ff790300d321b0 for modules/demux/dts.c
- Timestamp:
- 22/08/08 17:57:59 (3 months ago)
- git-parent:
- Files:
-
- modules/demux/dts.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/demux/dts.c
re81f6fc r069f260 63 63 decoder_t *p_packetizer; 64 64 65 mtime_t i_pts; 66 mtime_t i_time_offset; 67 65 68 int i_mux_rate; 66 69 }; … … 157 160 158 161 DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys; 162 p_sys->i_mux_rate = 0; 163 p_sys->i_pts = 0; 164 p_sys->i_time_offset = 0; 159 165 160 166 INIT_APACKETIZER( p_sys->p_packetizer, 'd','t','s',' ' ); … … 215 221 } 216 222 223 /* Correct timestamp */ 224 p_block_out->i_pts += p_sys->i_time_offset; 225 p_block_out->i_dts += p_sys->i_time_offset; 226 217 227 /* set PCR */ 218 228 es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block_out->i_dts ); … … 233 243 { 234 244 demux_sys_t *p_sys = p_demux->p_sys; 235 if( i_query == DEMUX_SET_TIME ) 236 return VLC_EGENERIC; 237 else 238 return demux_vaControlHelper( p_demux->s, 245 bool *pb_bool; 246 int64_t *pi64; 247 int i_ret; 248 249 switch( i_query ) 250 { 251 case DEMUX_HAS_UNSUPPORTED_META: 252 pb_bool = (bool*)va_arg( args, bool* ); 253 *pb_bool = true; 254 return VLC_SUCCESS; 255 256 case DEMUX_GET_TIME: 257 pi64 = (int64_t*)va_arg( args, int64_t * ); 258 *pi64 = p_sys->i_pts + p_sys->i_time_offset; 259 return VLC_SUCCESS; 260 261 case DEMUX_SET_TIME: /* TODO implement a high precicsion seek */ 262 default: 263 i_ret = demux_vaControlHelper( p_demux->s, 239 264 0, -1, 240 265 8*p_sys->i_mux_rate, 1, i_query, args ); 266 if( !i_ret && p_sys->i_mux_rate > 0 && 267 ( i_query == DEMUX_SET_POSITION || i_query == DEMUX_SET_TIME ) ) 268 { 269 270 const int64_t i_time = INT64_C(1000000) * stream_Tell(p_demux->s) / 271 p_sys->i_mux_rate; 272 273 /* Fix time_offset */ 274 if( i_time >= 0 ) 275 p_sys->i_time_offset = i_time - p_sys->i_pts; 276 } 277 return i_ret; 278 } 241 279 } 242 280
