comparison img2.c @ 1175:8b53c0f3e7ad libavformat

add loop_input to AVFormatContext, getting rid of old hack patch by Vctor Paesa <wzrlpy at arsystel com>
author mru
date Thu, 13 Jul 2006 21:13:49 +0000
parents d18cc9a1fd02
children 185190bdc185
comparison
equal deleted inserted replaced
1174:1c9ddfd961d6 1175:8b53c0f3e7ad
17 * License along with this library; if not, write to the Free Software 17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20 #include "avformat.h" 20 #include "avformat.h"
21 21
22 /* XXX: this is a hack */
23 extern int loop_input;
24
25 typedef struct { 22 typedef struct {
26 int img_first; 23 int img_first;
27 int img_last; 24 int img_last;
28 int img_number; 25 int img_number;
29 int img_count; 26 int img_count;
234 ByteIOContext f1[3], *f[3]= {&f1[0], &f1[1], &f1[2]}; 231 ByteIOContext f1[3], *f[3]= {&f1[0], &f1[1], &f1[2]};
235 AVCodecContext *codec= s1->streams[0]->codec; 232 AVCodecContext *codec= s1->streams[0]->codec;
236 233
237 if (!s->is_pipe) { 234 if (!s->is_pipe) {
238 /* loop over input */ 235 /* loop over input */
239 if (loop_input && s->img_number > s->img_last) { 236 if (s1->loop_input && s->img_number > s->img_last) {
240 s->img_number = s->img_first; 237 s->img_number = s->img_first;
241 } 238 }
242 if (get_frame_filename(filename, sizeof(filename), 239 if (get_frame_filename(filename, sizeof(filename),
243 s->path, s->img_number)<0 && s->img_number > 1) 240 s->path, s->img_number)<0 && s->img_number > 1)
244 return AVERROR_IO; 241 return AVERROR_IO;