[FFmpeg-cvslog] lavf: Set the stream time base hint properly for chained muxers
Martin Storsjö
git at videolan.org
Tue Oct 7 03:07:55 CEST 2014
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon Oct 6 11:41:33 2014 +0300| [28816050e47b6dba430a52e429d21a864cffda8e] | committer: Martin Storsjö
lavf: Set the stream time base hint properly for chained muxers
This avoids warnings about using the codec time base as time
base hint.
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=28816050e47b6dba430a52e429d21a864cffda8e
---
libavformat/hdsenc.c | 1 +
libavformat/hlsenc.c | 1 +
libavformat/mpegtsenc.c | 1 +
libavformat/segment.c | 1 +
libavformat/smoothstreamingenc.c | 1 +
5 files changed, 5 insertions(+)
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c
index 882f157..53fef33 100644
--- a/libavformat/hdsenc.c
+++ b/libavformat/hdsenc.c
@@ -398,6 +398,7 @@ static int hds_write_header(AVFormatContext *s)
}
avcodec_copy_context(st->codec, s->streams[i]->codec);
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
+ st->time_base = s->streams[i]->time_base;
}
if (c->streams[c->nb_streams].ctx)
c->nb_streams++;
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 5d18d13..ad53df5 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -80,6 +80,7 @@ static int hls_mux_init(AVFormatContext *s)
return AVERROR(ENOMEM);
avcodec_copy_context(st->codec, s->streams[i]->codec);
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
+ st->time_base = s->streams[i]->time_base;
}
return 0;
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 7621103..1082650 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -604,6 +604,7 @@ static int mpegts_write_header(AVFormatContext *s)
ret = avcodec_copy_context(ast->codec, st->codec);
if (ret != 0)
goto fail;
+ ast->time_base = st->time_base;
ret = avformat_write_header(ts_st->amux, NULL);
if (ret < 0)
goto fail;
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 9c757e4..52da6b9 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -74,6 +74,7 @@ static int segment_mux_init(AVFormatContext *s)
return AVERROR(ENOMEM);
avcodec_copy_context(st->codec, s->streams[i]->codec);
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
+ st->time_base = s->streams[i]->time_base;
}
return 0;
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index d955b343..b9f1dcb 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -342,6 +342,7 @@ static int ism_write_header(AVFormatContext *s)
}
avcodec_copy_context(st->codec, s->streams[i]->codec);
st->sample_aspect_ratio = s->streams[i]->sample_aspect_ratio;
+ st->time_base = s->streams[i]->time_base;
ctx->pb = avio_alloc_context(os->iobuf, sizeof(os->iobuf), AVIO_FLAG_WRITE, os, NULL, ism_write, ism_seek);
if (!ctx->pb) {
More information about the ffmpeg-cvslog
mailing list