r32777 - in trunk: DOCS/man/en/mplayer.1 help/help_mp-cs.h help/help_mp-de.h help/help_mp-en.h help/help_mp-es.h help/help_mp-fr.h help/help_mp-hu.h help/help_mp-it.h help/help_mp-pl.h help/help_mp...
Author: cboesch Date: Mon Jan 10 20:18:51 2011 New Revision: 32777 Log: Add size based support for -endpos in MPlayer. Modified: trunk/mplayer.c Changes in other areas also in this revision: Modified: trunk/DOCS/man/en/mplayer.1 trunk/help/help_mp-cs.h trunk/help/help_mp-de.h trunk/help/help_mp-en.h trunk/help/help_mp-es.h trunk/help/help_mp-fr.h trunk/help/help_mp-hu.h trunk/help/help_mp-it.h trunk/help/help_mp-pl.h trunk/help/help_mp-ru.h trunk/help/help_mp-tr.h trunk/help/help_mp-uk.h trunk/help/help_mp-zh_CN.h trunk/help/help_mp-zh_TW.h Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Sun Jan 9 21:21:45 2011 (r32776) +++ trunk/mplayer.c Mon Jan 10 20:18:51 2011 (r32777) @@ -3654,11 +3654,6 @@ if (seek_to_sec) { 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; -} - #ifdef CONFIG_DVDNAV mp_dvdnav_context_free(mpctx); if (mpctx->stream->type == STREAMTYPE_DVDNAV) { @@ -3702,7 +3697,8 @@ if(!mpctx->sh_video) { if(!quiet) print_status(a_pos, 0, 0); - if(end_at.type == END_AT_TIME && end_at.pos < a_pos) + if(end_at.type == END_AT_TIME && end_at.pos < a_pos || + end_at.type == END_AT_SIZE && end_at.pos < stream_tell(mpctx->stream)) mpctx->eof = PT_NEXT_ENTRY; update_subtitles(NULL, a_pos, mpctx->d_sub, 0); update_osd_msg(); @@ -3810,10 +3806,9 @@ if(auto_quality>0){ if (play_n_frames <= 0) mpctx->eof = PT_NEXT_ENTRY; } - -// FIXME: add size based support for -endpos - if (end_at.type == END_AT_TIME && - !frame_time_remaining && end_at.pos <= mpctx->sh_video->pts) + if (!frame_time_remaining && + ((end_at.type == END_AT_TIME && mpctx->sh_video->pts >= end_at.pos) || + (end_at.type == END_AT_SIZE && stream_tell(mpctx->stream) >= end_at.pos))) mpctx->eof = PT_NEXT_ENTRY; } // end if(mpctx->sh_video)
On Mon, Jan 10, 2011 at 08:18:52PM +0100, cboesch wrote:
+ end_at.type == END_AT_SIZE && end_at.pos < stream_tell(mpctx->stream))
I just realized one thing: I think this might not behave quite as expected when used with -sb Well, or rather I can't decide which would be the expected behaviour. Maybe you could test it (for both if conditions) and document it?
On Mon, Jan 10, 2011 at 08:29:51PM +0100, Reimar Döffinger wrote:
On Mon, Jan 10, 2011 at 08:18:52PM +0100, cboesch wrote:
+ end_at.type == END_AT_SIZE && end_at.pos < stream_tell(mpctx->stream))
I just realized one thing: I think this might not behave quite as expected when used with -sb Well, or rather I can't decide which would be the expected behaviour. Maybe you could test it (for both if conditions) and document it?
What do you want to say more than "Stop at given time or byte position."? Also, I'm not able to get -sb working correctly :p Btw, -sb seems to be used only to jump a few bytes (no MB for example) so not sure this is really relevant. And finally, -endpos with byte position "may not be accurate" from manpage so… I'm sure we can improve it, but I just ported it from mencoder, so well, it should work just as it is in this one. If you think it's not the correct way to do it, I can revert it. -- Clément B.
On Wed, Jan 12, 2011 at 10:08:12PM +0100, Clément Bœsch wrote:
On Mon, Jan 10, 2011 at 08:29:51PM +0100, Reimar Döffinger wrote:
On Mon, Jan 10, 2011 at 08:18:52PM +0100, cboesch wrote:
+ end_at.type == END_AT_SIZE && end_at.pos < stream_tell(mpctx->stream))
I just realized one thing: I think this might not behave quite as expected when used with -sb Well, or rather I can't decide which would be the expected behaviour. Maybe you could test it (for both if conditions) and document it?
What do you want to say more than "Stop at given time or byte position."?
The only question is "relative to the start of the file or relative to the playback start (as given with -sb or -ss respectively)"?
Also, I'm not able to get -sb working correctly :p
I think it only works with (some?) MPEG formats.
Btw, -sb seems to be used only to jump a few bytes (no MB for example) so not sure this is really relevant.
Huh? It should be possible to use -sb to skip e.g. the first GB.
And finally, -endpos with byte position "may not be accurate" from manpage so…
Well, being off a full GB is more than just "not accurate".
I'm sure we can improve it, but I just ported it from mencoder, so well, it should work just as it is in this one.
Huh? Should be the same for mencoder and MPlayer itself.
On Thu, Jan 13, 2011 at 07:50:52AM +0100, Reimar Döffinger wrote:
On Wed, Jan 12, 2011 at 10:08:12PM +0100, Clément Bœsch wrote:
On Mon, Jan 10, 2011 at 08:29:51PM +0100, Reimar Döffinger wrote:
On Mon, Jan 10, 2011 at 08:18:52PM +0100, cboesch wrote:
+ end_at.type == END_AT_SIZE && end_at.pos < stream_tell(mpctx->stream))
I just realized one thing: I think this might not behave quite as expected when used with -sb Well, or rather I can't decide which would be the expected behaviour. Maybe you could test it (for both if conditions) and document it?
What do you want to say more than "Stop at given time or byte position."?
The only question is "relative to the start of the file or relative to the playback start (as given with -sb or -ss respectively)"?
Patch attached. But you were right, in that state the option is not really consistent. Sorry it took months for the patch… Also, my English is a bit approximative as usual, so feel free to propose a better wording.
Also, I'm not able to get -sb working correctly :p
I think it only works with (some?) MPEG formats.
Indeed.
Btw, -sb seems to be used only to jump a few bytes (no MB for example) so not sure this is really relevant.
Huh? It should be possible to use -sb to skip e.g. the first GB.
-sb does not seem to take any 'b', 'kb', 'gb' units, that's why I said that.
And finally, -endpos with byte position "may not be accurate" from manpage so…
Well, being off a full GB is more than just "not accurate".
Agree :) -- Clément B.
On Sat, Jun 11, 2011 at 05:36:03PM +0200, Clément Bœsch wrote:
Index: DOCS/man/en/mplayer.1 =================================================================== --- DOCS/man/en/mplayer.1 (revision 33579) +++ DOCS/man/en/mplayer.1 (working copy) @@ -1665,7 +1665,7 @@
I'll apply this one in 3 days if no better wording proposition. -- Clément B.
On Sat, Jun 11, 2011 at 05:36:03PM +0200, Clément Bœsch wrote:
--- DOCS/man/en/mplayer.1 (revision 33579) +++ DOCS/man/en/mplayer.1 (working copy) @@ -1665,7 +1665,7 @@ .I NOTE: Byte position may not be accurate, as it can only stop at a frame boundary. When used in conjunction with \-ss option, \-endpos time will shift forward by -seconds specified with \-ss. +seconds specified with \-ss if not a byte position.
OK
@@ -1677,7 +1677,8 @@ .IPs "\-ss 10 \-endpos 56" Stop at 1 minute 6 seconds. .IPs "\-endpos 100mb" -Encode only 100 MB. +Encode 100 MB if mencoder, or stop when reaching "position 100MB" of the input +file if mplayer. .RE .PD 1
I suggest splitting this into two examples, one for MPlayer, one for MEncoder. Diego
On Sun, Jun 12, 2011 at 07:58:52PM +0200, Diego Biurrun wrote:
On Sat, Jun 11, 2011 at 05:36:03PM +0200, Clément Bœsch wrote:
--- DOCS/man/en/mplayer.1 (revision 33579) +++ DOCS/man/en/mplayer.1 (working copy) @@ -1665,7 +1665,7 @@ .I NOTE: Byte position may not be accurate, as it can only stop at a frame boundary. When used in conjunction with \-ss option, \-endpos time will shift forward by -seconds specified with \-ss. +seconds specified with \-ss if not a byte position.
OK
@@ -1677,7 +1677,8 @@ .IPs "\-ss 10 \-endpos 56" Stop at 1 minute 6 seconds. .IPs "\-endpos 100mb" -Encode only 100 MB. +Encode 100 MB if mencoder, or stop when reaching "position 100MB" of the input +file if mplayer. .RE .PD 1
I suggest splitting this into two examples, one for MPlayer, one for MEncoder.
How can this could be consistent with the other examples? Could you be more precise? -- Clément B.
On Fri, Jun 17, 2011 at 03:35:20PM +0200, Clément Bœsch wrote:
On Sun, Jun 12, 2011 at 07:58:52PM +0200, Diego Biurrun wrote:
On Sat, Jun 11, 2011 at 05:36:03PM +0200, Clément Bœsch wrote:
--- DOCS/man/en/mplayer.1 (revision 33579) +++ DOCS/man/en/mplayer.1 (working copy) @@ -1677,7 +1677,8 @@ .IPs "\-ss 10 \-endpos 56" Stop at 1 minute 6 seconds. .IPs "\-endpos 100mb" -Encode only 100 MB. +Encode 100 MB if mencoder, or stop when reaching "position 100MB" of the input +file if mplayer. .RE .PD 1
I suggest splitting this into two examples, one for MPlayer, one for MEncoder.
How can this could be consistent with the other examples? Could you be more precise?
.IPs "mplayer \-endpos 100mb" Stop playback after reading 100MB of the input file. .IPs "mencoder \-endpos 100mb" Encode the first 100MB of the input file. Diego
On Sat, Jun 18, 2011 at 10:33:21PM +0200, Diego Biurrun wrote:
On Fri, Jun 17, 2011 at 03:35:20PM +0200, Clément Bœsch wrote:
On Sun, Jun 12, 2011 at 07:58:52PM +0200, Diego Biurrun wrote:
On Sat, Jun 11, 2011 at 05:36:03PM +0200, Clément Bœsch wrote:
--- DOCS/man/en/mplayer.1 (revision 33579) +++ DOCS/man/en/mplayer.1 (working copy) @@ -1677,7 +1677,8 @@ .IPs "\-ss 10 \-endpos 56" Stop at 1 minute 6 seconds. .IPs "\-endpos 100mb" -Encode only 100 MB. +Encode 100 MB if mencoder, or stop when reaching "position 100MB" of the input +file if mplayer. .RE .PD 1
I suggest splitting this into two examples, one for MPlayer, one for MEncoder.
How can this could be consistent with the other examples? Could you be more precise?
.IPs "mplayer \-endpos 100mb" Stop playback after reading 100MB of the input file.
.IPs "mencoder \-endpos 100mb" Encode the first 100MB of the input file.
Applied slightly differently: I didn't change the mencoder description because I'm actually not sure how to understand it, the original sentence might suggest it applies to the output file. The whole mencoder related stuff need to be clarified somehow in the section; what is related to the input and what is related to the output… -- Clément B.
participants (4)
-
cboesch -
Clément Bœsch -
Diego Biurrun -
Reimar Döffinger