Commit 6a927d7a authored by Anton Khirnov's avatar Anton Khirnov
Browse files

output example: use a macro instead of a static variable

parent 63fd0d86
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE)) #define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
#define STREAM_PIX_FMT AV_PIX_FMT_YUV420P /* default pix_fmt */ #define STREAM_PIX_FMT AV_PIX_FMT_YUV420P /* default pix_fmt */
static int sws_flags = SWS_BICUBIC; #define SCALE_FLAGS SWS_BICUBIC
// a wrapper around a single output AVStream // a wrapper around a single output AVStream
typedef struct OutputStream { typedef struct OutputStream {
...@@ -344,7 +344,7 @@ static void write_video_frame(AVFormatContext *oc, OutputStream *ost) ...@@ -344,7 +344,7 @@ static void write_video_frame(AVFormatContext *oc, OutputStream *ost)
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P,
c->width, c->height, c->width, c->height,
c->pix_fmt, c->pix_fmt,
sws_flags, NULL, NULL, NULL); SCALE_FLAGS, NULL, NULL, NULL);
if (img_convert_ctx == NULL) { if (img_convert_ctx == NULL) {
fprintf(stderr, fprintf(stderr,
"Cannot initialize the conversion context\n"); "Cannot initialize the conversion context\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment