[FFmpeg-cvslog] avplay: Exit by default at the end of playback

Diego Biurrun git at videolan.org
Sat Sep 6 20:34:35 CEST 2014


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Wed Sep  3 00:45:21 2014 +0200| [041caf1a63f091745b95a6d51c23fbdcb604d4ce] | committer: Diego Biurrun

avplay: Exit by default at the end of playback

This is the expected behavior shared by all other cli multimedia players.

Bug-Id: 732

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=041caf1a63f091745b95a6d51c23fbdcb604d4ce
---

 Changelog       |    1 +
 avplay.c        |    6 +++---
 doc/avplay.texi |    4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Changelog b/Changelog
index ae43bcd..bbbe9dc 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
 version <next>:
 - aliases and defaults for Ogg subtypes (opus, spx)
 - HEVC/H.265 RTP payload format (draft v6) depacketizer
+- avplay now exits by default at the end of playback
 
 
 version 11:
diff --git a/avplay.c b/avplay.c
index 816733f..4a7759b 100644
--- a/avplay.c
+++ b/avplay.c
@@ -254,7 +254,7 @@ static enum AVDiscard skip_idct        = AVDISCARD_DEFAULT;
 static enum AVDiscard skip_loop_filter = AVDISCARD_DEFAULT;
 static int error_concealment = 3;
 static int decoder_reorder_pts = -1;
-static int autoexit;
+static int noautoexit;
 static int exit_on_keydown;
 static int exit_on_mousedown;
 static int loop = 1;
@@ -2421,7 +2421,7 @@ static int decode_thread(void *arg)
             if (is->audioq.size + is->videoq.size + is->subtitleq.size == 0) {
                 if (loop != 1 && (!loop || --loop)) {
                     stream_seek(cur_stream, start_time != AV_NOPTS_VALUE ? start_time : 0, 0, 0);
-                } else if (autoexit) {
+                } else if (!noautoexit) {
                     ret = AVERROR_EOF;
                     goto fail;
                 }
@@ -2874,7 +2874,7 @@ static const OptionDef options[] = {
     { "idct", OPT_INT | HAS_ARG | OPT_EXPERT, { &idct }, "set idct algo",  "algo" },
     { "ec", OPT_INT | HAS_ARG | OPT_EXPERT, { &error_concealment }, "set error concealment options",  "bit_mask" },
     { "sync", HAS_ARG | OPT_EXPERT, { .func_arg = opt_sync }, "set audio-video sync. type (type=audio/video/ext)", "type" },
-    { "autoexit", OPT_BOOL | OPT_EXPERT, { &autoexit }, "exit at the end", "" },
+    { "noautoexit", OPT_BOOL | OPT_EXPERT, { &noautoexit }, "Do not exit at the end of playback", "" },
     { "exitonkeydown", OPT_BOOL | OPT_EXPERT, { &exit_on_keydown }, "exit on key down", "" },
     { "exitonmousedown", OPT_BOOL | OPT_EXPERT, { &exit_on_mousedown }, "exit on mouse down", "" },
     { "loop", OPT_INT | HAS_ARG | OPT_EXPERT, { &loop }, "set number of times the playback shall be looped", "loop count" },
diff --git a/doc/avplay.texi b/doc/avplay.texi
index 71981f6..d526213 100644
--- a/doc/avplay.texi
+++ b/doc/avplay.texi
@@ -109,8 +109,8 @@ Select the desired subtitle stream number, counting from 0. The number
 refers to the list of all the input subtitle streams. If it is greater
 than the number of subtitle streams minus one, then the last one is
 selected, if it is negative the subtitle rendering is disabled.
- at item -autoexit
-Exit when video is done playing.
+ at item -noautoexit
+Do not exit after playback is finished.
 @item -exitonkeydown
 Exit if any key is pressed.
 @item -exitonmousedown



More information about the ffmpeg-cvslog mailing list