summaryrefslogtreecommitdiff
path: root/libavformat/img2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-07-09 02:06:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-07-09 02:06:40 +0200
commit58257ea29e0716a50dc742959de876606ed22416 (patch)
treea4949244816d4eb7a4231b1798b54bea4a79d4e5 /libavformat/img2.c
parent971c04066c601bdd38ed5e8eb585d2f5ba211fe2 (diff)
parentbda168d2b0210dda84f1a9d32c8aa4653d1674d5 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (28 commits) mp3enc: write a xing frame containing number of frames in the file lavf: update AVStream.nb_frames when muxing. ffmpeg: remove unused variables from InputStream. doc: update ffmpeg -ar and -ac documentation to reflect reality. ffmpeg: remove pointless if (nb_input_files) ffmpeg: merge input_files_ts_offset into input_files. ffmpeg: merge input_codecs into input_streams. ffmpeg: drop AV prefixes from struct names. ffmpeg: deprecate loop_input and loop_output options gif: add loop private option. img2: add loop private option. AVOptions: in av_opt_find() don't return named constants unless unit is specified. x11grab: replace undocumented nomouse hackery with a private option. dict: extend documentation. lls: whitespace cosmetics docs: Use proper markup for a literal command line option docs: Remove a remark that isn't relevant any longer docs: Explain how to regenerate import libraries with MSVC tools docs: Mention that libraries for MSVC can be built with a cross compiler docs: Remove old docs that mention setting up a build environment with lib.exe ... Conflicts: doc/ffmpeg.texi doc/general.texi ffmpeg.c libavcodec/Makefile libavcodec/dnxhddata.c libavformat/mp3enc.c libavformat/utils.c libavutil/Makefile tests/copycooker.sh Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/img2.c')
-rw-r--r--libavformat/img2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/img2.c b/libavformat/img2.c
index ca391aa1bb..0531a1a8de 100644
--- a/libavformat/img2.c
+++ b/libavformat/img2.c
@@ -43,6 +43,7 @@ typedef struct {
char *pixel_format; /**< Set by a private option. */
char *video_size; /**< Set by a private option. */
char *framerate; /**< Set by a private option. */
+ int loop;
} VideoData;
typedef struct {
@@ -247,6 +248,11 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap)
framerate = (AVRational){ap->time_base.den, ap->time_base.num};
#endif
+#if FF_API_LOOP_INPUT
+ if (s1->loop_input)
+ s->loop = s1->loop_input;
+#endif
+
av_strlcpy(s->path, s1->filename, sizeof(s->path));
s->img_number = 0;
s->img_count = 0;
@@ -306,7 +312,7 @@ static int read_packet(AVFormatContext *s1, AVPacket *pkt)
if (!s->is_pipe) {
/* loop over input */
- if (s1->loop_input && s->img_number > s->img_last) {
+ if (s->loop && s->img_number > s->img_last) {
s->img_number = s->img_first;
}
if (s->img_number > s->img_last)
@@ -467,6 +473,7 @@ static const AVOption options[] = {
{ "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "video_size", "", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
+ { "loop", "", OFFSET(loop), FF_OPT_TYPE_INT, {.dbl = 0}, 0, 1, DEC },
{ NULL },
};