From 40393ac568db345b0388e1c99fc89f41a5b08037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Sat, 24 Mar 2012 21:36:51 +0100 Subject: [PATCH] movenc: add some default cases. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes crashes when copying a data track as in trac issue #236. No proper timecode tracks will be written though. Signed-off-by: Reimar Döffinger --- libavformat/movenc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 7c1c559d7e..dd14a08907 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1316,6 +1316,10 @@ static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track) } else if (track->enc->codec_tag == MKTAG('r','t','p',' ')) { hdlr_type = "hint"; descr = "HintHandler"; + } else { + hdlr = "dhlr"; + hdlr_type = "url "; + descr = "DataHandler"; } } @@ -3207,6 +3211,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{ + track->timescale = MOV_TIMESCALE; } if (!track->height) track->height = st->codec->height;