mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
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
This commit is contained in:
parent
2645e80f6d
commit
5894e1bbf2
4
ffmpeg.c
4
ffmpeg.c
@ -159,7 +159,7 @@ static int me_penalty_compensation= 256;
|
|||||||
static int frame_skip_threshold= 0;
|
static int frame_skip_threshold= 0;
|
||||||
static int frame_skip_factor= 0;
|
static int frame_skip_factor= 0;
|
||||||
static int frame_skip_exp= 0;
|
static int frame_skip_exp= 0;
|
||||||
extern int loop_input; /* currently a hack */
|
static int loop_input = 0;
|
||||||
static int loop_output = AVFMT_NOOUTPUTLOOP;
|
static int loop_output = AVFMT_NOOUTPUTLOOP;
|
||||||
static int genpts = 0;
|
static int genpts = 0;
|
||||||
static int qp_hist = 0;
|
static int qp_hist = 0;
|
||||||
@ -2843,6 +2843,8 @@ static void opt_input_file(const char *filename)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ic->loop_input = loop_input;
|
||||||
|
|
||||||
if(genpts)
|
if(genpts)
|
||||||
ic->flags|= AVFMT_FLAG_GENPTS;
|
ic->flags|= AVFMT_FLAG_GENPTS;
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define LIBAVFORMAT_VERSION_INT ((50<<16)+(4<<8)+0)
|
#define LIBAVFORMAT_VERSION_INT ((50<<16)+(5<<8)+0)
|
||||||
#define LIBAVFORMAT_VERSION 50.4.0
|
#define LIBAVFORMAT_VERSION 50.5.0
|
||||||
#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
|
#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
|
||||||
|
|
||||||
#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
|
#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
|
||||||
@ -337,6 +337,8 @@ typedef struct AVFormatContext {
|
|||||||
|
|
||||||
int flags;
|
int flags;
|
||||||
#define AVFMT_FLAG_GENPTS 0x0001 ///< generate pts if missing even if it requires parsing future frames
|
#define AVFMT_FLAG_GENPTS 0x0001 ///< generate pts if missing even if it requires parsing future frames
|
||||||
|
|
||||||
|
int loop_input;
|
||||||
} AVFormatContext;
|
} AVFormatContext;
|
||||||
|
|
||||||
typedef struct AVPacketList {
|
typedef struct AVPacketList {
|
||||||
|
@ -18,9 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
|
|
||||||
/* XXX: this is a hack */
|
|
||||||
int loop_input = 0;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
@ -200,7 +197,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
|
|||||||
|
|
||||||
if (!s->is_pipe) {
|
if (!s->is_pipe) {
|
||||||
/* loop over input */
|
/* loop over input */
|
||||||
if (loop_input && s->img_number > s->img_last) {
|
if (s1->loop_input && s->img_number > s->img_last) {
|
||||||
s->img_number = s->img_first;
|
s->img_number = s->img_first;
|
||||||
}
|
}
|
||||||
if (get_frame_filename(filename, sizeof(filename),
|
if (get_frame_filename(filename, sizeof(filename),
|
||||||
|
@ -19,9 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
|
|
||||||
/* XXX: this is a hack */
|
|
||||||
extern int loop_input;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int img_first;
|
int img_first;
|
||||||
int img_last;
|
int img_last;
|
||||||
@ -236,7 +233,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt)
|
|||||||
|
|
||||||
if (!s->is_pipe) {
|
if (!s->is_pipe) {
|
||||||
/* loop over input */
|
/* loop over input */
|
||||||
if (loop_input && s->img_number > s->img_last) {
|
if (s1->loop_input && s->img_number > s->img_last) {
|
||||||
s->img_number = s->img_first;
|
s->img_number = s->img_first;
|
||||||
}
|
}
|
||||||
if (get_frame_filename(filename, sizeof(filename),
|
if (get_frame_filename(filename, sizeof(filename),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user