Author: uau Date: Tue Feb 27 02:16:59 2007 New Revision: 22356 Modified: trunk/mplayer.c Log: Seek to -ss position without first starting audio/video from the start. Manual seeks no longer shift -endpos position (hopefully no one considered that a "feature"). Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c (original) +++ trunk/mplayer.c Tue Feb 27 02:16:59 2007 @@ -3330,6 +3330,17 @@ if(play_n_frames==0){ mpctx->eof=PT_NEXT_ENTRY; goto goto_next_file; } +if (seek_to_sec) { + seek(mpctx, seek_to_sec, 1); + end_at.pos += seek_to_sec; +} + +if (end_at.type == END_AT_SIZE) { + mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_MPEndposNoSizeBased); + end_at.type = END_AT_NONE; +} + + while(!mpctx->eof){ float aq_sleep_time=0; if(!mpctx->sh_audio && mpctx->d_audio->sh) { @@ -3506,20 +3517,6 @@ if(step_sec>0) { } mpctx->was_paused = 0; - if (seek_to_sec) { - rel_seek_secs += seek_to_sec; - seek_to_sec = 0; - } - - if (end_at.type != END_AT_NONE) { - if(end_at.type == END_AT_SIZE) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_MPEndposNoSizeBased); - end_at.type = END_AT_NONE; - } else { - end_at.pos += rel_seek_secs; - } - } - /* Looping. */ if(mpctx->eof==1 && loop_times>=0) { int l = loop_times;
2007/2/27, uau <subversion@mplayerhq.hu>:
Author: uau Date: Tue Feb 27 02:16:59 2007 New Revision: 22356
Modified: trunk/mplayer.c
Log: Seek to -ss position without first starting audio/video from the start. Manual seeks no longer shift -endpos position (hopefully no one considered that a "feature").
Hardware mpeg4 encoders love to produce stream with only one header in the start and no extradata at all. Your patch breaks -ss for them. I guess this also applies for other cases. Thank you for asking about this issue in the maillist before committing. Please cease any commits for the time being.
On Tue, 2007-02-27 at 14:42 +0200, Ivan Kalvachev wrote:
Log: Seek to -ss position without first starting audio/video from the start. Manual seeks no longer shift -endpos position (hopefully no one considered that a "feature").
Hardware mpeg4 encoders love to produce stream with only one header in the start and no extradata at all. Your patch breaks -ss for them. I guess this also applies for other cases.
This bugreport could use some more detail. Do you have samples which fail? Do they work any better with MEncoder -ss? If they fail because of this change then I think there would be other ways to trigger problems with them too.
Please cease any commits for the time being.
Why?
Hello, On Tue, Feb 27, 2007 at 02:17:00AM +0100, uau wrote:
Author: uau Date: Tue Feb 27 02:16:59 2007 New Revision: 22356
Modified: trunk/mplayer.c
Log: Seek to -ss position without first starting audio/video from the start. Manual seeks no longer shift -endpos position (hopefully no one considered that a "feature").
report on mplayer-users says mplayer file.avi -ss 00:10:00 -endpos 1:30 -loop 0 starts from 0:0 after the first iteration with SVN. Can someone check if this is related to this commit? It seems the most likely one. Greetings, Reimar Döffinger
On Thu, 2007-03-01 at 00:46 +0100, Reimar Döffinger wrote:
report on mplayer-users says mplayer file.avi -ss 00:10:00 -endpos 1:30 -loop 0 starts from 0:0 after the first iteration with SVN. Can someone check if this is related to this commit? It seems the most likely one.
Yes it is caused by this commit. Per-file loop (but not if it's given as a global setting) seeks back to 0 and then restores option variables. That doesn't trigger a seek any more. It should be fixable by simply changing the loop code to seek to the -ss position instead of 0. Btw the way the loop code restores option variables in the middle of playback is fundamentally broken. You can't just overwrite the variables with new values after everything has already been initialized and expect things to work. I'm not sure what to do about that - it would be easy to just remove the variable changes, but perhaps some people depend on some aspect of that... To see the brokenness of per-file loop try for example to manually adjust speed higher during playback. After loop it'll restore the speed variable to 1 but won't change audio chain: result is video and audio at different speeds. Or start with "-speed 100": at initialization the speed is limited below 100 if there is audio, but loop reset sets it back to 100 and limits aren't rechecked. So this time audio is at max speed and video at speed 100.
participants (4)
-
Ivan Kalvachev -
Reimar Döffinger -
uau -
Uoti Urpala