Commit 15031b68 authored by michael's avatar michael

Add flag so muxers not needing width/height can signal this.

Add this flag to img2 (fixes -vcodec copy to image2 in some cases)



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21773 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 9a7e1c40
...@@ -242,6 +242,7 @@ typedef struct AVFormatParameters { ...@@ -242,6 +242,7 @@ typedef struct AVFormatParameters {
#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */ #define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
#define AVFMT_TS_DISCONT 0x0200 /**< Format allows timestamp discontinuities. */ #define AVFMT_TS_DISCONT 0x0200 /**< Format allows timestamp discontinuities. */
#define AVFMT_VARIABLE_FPS 0x0400 /**< Format allows variable fps. */ #define AVFMT_VARIABLE_FPS 0x0400 /**< Format allows variable fps. */
#define AVFMT_NODIMENSIONS 0x0800 /**< Format does not need width/height */
typedef struct AVOutputFormat { typedef struct AVOutputFormat {
const char *name; const char *name;
......
...@@ -446,7 +446,7 @@ AVOutputFormat image2_muxer = { ...@@ -446,7 +446,7 @@ AVOutputFormat image2_muxer = {
img_write_header, img_write_header,
img_write_packet, img_write_packet,
NULL, NULL,
.flags= AVFMT_NOTIMESTAMPS | AVFMT_NOFILE .flags= AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS | AVFMT_NOFILE
}; };
#endif #endif
#if CONFIG_IMAGE2PIPE_MUXER #if CONFIG_IMAGE2PIPE_MUXER
...@@ -460,6 +460,6 @@ AVOutputFormat image2pipe_muxer = { ...@@ -460,6 +460,6 @@ AVOutputFormat image2pipe_muxer = {
CODEC_ID_MJPEG, CODEC_ID_MJPEG,
img_write_header, img_write_header,
img_write_packet, img_write_packet,
.flags= AVFMT_NOTIMESTAMPS .flags= AVFMT_NOTIMESTAMPS | AVFMT_NODIMENSIONS
}; };
#endif #endif
...@@ -2546,7 +2546,7 @@ int av_write_header(AVFormatContext *s) ...@@ -2546,7 +2546,7 @@ int av_write_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "time base not set\n"); av_log(s, AV_LOG_ERROR, "time base not set\n");
return -1; return -1;
} }
if(st->codec->width<=0 || st->codec->height<=0){ if((st->codec->width<=0 || st->codec->height<=0) && !(s->oformat->flags & AVFMT_NODIMENSIONS)){
av_log(s, AV_LOG_ERROR, "dimensions not set\n"); av_log(s, AV_LOG_ERROR, "dimensions not set\n");
return -1; return -1;
} }
......
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