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 )
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 )
{
return es_out_Control( out, ES_OUT_SET_META, p_meta );
......
......@@ -229,7 +229,7 @@ static void *Thread (void *data)
block->i_pts = pts;
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);
}
return NULL;
......
......@@ -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);
}
......
......@@ -160,7 +160,7 @@ static int Demux(demux_t *demux)
date_Increment(&sys->pts, block->i_nb_samples);
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;
}
......
......@@ -479,7 +479,7 @@ static int Demux( demux_t *p_demux )
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 );
}
return 1;
......
......@@ -748,7 +748,7 @@ static int Demux( demux_t *p_demux )
}
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)
es_out_Send( p_demux->out, p_sys->p_video_es, p_video_frame );
if(p_audio_frame)
......@@ -827,7 +827,7 @@ static int Control( demux_t *p_demux, int query, va_list args )
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->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 );
break;
case DEMUX_GET_PTS_DELAY:
......
......@@ -341,7 +341,7 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame
sys->last_pts = video_frame->i_pts;
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);
}
......@@ -365,7 +365,7 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(IDeckLinkVideoInputFrame
sys->last_pts = audio_frame->i_pts;
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);
}
......
......@@ -1895,7 +1895,7 @@ static int Demux( demux_t *p_demux )
p_block->i_pts = p_block->i_dts = i_pts;
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 );
i_samples--;
......
......@@ -1364,7 +1364,7 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
int 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;
}
block_Release( p_pkt );
......
......@@ -606,7 +606,7 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
int 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;
}
block_Release( p_pkt );
......
......@@ -599,7 +599,7 @@ static int Demux(demux_t *demux)
block->i_pts = pts >= 0 ? (1 + pts) : VLC_TS_INVALID;
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);
}
}
......
......@@ -370,7 +370,7 @@ static int Demux( demux_t *p_demux )
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 );
}
......
......@@ -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;
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;
return VLC_SUCCESS;
}
......
......@@ -993,7 +993,7 @@ static int DecodeFrame( demux_t *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;
if( NewFrame( p_demux ) != VLC_SUCCESS )
......
......@@ -1379,14 +1379,14 @@ static int Demux( demux_t *p_demux )
tk->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
}
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 ||
i_minpcr > p_sys->i_pcr + CLOCK_FREQ / 4 )
{
p_sys->i_pcr = i_minpcr;
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 )
{
p_block = GrabAudio( p_demux );
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 &&
......
......@@ -174,7 +174,7 @@ static void stream_read_cb(pa_stream *s, size_t length, void *userdata)
else
pts -= latency;
es_out_Control(demux->out, ES_OUT_SET_PCR, pts);
es_out_SetPCR(demux->out, pts);
if (unlikely(sys->es == NULL))
goto race;
......
......@@ -521,7 +521,7 @@ static int Demux(demux_t *p_demux)
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);
}
......
......@@ -408,7 +408,7 @@ static void *DemuxThread( void *p_data )
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;
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 );
p_sys->p_block = p_block;
}
......
......@@ -443,7 +443,7 @@ void codec_decode (demux_t *demux, void *data, block_t *block)
if (data)
{
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);
}
else
......
......@@ -288,7 +288,7 @@ static int Demux( demux_t *p_demux )
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 );
p_sys->i_next_date += p_sys->i_incr;
......
......@@ -254,7 +254,7 @@ static void *Thread(void *data)
block_t *block = Shoot(demux);
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);
}
......
......@@ -502,7 +502,7 @@ noshm:
{
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);
}
else
......
......@@ -326,7 +326,7 @@ static void DemuxFile (void *data)
block->i_pts = block->i_dts = mdate ();
/* 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);
}
......@@ -349,7 +349,7 @@ static void DemuxIPC (void *data)
block->i_pts = block->i_dts = mdate ();
/* 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);
}
......
......@@ -89,7 +89,7 @@ static int DemuxOnce (demux_t *demux, bool master)
block->i_length = date_Increment (&sys->date, 1) - pts;
es_out_Send (demux->out, sys->es, block);
if (master)
es_out_Control (demux->out, ES_OUT_SET_PCR, pts);
es_out_SetPCR(demux->out, pts);
return 1;
}
......
......@@ -714,7 +714,7 @@ static void *UserPtrThread (void *data)
block->i_buffer = buf.length;
block->i_pts = block->i_dts = GetBufferPTS (&buf);
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);
}
vlc_restorecancel (canc); /* <- hmm, this is purely cosmetic */
......@@ -758,7 +758,7 @@ static void *MmapThread (void *data)
if (block != NULL)
{
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);
}
vlc_restorecancel (canc);
......@@ -819,7 +819,7 @@ static void *ReadThread (void *data)
if (val != -1)
{
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);
}
else
......
......@@ -367,7 +367,7 @@ static void *DemuxThread( void *p_data )
if ( p_block ) /* drop frame/content if no next block */
{
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 );
p_sys->p_block = p_block;
}
......
......@@ -327,7 +327,7 @@ static unsigned __stdcall Thread(void *data)
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;
block_t *block = block_Alloc(bytes);
......
......@@ -247,7 +247,7 @@ static int Demux( demux_t *p_demux )
}
/* 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 */
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 )
bool b_data = Block_Dequeue( p_demux, 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
msg_Dbg( p_demux, "Demux Loop Setting PCR to %"PRId64, VLC_TS_0 + p_sys->i_time );
#endif
......@@ -681,7 +681,7 @@ static bool Block_Dequeue( demux_t *p_demux, mtime_t i_nexttime )
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
msg_Dbg( p_demux, " dequeue setting PCR to %"PRId64, VLC_TS_0 + p_sys->i_time );
#endif
......
......@@ -312,7 +312,7 @@ static int Demux( demux_t *p_demux )
block_t *p_block;
/* 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 );
if( p_block == NULL )
......
......@@ -823,7 +823,7 @@ static int Demux( demux_t *p_demux )
if( i_ts_min >= p_sys->i_pcr )
{
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 );
}
......
......@@ -1046,7 +1046,7 @@ static int Demux_Seekable( demux_t *p_demux )
}
/* 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;
/* init toread */
......@@ -1351,7 +1351,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
unsigned int i_stream;
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 *** */
/* *** -> 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 )
p_stream->b_eof = AVI_TrackSeek( p_demux, i_stream, i_date ) != 0;
}
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 );
msg_Dbg( p_demux, "seek: %"PRId64" seconds", p_sys->i_time /CLOCK_FREQ );
return VLC_SUCCESS;
......
......@@ -987,7 +987,7 @@ static int Demux( demux_t *p_demux )
FrameSpanAddSpan( &p_sys->position, &advance );
/* set PCR */
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 );
......
......@@ -143,7 +143,7 @@ static int Demux( demux_t *p_demux )
p_block->i_pts = date_Get( &p_sys->pts );
}
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, p_block );
......
......@@ -205,7 +205,7 @@ static int Demux( demux_t *p_demux)
p_sys->i_pts_offset_lowtide = i_delay;
}
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block_out->i_dts );
es_out_SetPCR( p_demux->out, p_block_out->i_dts );
es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
p_block_out = p_next;
......
......@@ -365,13 +365,13 @@ static int Demux( demux_t *p_demux )
/* set PCR */
if( unlikely(p_sys->i_pts == VLC_TS_INVALID) )
es_out_Control( p_demux->out, ES_OUT_SET_PCR, __MAX(p_block_out->i_dts - 1, VLC_TS_0) );
es_out_SetPCR( p_demux->out, __MAX(p_block_out->i_dts - 1, VLC_TS_0) );
p_sys->i_pts = p_block_out->i_dts;
es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pts );
es_out_SetPCR( p_demux->out, p_sys->i_pts );
p_block_out = p_next;
}
......
......@@ -227,7 +227,7 @@ static int Demux (demux_t *demux)
}
block->i_pts = block->i_dts = VLC_TS_0 + date_Get (&sys->pts);
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);
date_Increment (&sys->pts, SAMPLES);
return 1;
......
......@@ -198,7 +198,7 @@ static int Demux(demux_t *demux)
deadline = mdate();
const mtime_t max_wait = CLOCK_FREQ / 50;
if (deadline + max_wait < pts_first) {
es_out_Control(demux->out, ES_OUT_SET_PCR, deadline);
es_out_SetPCR(demux->out, deadline);
/* That's ugly, but not yet easily fixable */
mwait(deadline + max_wait);
return 1;
......@@ -221,7 +221,7 @@ static int Demux(demux_t *demux)
data->i_dts =
data->i_pts = VLC_TS_0 + pts;
es_out_Control(demux->out, ES_OUT_SET_PCR, data->i_pts);
es_out_SetPCR(demux->out, data->i_pts);
es_out_Send(demux->out, sys->es, data);
date_Increment(&sys->pts, 1);
......
......@@ -280,7 +280,7 @@ static int SendBlock( demux_t *p_demux, int i )
p_block->i_dts = p_block->i_pts;
/* set PCR */
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, p_block );
if( p_sys->b_still )
......
......@@ -784,7 +784,7 @@ static int Demux( demux_t *p_demux)
if( i_pcr > VLC_TS_INVALID && i_pcr > p_sys->i_pcr )
{
if( es_out_Control( p_demux->out, ES_OUT_SET_PCR, i_pcr ) )
if( es_out_SetPCR( p_demux->out, i_pcr ) )
{
msg_Err( p_demux, "ES_OUT_SET_PCR failed, aborting." );
return 0;
......
......@@ -282,7 +282,7 @@ static int Demux( demux_t *p_demux )
p_frame->i_pts = VLC_TS_0 + date_Get( &p_sys->pts );
/* Set PCR */
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_frame->i_pts );
es_out_SetPCR( p_demux->out, p_frame->i_pts );
/* Send data */
es_out_Send( p_demux->out, p_sys->es, p_frame );
......
......@@ -1260,7 +1260,7 @@ static int DemuxTrack( demux_t *p_demux, mp4_track_t *tk, uint64_t i_readpos,
/* !important! Ensure clock is set before sending data */
if( p_demux->p_sys->i_pcr == VLC_TS_INVALID )
{
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + i_current_nzdts );
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_current_nzdts );
p_demux->p_sys->i_pcr = VLC_TS_0 + i_current_nzdts;
}
......@@ -1410,7 +1410,7 @@ static int DemuxMoov( demux_t *p_demux )
if( p_sys->i_pcr > VLC_TS_INVALID )
{
p_sys->i_pcr = VLC_TS_0 + MP4_rescale( p_sys->i_time, p_sys->i_timescale, CLOCK_FREQ );
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pcr );
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
}
/* */
......@@ -4350,7 +4350,7 @@ static int DemuxMoof( demux_t *p_demux )
/* !important! Ensure clock is set before sending data */
if( p_sys->i_pcr == VLC_TS_INVALID )
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + i_nztime );
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_nztime );
/* demux up to increment amount of data on every track, or just set pcr if empty data */
for( ;; )
......@@ -4416,7 +4416,7 @@ static int DemuxMoof( demux_t *p_demux )
{
p_sys->i_time += __MAX(i_scaledincrement, 1);
p_sys->i_pcr = VLC_TS_0 + MP4_rescale( p_sys->i_time, p_sys->i_timescale, CLOCK_FREQ );
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pcr );
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
}
else
{
......@@ -4435,7 +4435,7 @@ static int DemuxMoof( demux_t *p_demux )
{
p_sys->i_time = i_segment_end;
p_sys->i_pcr = VLC_TS_0 + MP4_rescale( p_sys->i_time, p_sys->i_timescale, CLOCK_FREQ );
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pcr );
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
}
}
......@@ -4941,7 +4941,7 @@ end:
i_demux_end = i_track_end;
}
if( i_demux_end != INT64_MIN )
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + i_demux_end );
es_out_SetPCR( p_demux->out, VLC_TS_0 + i_demux_end );
}
return i_status;
......
......@@ -295,7 +295,7 @@ static int Demux( demux_t *p_demux )
p_data->i_dts = p_data->i_pts =
VLC_TS_0 + CLOCK_FREQ * p_sys->i_position / p_sys->info.sample_freq;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_data->i_dts );
es_out_SetPCR( p_demux->out, p_data->i_dts );
es_out_Send( p_demux->out, p_sys->p_es, p_data );
......
......@@ -347,7 +347,7 @@ static int Demux( demux_t *p_demux )
if( p_block_out->i_dts > VLC_TS_INVALID )
{
p_block_out->i_dts += p_sys->i_time_offset;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block_out->i_dts );
es_out_SetPCR( p_demux->out, p_block_out->i_dts );
}
/* Re-estimate bitrate */
if( p_sys->b_estimate_bitrate && p_sys->i_pts > INT64_C(500000) )
......
......@@ -472,7 +472,7 @@ static int Demux( demux_t *p_demux)
msg_Dbg( p_demux, "using %.2f fps", (double) p_sys->frame_rate_num / p_sys->frame_rate_den );
}
es_out_Control( p_demux->out, ES_OUT_SET_PCR, date_Get( &p_sys->dts ) );
es_out_SetPCR( p_demux->out, date_Get( &p_sys->dts ) );
unsigned i_nb_fields;
if( i_frame_length > 0 )
{
......
......@@ -170,7 +170,7 @@ static int Demux( demux_t *p_demux )
{
block_t *p_next = p_block_out->p_next;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block_out->i_dts );
es_out_SetPCR( p_demux->out, p_block_out->i_dts );
p_block_out->p_next = NULL;
es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
......
......@@ -455,7 +455,7 @@ static int Demux( demux_t *p_demux )
p_sys->i_lastpack_byte = vlc_stream_Tell( p_demux->s );
if( !p_sys->b_have_pack ) p_sys->b_have_pack = true;
/* done later on to work around bad vcd/svcd streams */
/* es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_scr ); */
/* es_out_SetPCR( p_demux->out, p_sys->i_scr ); */
if( i_mux_rate > 0 ) p_sys->i_mux_rate = i_mux_rate;
}
block_Release( p_pkt );
......@@ -574,7 +574,7 @@ static int Demux( demux_t *p_demux )
p_sys->i_first_scr = -1;
}
else
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_pack_scr );
es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_pack_scr );
}
if( tk->b_configured && tk->es &&
......@@ -606,7 +606,7 @@ static int Demux( demux_t *p_demux )
p_sys->i_scr = p_pkt->i_pts;
if( p_sys->i_first_scr == -1 )
p_sys->i_first_scr = p_sys->i_scr;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_pkt->i_pts );
es_out_SetPCR( p_demux->out, p_pkt->i_pts );
}
if( tk->fmt.i_codec == VLC_CODEC_TELETEXT &&
......
......@@ -207,7 +207,7 @@ static int Demux( demux_t *p_demux )
}
/* Set PCR */
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 );
/* Read video */
i_size = ( header[0] >> 4 ) | ( header[1] << 4 ) | ( header[2] << 12 );
......
......@@ -401,7 +401,7 @@ static int Demux( demux_t *p_demux )
if( p_sys->i_pcr < 0 || p_sys->i_pcr < p_data->i_dts - VLC_TS_0 )
{
p_sys->i_pcr = p_data->i_dts - VLC_TS_0;
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 );
}
if( fh.i_type == 'A' && p_sys->p_es_audio )
......
......@@ -321,7 +321,7 @@ static int Demux( demux_t * p_demux )
if( i_lastpcr > VLC_TS_INVALID )
{
p_sys->i_nzpcr_offset = i_lastpcr - VLC_TS_0;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, i_lastpcr );
es_out_SetPCR( p_demux->out, i_lastpcr );
}
p_sys->i_pcr = VLC_TS_INVALID;
}
......@@ -691,7 +691,7 @@ static int Demux( demux_t * p_demux )
if( ! b_skipping && p_sys->b_preparsing_done )
{
p_sys->i_pcr = i_pcr_candidate;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pcr );
es_out_SetPCR( p_demux->out, p_sys->i_pcr );
}
}
......@@ -1157,7 +1157,7 @@ static void Ogg_SendOrQueueBlocks( demux_t *p_demux, logical_stream_t *p_stream,
if ( p_ogg->i_pcr < VLC_TS_0 && i_firstpts > VLC_TS_INVALID )
{
p_ogg->i_pcr = i_firstpts;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_ogg->i_pcr );
es_out_SetPCR( p_demux->out, p_ogg->i_pcr );
}
}
p_stream->p_preparse_block = NULL;
......
......@@ -217,7 +217,7 @@ static int Demux( demux_t *p_demux )
if( p_frame->i_pts > VLC_TS_INVALID && !p_sys->b_pcr_audio )
{
es_out_Control( p_demux->out, ES_OUT_SET_PCR, (int64_t)p_frame->i_pts);
es_out_SetPCR