On Sun, 18 Aug 2013, Luca Barbato wrote:
Do not ignore them. --- libavformat/movenc.c | 2 ++ 1 file changed, 2 insertions(+)diff --git a/libavformat/movenc.c b/libavformat/movenc.c index f5b8cc9..fd689be 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -3139,6 +3139,8 @@ static int mov_write_header(AVFormatContext *s) } } else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) { track->timescale = st->codec->time_base.den; + } else if (st->codec->codec_type == AVMEDIA_TYPE_DATA) { + track->timescale = st->codec->time_base.den; } if (!track->height) track->height = st->codec->height; -- 1.8.3.2
This looks good. What about adding an else case that returns an error for all other unknown/unhandled AVMEDIA types? Or alternatively just set the timescale based on time_base for them as well?
Either of them is better than allowing timescale to remain unset - it doesn't make sense to try to mux packets in a track without a timescale (that'd be the same as if time_base wasn't set).
If we do either of these, patch 2/3 shouldn't be necessary, right? (Otherwise if we go for doing the check as in 2/3, we might need to add a number of other checks around the muxer as well.)
// Martin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
