[FFmpeg-devel] [PATCH] Add loop option to ffplay

Michael Niedermayer michaelni
Sun Mar 21 18:55:05 CET 2010


On Sun, Mar 21, 2010 at 06:47:43PM +0100, Robert Kr?ger wrote:
> 
> On 21.03.2010, at 16:51, Michael Niedermayer wrote:
> 
> > On Sat, Mar 20, 2010 at 01:58:08PM +0100, Robert Kr?ger wrote:
> >> 
> >> On 20.03.2010, at 12:54, Stefano Sabatini wrote:
> >> 
> >>> On date Saturday 2010-03-20 12:08:32 +0100, Stefano Sabatini encoded:
> >>>> On date Saturday 2010-03-20 08:53:16 +0100, Robert Kr?ger encoded:
> >>>>> 
> >>>>> On 19.03.2010, at 21:07, Michael Niedermayer wrote:
> >>> [...]
> >>>>>> make loop take an argument that specifies how oftten too loop and
> >>>>>> afterwards exist if autoexit is there 
> >>>>>> 
> >>>>> 
> >>>>> and not allow the user to specify to loop indefinitely other than
> >>>>> with a high number?
> >>>> 
> >>>> loop will take a number as argument, when count == loop -> exit if
> >>>> autoexit, a negative value may mean "loop forever", in the latter case
> >>>> autoexit would be just ignored.
> >>> 
> >>> From the mplayer man page:
> >>> -loop <number>
> >>>             Loops movie playback <number> times.  0 means forever.
> >>> 
> >> 
> >> Updated patch attached.
> >> 
> >> Regards,
> >> 
> >> Robert
> >> 
> > 
> >> doc/ffplay-doc.texi |    3 ++-
> >> ffplay.c            |   17 ++++++++++++++---
> >> 2 files changed, 16 insertions(+), 4 deletions(-)
> >> 6bd03cc959fbdfc6d66ab1b1f12854ef3e5b8f61  ffplay-loop-option.patch
> >> Index: ffplay.c
> >> ===================================================================
> >> --- ffplay.c	(revision 22598)
> >> +++ ffplay.c	(working copy)
> >> @@ -260,6 +260,8 @@
> >> static int error_concealment = 3;
> >> static int decoder_reorder_pts= -1;
> >> static int autoexit;
> >> +static int loop= -1;
> >> +static int loop_count= 0;
> >> static int framedrop=1;
> > 
> > why 2 variables?
> > 
> > 
> 
> 
> option 1: Keep mplayer semantics (0 == forever) and keep OPT_INT. That would mean when decrementing the counter to zero, I would add a special case to set it to -1.
> 
> option 2: Kick mplayer semantics, keep OPT_INT  and have -1 mean loop forever
> 
> option 3: Keep mplayer semantics and kick OPT_INT and make it a function that sets it to -1 when 0 is specified as a value. 
> 
> Which one do you prefer?

not 2
otherwise what you think is cleaner

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100321/30aa0b77/attachment.pgp>



More information about the ffmpeg-devel mailing list