Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (5)
  • Ayush Dey's avatar
    input: add input_GetItemDuration function to calculate input thread item duration · 20ca1dd6
    Ayush Dey authored and Steve Lhomme's avatar Steve Lhomme committed
    Reverts commit c86e464f and bf5b6d59
    
    Add the input_GetItemDuration function, which calculates the duration of a
    track item based on the start and stop times stored in the input thread's private
    data. If the stop time is not set, the function considers the provided duration
    as the stop time; otherwise, it calculates the duration using the start and stop times.
    
    Call input_GetItemDuration for retrieving the updated duration of the current track
    item. The calculated duration is then used to set the player's length accurately.
    20ca1dd6
  • Ayush Dey's avatar
    player: add data member `start_offset` in struct vlc_player_timer · 05c91910
    Ayush Dey authored and Steve Lhomme's avatar Steve Lhomme committed
    This data member `start_offset` will be used in the next commit to store the
    start time(which will act as as offset) of the current track so that the current
    timestamp is adjusted accordingly.
    05c91910
  • Ayush Dey's avatar
    player: pass `start_offset` to vlc_player_UpdateTimer() and store it in the player timer · 0cc2d8be
    Ayush Dey authored and Steve Lhomme's avatar Steve Lhomme committed
    Update the callers of `vlc_player_UpdateTimer()` to pass an additional `start_offset` argument,
    representing the start time of the current input item (acting as an offset). Modify the
    `vlc_player_UpdateTimer()` function to store this start timing in the player timer, ensuring
    accurate tracking of the playback start position.
    
    This change helps maintain correct timing information, particularly when dealing with segmented
    tracks or CUE files, by ensuring the player's timer aligns with the actual start time of the input.
    0cc2d8be
  • Ayush Dey's avatar
    input: add offset during seek by position operation · d1431101
    Ayush Dey authored and Steve Lhomme's avatar Steve Lhomme committed
    Calculate the updated position by adding offset according to the current
    track duration.
    d1431101
  • Ayush Dey's avatar
    input: add offset during seek by time operation · cc638083
    Ayush Dey authored and Steve Lhomme's avatar Steve Lhomme committed
    Add an offset of `priv->i_start` during the seek by time operation to correctly account
    for the start time of individual segmented tracks. Modify the initial value passed to
    `input_SetTime()` to 0, as the start offset (`priv->i_start`) has already been considered.
    
    These changes ensure accurate timing and seek behavior in media files containing segmented tracks,
    such as those defined by CUE files, by aligning the seek position with the actual timing of individual
    segments.
    cc638083
......@@ -556,7 +556,7 @@ static int MainLoopTryRepeat( input_thread_t *p_input )
/* Seek to start position */
if( priv->i_start > 0 )
input_SetTime( p_input, priv->i_start, false );
input_SetTime( p_input, 0, false );
else
input_SetPosition( p_input, 0.0f, false );
......@@ -926,7 +926,7 @@ static void SetStopStart( input_thread_t * p_input )
msg_Dbg( p_input, "starting at time: %"PRId64"s",
SEC_FROM_VLC_TICK(priv->i_start) );
input_SetTime( p_input, priv->i_start, false );
input_SetTime( p_input, 0, false );
}
if( priv->i_stop > 0 && priv->i_stop <= priv->i_start )
{
......@@ -1943,7 +1943,19 @@ static bool Control( input_thread_t *p_input,
/* Reset the decoders states and clock sync (before calling the demuxer */
es_out_Control(&priv->p_es_out->out, ES_OUT_RESET_PCR);
if( demux_SetPosition( priv->master->p_demux, param.pos.f_val,
vlc_tick_t i_length = InputSourceGetLength(priv->master, priv->p_item);
double f_val;
if( i_length > 0 )
{
/* Calculate the updated position according to the current track duration */
if (priv->i_stop != 0)
f_val = (priv->i_start + param.pos.f_val * (priv->i_stop - priv->i_start)) / i_length;
else
f_val = (priv->i_start + param.pos.f_val * (i_length - priv->i_start)) / i_length;
}
else
f_val = param.pos.f_val;
if( demux_SetPosition( priv->master->p_demux, f_val,
!param.pos.b_fast_seek ) )
{
msg_Err( p_input, "INPUT_CONTROL_SET_POSITION "
......@@ -1973,7 +1985,7 @@ static bool Control( input_thread_t *p_input,
/* Reset the decoders states and clock sync (before calling the demuxer */
es_out_Control(&priv->p_es_out->out, ES_OUT_RESET_PCR);
i_ret = demux_SetTime( priv->master->p_demux, param.time.i_val,
i_ret = demux_SetTime( priv->master->p_demux, priv->i_start + param.time.i_val,
!param.time.b_fast_seek );
if( i_ret )
{
......@@ -1981,7 +1993,7 @@ static bool Control( input_thread_t *p_input,
/* Emulate it with a SET_POS */
if( i_length > 0 )
{
double f_pos = (double)param.time.i_val / (double)i_length;
double f_pos = (double)(priv->i_start + param.time.i_val) / (double)i_length;
i_ret = demux_SetPosition( priv->master->p_demux, f_pos,
!param.time.b_fast_seek );
}
......@@ -3484,15 +3496,14 @@ bool input_CanPaceControl(input_thread_t *input)
return priv->master->b_can_pace_control;
}
void input_SetItemDuration(input_thread_t *input, vlc_tick_t duration)
vlc_tick_t input_GetItemDuration(input_thread_t *input, vlc_tick_t duration)
{
input_thread_private_t *priv = input_priv(input);
input_item_t *item = input_GetItem(input);
if( priv->i_stop == 0 ) /* consider `duration` as stop time, if stop-time not set */
duration -= priv->i_start;
else /* calculate duration based on start-time and stop-time */
duration = priv->i_stop - priv->i_start;
input_item_SetDuration(item, duration);
return duration;
}
\ No newline at end of file
......@@ -640,15 +640,20 @@ input_attachment_t *input_GetAttachment(input_thread_t *input, const char *name)
bool input_CanPaceControl(input_thread_t *input);
/**
* Set the duration of the input item.
* Calculates the duration of the item in an input thread.
*
* This function sets the duration of the input item associated with the input thread.
* It uses the 'start-time' and 'stop-time' values to calculate the track duration.
* This function determines the duration of a track item based on the start and
* stop times stored in the input thread's private data. If the stop time is not
* set (i.e., equals zero), the function considers the given `duration` as the
* stop time and calculates the effective duration based on the start time.
* Otherwise, it calculates the duration using the set start and stop times.
*
* @param input The input thread object.
* @param duration The duration to be set, in vlc_tick_t units.
* @param input Pointer to the input_thread_t object.
* @param duration The initial duration value, used if the stop time is not set.
*
* @return The calculated duration based on the start and stop times.
*/
void input_SetItemDuration(input_thread_t *input, vlc_tick_t duration);
vlc_tick_t input_GetItemDuration(input_thread_t *input, vlc_tick_t duration);
/* Bound pts_delay */
#define INPUT_PTS_DELAY_MAX VLC_TICK_FROM_SEC(60)
......
......@@ -56,8 +56,11 @@ input_item_parser_InputEvent(input_thread_t *input,
switch (event->type)
{
case INPUT_EVENT_TIMES:
input_SetItemDuration(input, event->times.length);
{
vlc_tick_t duration = input_GetItemDuration(input, event->times.length);
input_item_SetDuration(input_GetItem(input), duration);
break;
}
case INPUT_EVENT_STATE:
parser->state = event->state.value;
break;
......
......@@ -862,6 +862,7 @@ input_thread_Events(input_thread_t *input_thread,
{
struct vlc_player_input *input = user_data;
vlc_player_t *player = input->player;
input_thread_private_t *priv = input_priv(input_thread);
assert(input_thread == input->thread);
......@@ -881,7 +882,7 @@ input_thread_Events(input_thread_t *input_thread,
event->output_clock.master, &point,
VLC_TICK_INVALID,
event->output_clock.frame_rate,
event->output_clock.frame_rate_base);
event->output_clock.frame_rate_base, 0);
}
else
{
......@@ -916,6 +917,7 @@ input_thread_Events(input_thread_t *input_thread,
{
bool changed = false;
vlc_tick_t system_date = VLC_TICK_INVALID;
vlc_tick_t duration = input_GetItemDuration(input->thread, event->times.length);
if (event->times.time != VLC_TICK_INVALID
&& (input->time != event->times.time
......@@ -930,10 +932,10 @@ input_thread_Events(input_thread_t *input_thread,
vlc_player_input_UpdateTime(input);
}
if (input->length != event->times.length)
if (input->length != duration)
{
input->length = event->times.length;
input_SetItemDuration(input->thread, event->times.length);
input->length = duration;
input_item_SetDuration(input_GetItem(input->thread), duration);
vlc_player_SendEvent(player, on_length_changed, input->length);
changed = true;
}
......@@ -955,7 +957,7 @@ input_thread_Events(input_thread_t *input_thread,
.system_date = system_date,
};
vlc_player_UpdateTimer(player, NULL, false, &point,
input->normal_time, 0, 0);
input->normal_time, 0, 0, priv->i_start);
}
break;
}
......
......@@ -218,6 +218,7 @@ struct vlc_player_timer
vlc_tick_t input_length;
vlc_tick_t input_normal_time;
vlc_tick_t last_ts;
vlc_tick_t start_offset;
double input_position;
vlc_tick_t seek_ts;
......@@ -489,7 +490,8 @@ vlc_player_UpdateTimer(vlc_player_t *player, vlc_es_id_t *es_source,
bool es_source_is_master,
const struct vlc_player_timer_point *point,
vlc_tick_t normal_time,
unsigned frame_rate, unsigned frame_rate_base);
unsigned frame_rate, unsigned frame_rate_base,
vlc_tick_t start_offset);
void
vlc_player_RemoveTimerSource(vlc_player_t *player, vlc_es_id_t *es_source);
......
......@@ -34,6 +34,7 @@ vlc_player_ResetTimer(vlc_player_t *player)
player->timer.input_length = VLC_TICK_INVALID;
player->timer.input_normal_time = VLC_TICK_0;
player->timer.last_ts = VLC_TICK_INVALID;
player->timer.start_offset = 0;
player->timer.input_position = 0;
player->timer.smpte_source.smpte.last_framenum = ULONG_MAX;
player->timer.seek_ts = VLC_TICK_INVALID;
......@@ -318,7 +319,7 @@ vlc_player_UpdateTimerSource(vlc_player_t *player,
assert(player->timer.input_normal_time >= VLC_TICK_0);
source->point.rate = rate;
source->point.ts = ts - player->timer.input_normal_time + VLC_TICK_0;
source->point.ts = ts - player->timer.input_normal_time - player->timer.start_offset + VLC_TICK_0;
source->point.length = player->timer.input_length;
/* Put an invalid date for the first point in order to disable
......@@ -330,7 +331,7 @@ vlc_player_UpdateTimerSource(vlc_player_t *player,
source->point.system_date = system_date;
if (source->point.length != VLC_TICK_INVALID)
source->point.position = (ts - player->timer.input_normal_time)
source->point.position = (ts - player->timer.input_normal_time - player->timer.start_offset)
/ (double) source->point.length;
else
source->point.position = player->timer.input_position;
......@@ -434,7 +435,8 @@ vlc_player_UpdateTimer(vlc_player_t *player, vlc_es_id_t *es_source,
bool es_source_is_master,
const struct vlc_player_timer_point *point,
vlc_tick_t normal_time,
unsigned frame_rate, unsigned frame_rate_base)
unsigned frame_rate, unsigned frame_rate_base,
vlc_tick_t start_offset)
{
assert(point);
/* A null source can't be the master */
......@@ -459,6 +461,8 @@ vlc_player_UpdateTimer(vlc_player_t *player, vlc_es_id_t *es_source,
player->timer.last_ts = VLC_TICK_INVALID;
force_update = true;
}
if (start_offset > 0)
player->timer.start_offset = start_offset;
/* Will likely be overridden by non input source */
player->timer.input_position = point->position;
......