aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2010-12-27 07:46:44 +0000
committerAnton Khirnov <wyskas@gmail.com>2010-12-27 07:46:44 +0000
commitbb62d5c1f06e7ff0446abb9cbe6a102cdbd38cc0 (patch)
treec0b31fbd2963a2cefa446c54b011b8e49ca550d9 /libavformat/utils.c
parent18f1add31c93940359086465825adada99bd6bc9 (diff)
downloadffmpeg-bb62d5c1f06e7ff0446abb9cbe6a102cdbd38cc0.tar.gz
Allow output formats without any streams.
Required for future metadata format. Originally committed as revision 26100 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 58e06e8688..e9a8099c95 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2709,7 +2709,7 @@ int av_write_header(AVFormatContext *s)
AVStream *st;
// some sanity checks
- if (s->nb_streams == 0) {
+ if (s->nb_streams == 0 && !(s->oformat->flags & AVFMT_NOSTREAMS)) {
av_log(s, AV_LOG_ERROR, "no streams\n");
return AVERROR(EINVAL);
}
@@ -2777,7 +2777,7 @@ int av_write_header(AVFormatContext *s)
#endif
/* set muxer identification string */
- if (!(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
+ if (s->nb_streams && !(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
av_metadata_set2(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0);
}