<div dir="ltr">Hello,<div><br></div><div>Thanks for your answer. </div><div><br></div><div>You are right, this has to be handled differently depending on the source of the subtitles. </div><div><br></div><div>This patch actually tries to introduce two different behaviors</div><div><br></div><div>- if the subtitles come from the subtitle demux, then the delay is removed</div><div>- if the subtitles come from another source, then the old behavior is conserved (and a delay is still applied)</div><div><br></div><div><br></div><div>Details :</div><div><br></div><div>- a new variable ("sub-isfilesub") is added inside input/var.c. It is set to *false* by default <br></div><div><br></div><div>- if this variable is set to false, the old behavior remains strictly identical : the two functions that handle the delay </div><div>(namely input/input.c:UpdatePtsDelay and input/var.c:EsDelayCallback) keep the *exact* same behavior as before</div><div><br></div><div>- if this variable is set to true, than effectively, the delay will be removed</div><div><br></div><div>- So, I agree, we would need to make sure that, inside we have a reliable way to tell "file subtitles" apart from other subtitle types in order to correctly set this variable ?</div><div>Is it impossible or too difficult ?</div><div><br></div><div>Here is what I can tell about the lifetime of this variable :</div><div>* it is set to false upon construction (inside input/var.c)</div><div>* it is also re-set to false at the very beginning of input.c:LoadSlaves (which is called each time a new movie is loaded, I think)</div><div>* the only place where it is set to true is inside input.c:input_SlaveSourceAdd (and only if "slave_type" is equal to "SLAVE_TYPE_SPU". See input.c:3333)</div><div> </div><div><div><br class="gmail-Apple-interchange-newline">Below is the callstack when entering demux/subtitle.c:Open():</div><div><br></div><div>1 Open subtitle.c 309 <br></div><div><div>2 demux_Probe demux.c 191 </div><div>3 module_load modules.c 183 </div><div>4 vlc_module_load modules.c 279 </div><div>5 demux_NewAdvanced demux.c 264 </div><div>6 InputDemuxNew input.c 2553 </div><div>7 InputSourceNew input.c 2663 </div><div>8 input_SlaveSourceAdd input.c 3325 <-- sub-isfilesub is set to true here if slave_type==SLAVE_TYPE_SPU</div><div>9 LoadSlaves input.c 1161 <-- sub-filesub is set to false here</div><div>10 Init input.c 1363 </div><div>11 Run input.c 497 </div></div></div><div><br></div><div><br></div><div>I assumed that testing for slave_type==SLAVE_TYPE_SPU (inside input.c:input_SlaveSourceAdd) would be a good test .</div><div>However, it could be done elsewhere in this callstack. </div><div><br></div><div>My initial intent was to set "sub-isfilesub" directly inside the Open() function. However, it seems it is not possible to set an inherited var from there. Did I miss something ? </div><div><br></div><div>Do you know of another place in the callstack where it would be more suited to change it ?</div><div><br></div><div>Sorry for the long email, and thus many thanks for your attention,</div><div><br></div><div>Regards,</div><div><br></div><div>Pascal Thomet</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 3, 2017 at 5:29 PM, Rémi Denis-Courmont <span dir="ltr"><<a href="mailto:remi@remlab.net" target="_blank">remi@remlab.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Hello,<br>
<br>
This seems to assume that all subtitles come from the subtitle demux, which is<br>
definitely not true.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
雷米‧德尼-库尔蒙<br>
<a href="https://www.remlab.net/" rel="noreferrer" target="_blank">https://www.remlab.net/</a><br>
______________________________<wbr>_________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/vlc-devel</a></font></span></blockquote></div><br></div>