[MPlayer-dev-eng] Re: [PATCH] SSA/ASS subtitles support
Uoti Urpala
uoti.urpala at pp1.inet.fi
Mon Jun 5 02:20:43 CEST 2006
On Sun, 2006-06-04 at 16:54 +0400, Evgeniy Stepanov wrote:
> On Sunday 04 June 2006 14:55, Uoti Urpala wrote:
> > Now it renders the bitmaps using sh_video->pts as the time _after_ vo
> > flip has already been called for the image with that pts, so it's wrong
> > even if there are no special filters. But as I mentioned above
> > sh_video->pts is currently somewhat wrong anyway, unless you use the
> > -correct-pts option in the patch I posted earlier.
>
> The timecodes in the filter are supposed to be correct, at least the most
> close to correct I can get in mplayer ? A good reason to move rendering back
> to the filter. So, it (filter) will render subtitles and then either blend
> the resulting bitmaps, or pass them to the vo, depending on VFCAP.
The timecodes aren't set in the filter chain at all yet, but it is easy
to make the current (somewhat incorrect) timecodes appear there so that
an ass-specific workaround like the ass_find_sub() function you had
before isn't needed. I think this change to mplayer.c should be enough
for that:
- blit_frame=decode_video(sh_video,start,in_size,drop_frame,
MP_NOPTS_VALUE);
+ blit_frame=decode_video(sh_video,start,in_size,drop_frame,
sh_video->pts);
I have a patch that gives accurate timecodes in the filter chain, and
with that you could get accurate values outside the chain too. However I
think that getting the timecodes from inside the chain is the best
solution, as that makes it possible to alter the position of the filter
within the chain which could matter when the other filters DO manipulate
pts. Your current code needs to be changed anyway as it simply uses the
timestamps too late, after the corresponding frame has already been
shown.
More information about the MPlayer-dev-eng
mailing list