Browse code

add loop_input to AVFormatContext, getting rid of old hack patch by Víctor Paesa <wzrlpy at arsystel com>

Originally committed as revision 5729 to svn://svn.ffmpeg.org/ffmpeg/trunk

Víctor Paesa authored on 2006/07/14 06:13:49
Showing 4 changed files
... ...
@@ -159,7 +159,7 @@ static int me_penalty_compensation= 256;
159 159
 static int frame_skip_threshold= 0;
160 160
 static int frame_skip_factor= 0;
161 161
 static int frame_skip_exp= 0;
162
-extern int loop_input; /* currently a hack */
162
+static int loop_input = 0;
163 163
 static int loop_output = AVFMT_NOOUTPUTLOOP;
164 164
 static int genpts = 0;
165 165
 static int qp_hist = 0;
... ...
@@ -2843,6 +2843,8 @@ static void opt_input_file(const char *filename)
2843 2843
         exit(1);
2844 2844
     }
2845 2845
 
2846
+    ic->loop_input = loop_input;
2847
+
2846 2848
     if(genpts)
2847 2849
         ic->flags|= AVFMT_FLAG_GENPTS;
2848 2850
 
... ...
@@ -5,8 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-#define LIBAVFORMAT_VERSION_INT ((50<<16)+(4<<8)+0)
9
-#define LIBAVFORMAT_VERSION     50.4.0
8
+#define LIBAVFORMAT_VERSION_INT ((50<<16)+(5<<8)+0)
9
+#define LIBAVFORMAT_VERSION     50.5.0
10 10
 #define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
11 11
 
12 12
 #define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
... ...
@@ -337,6 +337,8 @@ typedef struct AVFormatContext {
337 337
 
338 338
     int flags;
339 339
 #define AVFMT_FLAG_GENPTS       0x0001 ///< generate pts if missing even if it requires parsing future frames
340
+
341
+    int loop_input;
340 342
 } AVFormatContext;
341 343
 
342 344
 typedef struct AVPacketList {
... ...
@@ -18,9 +18,6 @@
18 18
  */
19 19
 #include "avformat.h"
20 20
 
21
-/* XXX: this is a hack */
22
-int loop_input = 0;
23
-
24 21
 typedef struct {
25 22
     int width;
26 23
     int height;
... ...
@@ -200,7 +197,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
200 200
 
201 201
     if (!s->is_pipe) {
202 202
         /* loop over input */
203
-        if (loop_input && s->img_number > s->img_last) {
203
+        if (s1->loop_input && s->img_number > s->img_last) {
204 204
             s->img_number = s->img_first;
205 205
         }
206 206
         if (get_frame_filename(filename, sizeof(filename),
... ...
@@ -19,9 +19,6 @@
19 19
  */
20 20
 #include "avformat.h"
21 21
 
22
-/* XXX: this is a hack */
23
-extern int loop_input;
24
-
25 22
 typedef struct {
26 23
     int img_first;
27 24
     int img_last;
... ...
@@ -236,7 +233,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
236 236
 
237 237
     if (!s->is_pipe) {
238 238
         /* loop over input */
239
-        if (loop_input && s->img_number > s->img_last) {
239
+        if (s1->loop_input && s->img_number > s->img_last) {
240 240
             s->img_number = s->img_first;
241 241
         }
242 242
         if (get_frame_filename(filename, sizeof(filename),