[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 379: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
SMPlayer Support Forum • View topic - [PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollover

This forum is deprecated. Please visit https://github.com/smplayer-dev/smplayer/discussions

[PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollover

Forum to talk about the development of SMPlayer (code, patches...).

[PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollover

Postby Basic.Master » Thu Apr 23, 2015 12:51 pm

[after I realized that the last patch posted there was from 2012, so this fotum seems to be the better place]

MPEG-TS files (e.g. DVB recordings) have a 2^33 wide PTS (playback timestamp) value regularly embedded, which is used by MPlayer to output the current time. As this timestamp is not (necessarily) 0 at the start of the file, in SMPlayer mset.starting_time is subtracted from mset.current_sec to get the elapsed time since the file start.

This only works if mset.current_sec > mset.starting_time is valid. But if between the file start and the current position there is a PTS rollover, this leads to a negative value displayed by SMPlayer.

The attached patch fixes this issue by compensating this PTS rollover. You can find a test MPEG-TS file at which is 20s long and has a PTS rollover at 10s.
Attachments
smplayer_mpegts_pts_rollover.diff
(466 Bytes) Downloaded 655 times
Basic.Master
 
Posts: 8
Joined: Thu Apr 23, 2015 12:41 pm

Re: [PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollov

Postby rvm » Fri Apr 24, 2015 3:46 am

I've just applied your patch (svn r6885).
rvm
Site Admin
 
Posts: 3787
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: [PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollov

Postby Basic.Master » Sat Mar 25, 2017 9:04 pm

Basic.Master
 
Posts: 8
Joined: Thu Apr 23, 2015 12:41 pm

Re: [PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollov

Postby rvm » Sun Mar 26, 2017 2:04 am

The change was several months ago, I think I don't remember the reason. Maybe mpv doesn't work well with it.
rvm
Site Admin
 
Posts: 3787
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: [PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollov

Postby Basic.Master » Fri Mar 31, 2017 11:03 pm

Hmm, in that case it would be great if the #define could be re-enabled so that everybody with mplayer benefits from having a correct position within a MPEG-TS.
Basic.Master
 
Posts: 8
Joined: Thu Apr 23, 2015 12:41 pm

Re: [PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollov

Postby rvm » Sat Apr 01, 2017 10:22 am

Could you provide a sample video where this patch is needed? The link you provided on your first post doesn't work anymore. I'd like to test it with mpv.
rvm
Site Admin
 
Posts: 3787
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: [PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollov

Postby Basic.Master » Sat Apr 01, 2017 11:57 am

I just reuploaded the file; the link works again now. Without the #define and with mplayer, the video starts at about position 26:30:04.
Basic.Master
 
Posts: 8
Joined: Thu Apr 23, 2015 12:41 pm

Re: [PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollov

Postby Basic.Master » Sat May 13, 2017 10:30 pm

Have you possibly been able to test it with mpv?
Basic.Master
 
Posts: 8
Joined: Thu Apr 23, 2015 12:41 pm

Re: [PATCH] Fix wrong elapsed time due to MPEG-TS PTS rollov

Postby rvm » Sat May 13, 2017 11:09 pm

Your sample video plays fine (correct time from 0 to 20 seconds) in mpv without the patch. So I think that maybe the problem should actually be fixed in mplayer, since mpv seems to already include a fix, instead of adding a workaround in smplayer.
rvm
Site Admin
 
Posts: 3787
Joined: Wed Dec 23, 2009 1:25 am
Location: España


Return to Development

Who is online

Users browsing this forum: No registered users and 2 guests