Commit c2c02e28 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

es_out: add type-safe es_out_SetPCR() helper

parent 648813fd
...@@ -155,6 +155,11 @@ static inline void es_out_Delete( es_out_t *p_out ) ...@@ -155,6 +155,11 @@ static inline void es_out_Delete( es_out_t *p_out )
p_out->pf_destroy( p_out ); p_out->pf_destroy( p_out );
} }
static inline int es_out_SetPCR( es_out_t *out, int64_t pcr )
{
return es_out_Control( out, ES_OUT_SET_PCR, pcr );
}
static inline int es_out_ControlSetMeta( es_out_t *out, const vlc_meta_t *p_meta ) static inline int es_out_ControlSetMeta( es_out_t *out, const vlc_meta_t *p_meta )
{ {
return es_out_Control( out, ES_OUT_SET_META, p_meta ); return es_out_Control( out, ES_OUT_SET_META, p_meta );
......
...@@ -229,7 +229,7 @@ static void *Thread (void *data) ...@@ -229,7 +229,7 @@ static void *Thread (void *data)
block->i_pts = pts; block->i_pts = pts;
block->i_length = (CLOCK_FREQ * frames) / sys->rate; block->i_length = (CLOCK_FREQ * frames) / sys->rate;
es_out_Control (demux->out, ES_OUT_SET_PCR, block->i_pts); es_out_SetPCR(demux->out, block->i_pts);
es_out_Send (demux->out, sys->es, block); es_out_Send (demux->out, sys->es, block);
} }
return NULL; return NULL;
......
...@@ -427,7 +427,7 @@ static int Demux(demux_t *p_demux) ...@@ -427,7 +427,7 @@ static int Demux(demux_t *p_demux)
} }
} }
es_out_Control(p_demux->out, ES_OUT_SET_PCR, p_block->i_pts); es_out_SetPCR(p_demux->out, p_block->i_pts);
es_out_Send(p_demux->out, p_sys->p_es_video, p_block); es_out_Send(p_demux->out, p_sys->p_es_video, p_block);
} }
......
...@@ -160,7 +160,7 @@ static int Demux(demux_t *demux) ...@@ -160,7 +160,7 @@ static int Demux(demux_t *demux)
date_Increment(&sys->pts, block->i_nb_samples); date_Increment(&sys->pts, block->i_nb_samples);
es_out_Send(demux->out, sys->es, block); es_out_Send(demux->out, sys->es, block);
es_out_Control(demux->out, ES_OUT_SET_PCR, VLC_TS_0 + date_Get(&sys->pts)); es_out_SetPCR(demux->out, VLC_TS_0 + date_Get(&sys->pts));
return VLC_DEMUXER_SUCCESS; return VLC_DEMUXER_SUCCESS;
} }
......
...@@ -479,7 +479,7 @@ static int Demux( demux_t *p_demux ) ...@@ -479,7 +479,7 @@ static int Demux( demux_t *p_demux )
if( p_blockv ) if( p_blockv )
{ {
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_blockv->i_pts ); es_out_SetPCR( p_demux->out, p_blockv->i_pts );
es_out_Send( p_demux->out, p_sys->p_es_video, p_blockv ); es_out_Send( p_demux->out, p_sys->p_es_video, p_blockv );
} }
return 1; return 1;
......
...@@ -748,7 +748,7 @@ static int Demux( demux_t *p_demux ) ...@@ -748,7 +748,7 @@ static int Demux( demux_t *p_demux )
} }
p_sys->i_pts = p_video_frame->i_pts; p_sys->i_pts = p_video_frame->i_pts;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pts ); es_out_SetPCR( p_demux->out, p_sys->i_pts );
if(p_video_frame) if(p_video_frame)
es_out_Send( p_demux->out, p_sys->p_video_es, p_video_frame ); es_out_Send( p_demux->out, p_sys->p_video_es, p_video_frame );
if(p_audio_frame) if(p_audio_frame)
...@@ -827,7 +827,7 @@ static int Control( demux_t *p_demux, int query, va_list args ) ...@@ -827,7 +827,7 @@ static int Control( demux_t *p_demux, int query, va_list args )
msg_Warn( p_demux, "DEMUX_SET_TIME" ); msg_Warn( p_demux, "DEMUX_SET_TIME" );
p_sys->frame_no = i64 * p_sys->frame_rate_num / ( CLOCK_FREQ * p_sys->frame_rate_denom ); p_sys->frame_no = i64 * p_sys->frame_rate_num / ( CLOCK_FREQ * p_sys->frame_rate_denom );
p_sys->i_pts= i64; p_sys->i_pts= i64;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pts); es_out_SetPCR(p_demux->out, p_sys->i_pts);
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, ( mtime_t ) i64 ); es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, ( mtime_t ) i64 );
break; break;
case DEMUX_GET_PTS_DELAY: case DEMUX_GET_PTS_DELAY:
......
...@@ -341,7 +341,7 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame ...@@ -341,7 +341,7 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame
sys->last_pts = video_frame->i_pts; sys->last_pts = video_frame->i_pts;
vlc_mutex_unlock(&sys->pts_lock); vlc_mutex_unlock(&sys->pts_lock);
es_out_Control(demux_->out, ES_OUT_SET_PCR, video_frame->i_pts); es_out_SetPCR(demux_->out, video_frame->i_pts);
es_out_Send(demux_->out, sys->video_es, video_frame); es_out_Send(demux_->out, sys->video_es, video_frame);
} }
...@@ -365,7 +365,7 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame ...@@ -365,7 +365,7 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame
sys->last_pts = audio_frame->i_pts; sys->last_pts = audio_frame->i_pts;
vlc_mutex_unlock(&sys->pts_lock); vlc_mutex_unlock(&sys->pts_lock);
es_out_Control(demux_->out, ES_OUT_SET_PCR, audio_frame->i_pts); es_out_SetPCR(demux_->out, audio_frame->i_pts);
es_out_Send(demux_->out, sys->audio_es, audio_frame); es_out_Send(demux_->out, sys->audio_es, audio_frame);
} }
......
...@@ -1895,7 +1895,7 @@ static int Demux( demux_t *p_demux ) ...@@ -1895,7 +1895,7 @@ static int Demux( demux_t *p_demux )
p_block->i_pts = p_block->i_dts = i_pts; p_block->i_pts = p_block->i_dts = i_pts;
if( i_pts > VLC_TS_INVALID ) if( i_pts > VLC_TS_INVALID )
es_out_Control( p_demux->out, ES_OUT_SET_PCR, i_pts ); es_out_SetPCR( p_demux->out, i_pts );
es_out_Send( p_demux->out, p_stream->p_es, p_block ); es_out_Send( p_demux->out, p_stream->p_es, p_block );
i_samples--; i_samples--;
......
...@@ -1364,7 +1364,7 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len ) ...@@ -1364,7 +1364,7 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
int i_mux_rate; int i_mux_rate;
if( !ps_pkt_parse_pack( p_pkt, &i_scr, &i_mux_rate ) ) if( !ps_pkt_parse_pack( p_pkt, &i_scr, &i_mux_rate ) )
{ {
es_out_Control( p_demux->out, ES_OUT_SET_PCR, i_scr + 1 ); es_out_SetPCR( p_demux->out, i_scr + 1 );
if( i_mux_rate > 0 ) p_sys->i_mux_rate = i_mux_rate; if( i_mux_rate > 0 ) p_sys->i_mux_rate = i_mux_rate;
} }
block_Release( p_pkt ); block_Release( p_pkt );
......
...@@ -606,7 +606,7 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len ) ...@@ -606,7 +606,7 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
int i_mux_rate; int i_mux_rate;
if( !ps_pkt_parse_pack( p_pkt, &i_scr, &i_mux_rate ) ) if( !ps_pkt_parse_pack( p_pkt, &i_scr, &i_mux_rate ) )
{ {
es_out_Control( p_demux->out, ES_OUT_SET_PCR, i_scr ); es_out_SetPCR( p_demux->out, i_scr );
if( i_mux_rate > 0 ) p_sys->i_mux_rate = i_mux_rate; if( i_mux_rate > 0 ) p_sys->i_mux_rate = i_mux_rate;
} }
block_Release( p_pkt ); block_Release( p_pkt );
......
...@@ -599,7 +599,7 @@ static int Demux(demux_t *demux) ...@@ -599,7 +599,7 @@ static int Demux(demux_t *demux)
block->i_pts = pts >= 0 ? (1 + pts) : VLC_TS_INVALID; block->i_pts = pts >= 0 ? (1 + pts) : VLC_TS_INVALID;
memcpy(block->p_buffer, buffer, buffer_size); memcpy(block->p_buffer, buffer, buffer_size);
es_out_Control(demux->out, ES_OUT_SET_PCR, block->i_dts); es_out_SetPCR(demux->out, block->i_dts);
es_out_Send(demux->out, sys->es, block); es_out_Send(demux->out, sys->es, block);
} }
} }
......
...@@ -370,7 +370,7 @@ static int Demux( demux_t *p_demux ) ...@@ -370,7 +370,7 @@ static int Demux( demux_t *p_demux )
if( p_block ) if( p_block )
{ {
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block->i_pts ); es_out_SetPCR( p_demux->out, p_block->i_pts );
es_out_Send( p_demux->out, p_es, p_block ); es_out_Send( p_demux->out, p_es, p_block );
} }
......
...@@ -614,7 +614,7 @@ static int HandleVideo( demux_t *p_demux, const uint8_t *p_buffer ) ...@@ -614,7 +614,7 @@ static int HandleVideo( demux_t *p_demux, const uint8_t *p_buffer )
p_current_picture->i_dts = p_current_picture->i_pts = p_sys->i_next_vdate; p_current_picture->i_dts = p_current_picture->i_pts = p_sys->i_next_vdate;
es_out_Send( p_demux->out, p_sys->p_es_video, p_current_picture ); es_out_Send( p_demux->out, p_sys->p_es_video, p_current_picture );
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_next_vdate ); es_out_SetPCR( p_demux->out, p_sys->i_next_vdate );
p_sys->i_next_vdate += p_sys->i_incr; p_sys->i_next_vdate += p_sys->i_incr;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -993,7 +993,7 @@ static int DecodeFrame( demux_t *p_demux ) ...@@ -993,7 +993,7 @@ static int DecodeFrame( demux_t *p_demux )
DecodeVideo( p_demux ); DecodeVideo( p_demux );
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_next_date ); es_out_SetPCR( p_demux->out, p_sys->i_next_date );
p_sys->i_next_date += p_sys->i_incr; p_sys->i_next_date += p_sys->i_incr;
if( NewFrame( p_demux ) != VLC_SUCCESS ) if( NewFrame( p_demux ) != VLC_SUCCESS )
......
...@@ -1379,14 +1379,14 @@ static int Demux( demux_t *p_demux ) ...@@ -1379,14 +1379,14 @@ static int Demux( demux_t *p_demux )
tk->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY; tk->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
} }
if( p_sys->i_pcr != VLC_TS_INVALID ) if( p_sys->i_pcr != VLC_TS_INVALID )
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_pcr ); es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_pcr );
} }
else if( p_sys->i_pcr == VLC_TS_INVALID || else if( p_sys->i_pcr == VLC_TS_INVALID ||
i_minpcr > p_sys->i_pcr + CLOCK_FREQ / 4 ) i_minpcr > p_sys->i_pcr + CLOCK_FREQ / 4 )
{ {
p_sys->i_pcr = i_minpcr; p_sys->i_pcr = i_minpcr;
if( p_sys->i_pcr != VLC_TS_INVALID ) if( p_sys->i_pcr != VLC_TS_INVALID )
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_pcr ); es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_pcr );
} }
} }
......
...@@ -271,7 +271,7 @@ static int Demux( demux_t *p_demux ) ...@@ -271,7 +271,7 @@ static int Demux( demux_t *p_demux )
{ {
p_block = GrabAudio( p_demux ); p_block = GrabAudio( p_demux );
if( p_block ) if( p_block )
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block->i_pts ); es_out_SetPCR( p_demux->out, p_block->i_pts );
} }
} }
} while( p_block && p_sys->i_next_demux_date > 0 && } while( p_block && p_sys->i_next_demux_date > 0 &&
......
...@@ -174,7 +174,7 @@ static void stream_read_cb(pa_stream *s, size_t length, void *userdata) ...@@ -174,7 +174,7 @@ static void stream_read_cb(pa_stream *s, size_t length, void *userdata)
else else
pts -= latency; pts -= latency;
es_out_Control(demux->out, ES_OUT_SET_PCR, pts); es_out_SetPCR(demux->out, pts);
if (unlikely(sys->es == NULL)) if (unlikely(sys->es == NULL))
goto race; goto race;
......
...@@ -521,7 +521,7 @@ static int Demux(demux_t *p_demux) ...@@ -521,7 +521,7 @@ static int Demux(demux_t *p_demux)
return 1; return 1;
} }
es_out_Control(p_demux->out, ES_OUT_SET_PCR, p_blocka->i_pts); es_out_SetPCR(p_demux->out, p_blocka->i_pts);
es_out_Send(p_demux->out, p_sys->p_es_audio, p_blocka); es_out_Send(p_demux->out, p_sys->p_es_audio, p_blocka);
} }
......
...@@ -408,7 +408,7 @@ static void *DemuxThread( void *p_data ) ...@@ -408,7 +408,7 @@ static void *DemuxThread( void *p_data )
if (likely( p_block && p_sys->p_block )) if (likely( p_block && p_sys->p_block ))
{ {
p_sys->p_block->i_dts = p_sys->p_block->i_pts = mdate() - p_sys->i_starttime; p_sys->p_block->i_dts = p_sys->p_block->i_pts = mdate() - p_sys->i_starttime;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->p_block->i_pts ); es_out_SetPCR( p_demux->out, p_sys->p_block->i_pts );
es_out_Send( p_demux->out, p_sys->es, p_sys->p_block ); es_out_Send( p_demux->out, p_sys->es, p_sys->p_block );
p_sys->p_block = p_block; p_sys->p_block = p_block;
} }
......
...@@ -443,7 +443,7 @@ void codec_decode (demux_t *demux, void *data, block_t *block) ...@@ -443,7 +443,7 @@ void codec_decode (demux_t *demux, void *data, block_t *block)
if (data) if (data)
{ {
block->i_dts = VLC_TS_INVALID; /* RTP does not specify this */ block->i_dts = VLC_TS_INVALID; /* RTP does not specify this */
es_out_Control (demux->out, ES_OUT_SET_PCR, block->i_pts ); es_out_SetPCR(demux->out, block->i_pts);
es_out_Send (demux->out, (es_out_id_t *)data, block); es_out_Send (demux->out, (es_out_id_t *)data, block);
} }
else else
......
...@@ -288,7 +288,7 @@ static int Demux( demux_t *p_demux ) ...@@ -288,7 +288,7 @@ static int Demux( demux_t *p_demux )
p_block->i_dts = p_block->i_pts = p_sys->i_next_date; p_block->i_dts = p_block->i_pts = p_sys->i_next_date;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block->i_pts ); es_out_SetPCR( p_demux->out, p_block->i_pts );
es_out_Send( p_demux->out, p_sys->es, p_block ); es_out_Send( p_demux->out, p_sys->es, p_block );
p_sys->i_next_date += p_sys->i_incr; p_sys->i_next_date += p_sys->i_incr;
......
...@@ -254,7 +254,7 @@ static void *Thread(void *data) ...@@ -254,7 +254,7 @@ static void *Thread(void *data)
block_t *block = Shoot(demux); block_t *block = Shoot(demux);
block->i_pts = block->i_dts = mdate(); block->i_pts = block->i_dts = mdate();
es_out_Control(demux->out, ES_OUT_SET_PCR, block->i_pts); es_out_SetPCR(demux->out, block->i_pts);
es_out_Send(demux->out, sys->es, block); es_out_Send(demux->out, sys->es, block);
} }
......
...@@ -502,7 +502,7 @@ noshm: ...@@ -502,7 +502,7 @@ noshm:
{ {
block->i_pts = block->i_dts = mdate (); block->i_pts = block->i_dts = mdate ();
es_out_Control (demux->out, ES_OUT_SET_PCR, block->i_pts); es_out_SetPCR(demux->out, block->i_pts);
es_out_Send (demux->out, sys->es, block); es_out_Send (demux->out, sys->es, block);
} }
else else
......
...@@ -326,7 +326,7 @@ static void DemuxFile (void *data) ...@@ -326,7 +326,7 @@ static void DemuxFile (void *data)
block->i_pts = block->i_dts = mdate (); block->i_pts = block->i_dts = mdate ();
/* Send block */ /* Send block */
es_out_Control (demux->out, ES_OUT_SET_PCR, block->i_pts); es_out_SetPCR(demux->out, block->i_pts);
es_out_Send (demux->out, sys->es, block); es_out_Send (demux->out, sys->es, block);
} }
...@@ -349,7 +349,7 @@ static void DemuxIPC (void *data) ...@@ -349,7 +349,7 @@ static void DemuxIPC (void *data)
block->i_pts = block->i_dts = mdate (); block->i_pts = block->i_dts = mdate ();
/* Send block */ /* Send block */
es_out_Control (demux->out, ES_OUT_SET_PCR, block->i_pts); es_out_SetPCR(demux->out, block->i_pts);
es_out_Send (demux->out, sys->es, block); es_out_Send (demux->out, sys->es, block);
} }
......
...@@ -89,7 +89,7 @@ static int DemuxOnce (demux_t *demux, bool master) ...@@ -89,7 +89,7 @@ static int DemuxOnce (demux_t *demux, bool master)
block->i_length = date_Increment (&sys->date, 1) - pts; block->i_length = date_Increment (&sys->date, 1) - pts;
es_out_Send (demux->out, sys->es, block); es_out_Send (demux->out, sys->es, block);
if (master) if (master)
es_out_Control (demux->out, ES_OUT_SET_PCR, pts); es_out_SetPCR(demux->out, pts);
return 1; return 1;
} }
......
...@@ -714,7 +714,7 @@ static void *UserPtrThread (void *data) ...@@ -714,7 +714,7 @@ static void *UserPtrThread (void *data)
block->i_buffer = buf.length; block->i_buffer = buf.length;
block->i_pts = block->i_dts = GetBufferPTS (&buf); block->i_pts = block->i_dts = GetBufferPTS (&buf);
block->i_flags |= sys->block_flags; block->i_flags |= sys->block_flags;
es_out_Control (demux->out, ES_OUT_SET_PCR, block->i_pts); es_out_SetPCR(demux->out, block->i_pts);
es_out_Send (demux->out, sys->es, block); es_out_Send (demux->out, sys->es, block);
} }
vlc_restorecancel (canc); /* <- hmm, this is purely cosmetic */ vlc_restorecancel (canc); /* <- hmm, this is purely cosmetic */
...@@ -758,7 +758,7 @@ static void *MmapThread (void *data) ...@@ -758,7 +758,7 @@ static void *MmapThread (void *data)
if (block != NULL) if (block != NULL)
{ {
block->i_flags |= sys->block_flags; block->i_flags |= sys->block_flags;
es_out_Control (demux->out, ES_OUT_SET_PCR, block->i_pts); es_out_SetPCR(demux->out, block->i_pts);
es_out_Send (demux->out, sys->es, block); es_out_Send (demux->out, sys->es, block);
} }
vlc_restorecancel (canc); vlc_restorecancel (canc);
...@@ -819,7 +819,7 @@ static void *ReadThread (void *data) ...@@ -819,7 +819,7 @@ static void *ReadThread (void *data)
if (val != -1) if (val != -1)
{ {
block->i_buffer = val; block->i_buffer = val;
es_out_Control (demux->out, ES_OUT_SET_PCR, block->i_pts); es_out_SetPCR(demux->out, block->i_pts);
es_out_Send (demux->out, sys->es, block); es_out_Send (demux->out, sys->es, block);
} }
else else
......
...@@ -367,7 +367,7 @@ static void *DemuxThread( void *p_data ) ...@@ -367,7 +367,7 @@ static void *DemuxThread( void *p_data )
if ( p_block ) /* drop frame/content if no next block */ if ( p_block ) /* drop frame/content if no next block */
{ {
p_sys->p_block->i_dts = p_sys->p_block->i_pts = mdate(); p_sys->p_block->i_dts = p_sys->p_block->i_pts = mdate();
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->p_block->i_pts ); es_out_SetPCR( p_demux->out, p_sys->p_block->i_pts );
es_out_Send( p_demux->out, p_sys->es, p_sys->p_block ); es_out_Send( p_demux->out, p_sys->es, p_sys->p_block );
p_sys->p_block = p_block; p_sys->p_block = p_block;
} }
......
...@@ -327,7 +327,7 @@ static unsigned __stdcall Thread(void *data) ...@@ -327,7 +327,7 @@ static unsigned __stdcall Thread(void *data)
pts = mdate() - ((GetQPC() - qpc) / 10); pts = mdate() - ((GetQPC() - qpc) / 10);
es_out_Control(demux->out, ES_OUT_SET_PCR, pts); es_out_SetPCR(demux->out, pts);
size_t bytes = frames * sys->frame_size; size_t bytes = frames * sys->frame_size;
block_t *block = block_Alloc(bytes); block_t *block = block_Alloc(bytes);
......
...@@ -247,7 +247,7 @@ static int Demux( demux_t *p_demux ) ...@@ -247,7 +247,7 @@ static int Demux( demux_t *p_demux )
} }
/* Set PCR */ /* Set PCR */
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_time); es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time);
/* we will read 100ms at once */ /* we will read 100ms at once */
i_read = p_sys->i_ssnd_fsize * ( p_sys->fmt.audio.i_rate / 10 ); i_read = p_sys->i_ssnd_fsize * ( p_sys->fmt.audio.i_rate / 10 );
......
...@@ -248,7 +248,7 @@ static int Demux( demux_t *p_demux ) ...@@ -248,7 +248,7 @@ static int Demux( demux_t *p_demux )
bool b_data = Block_Dequeue( p_demux, p_sys->i_time + CHUNK ); bool b_data = Block_Dequeue( p_demux, p_sys->i_time + CHUNK );
p_sys->i_time += CHUNK; p_sys->i_time += CHUNK;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_time ); es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
#ifdef ASF_DEBUG #ifdef ASF_DEBUG
msg_Dbg( p_demux, "Demux Loop Setting PCR to %"PRId64, VLC_TS_0 + p_sys->i_time ); msg_Dbg( p_demux, "Demux Loop Setting PCR to %"PRId64, VLC_TS_0 + p_sys->i_time );
#endif #endif
...@@ -681,7 +681,7 @@ static bool Block_Dequeue( demux_t *p_demux, mtime_t i_nexttime ) ...@@ -681,7 +681,7 @@ static bool Block_Dequeue( demux_t *p_demux, mtime_t i_nexttime )
if( p_sys->i_time < VLC_TS_0 ) if( p_sys->i_time < VLC_TS_0 )
{ {
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_time ); es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
#ifdef ASF_DEBUG #ifdef ASF_DEBUG
msg_Dbg( p_demux, " dequeue setting PCR to %"PRId64, VLC_TS_0 + p_sys->i_time ); msg_Dbg( p_demux, " dequeue setting PCR to %"PRId64, VLC_TS_0 + p_sys->i_time );
#endif #endif
......
...@@ -312,7 +312,7 @@ static int Demux( demux_t *p_demux ) ...@@ -312,7 +312,7 @@ static int Demux( demux_t *p_demux )
block_t *p_block; block_t *p_block;
/* set PCR */ /* set PCR */
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_time ); es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
p_block = vlc_stream_Block( p_demux->s, p_sys->i_frame_size ); p_block = vlc_stream_Block( p_demux->s, p_sys->i_frame_size );
if( p_block == NULL ) if( p_block == NULL )
......
...@@ -823,7 +823,7 @@ static int Demux( demux_t *p_demux ) ...@@ -823,7 +823,7 @@ static int Demux( demux_t *p_demux )
if( i_ts_min >= p_sys->i_pcr ) if( i_ts_min >= p_sys->i_pcr )
{ {
p_sys->i_pcr = i_ts_min; p_sys->i_pcr = i_ts_min;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pcr ); es_out_SetPCR( p_demux->out, p_sys->i_pcr );
UpdateSeekPoint( p_demux, p_sys->i_pcr ); UpdateSeekPoint( p_demux, p_sys->i_pcr );
} }
......
...@@ -1046,7 +1046,7 @@ static int Demux_Seekable( demux_t *p_demux ) ...@@ -1046,7 +1046,7 @@ static int Demux_Seekable( demux_t *p_demux )
} }
/* wait for the good time */ /* wait for the good time */
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_time ); es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
p_sys->i_time += p_sys->i_read_increment; p_sys->i_time += p_sys->i_read_increment;
/* init toread */ /* init toread */
...@@ -1351,7 +1351,7 @@ static int Demux_UnSeekable( demux_t *p_demux ) ...@@ -1351,7 +1351,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
unsigned int i_stream; unsigned int i_stream;
unsigned int i_packet; unsigned int i_packet;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_time ); es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
/* *** find master stream for data packet skipping algo *** */ /* *** find master stream for data packet skipping algo *** */
/* *** -> first video, if any, or first audio ES *** */ /* *** -> first video, if any, or first audio ES *** */
...@@ -1610,7 +1610,7 @@ static int Seek( demux_t *p_demux, mtime_t i_date, int i_percent ) ...@@ -1610,7 +1610,7 @@ static int Seek( demux_t *p_demux, mtime_t i_date, int i_percent )
p_stream->b_eof = AVI_TrackSeek( p_demux, i_stream, i_date ) != 0; p_stream->b_eof = AVI_TrackSeek( p_demux, i_stream, i_date ) != 0;
} }
p_sys->i_time = i_date; p_sys->i_time = i_date;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_time ); es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_time );
es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME, VLC_TS_0 + p_sys->i_time );