Hi! Attached patch files ticket #6072 for me.
Please comment, Carl Eugen
From ab932a78315ad08fa67590b8d7cd97806c876f54 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos <ceho...@ag.or.at> Date: Wed, 11 Jan 2017 13:23:13 +0100 Subject: [PATCH] lavf/dss: Support version 3 file / file with larger header. Fixes ticket #6072. --- libavformat/dss.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavformat/dss.c b/libavformat/dss.c index 2f7f20d..cbf6e17 100644 --- a/libavformat/dss.c +++ b/libavformat/dss.c @@ -42,7 +42,6 @@ #define DSS_COMMENT_SIZE 64 #define DSS_BLOCK_SIZE 512 -#define DSS_HEADER_SIZE (DSS_BLOCK_SIZE * 2) #define DSS_AUDIO_BLOCK_HEADER_SIZE 6 #define DSS_FRAME_SIZE 42 @@ -56,11 +55,13 @@ typedef struct DSSDemuxContext { int8_t *dss_sp_buf; int packet_size; + int dss_header_size; } DSSDemuxContext; static int dss_probe(AVProbeData *p) { - if (AV_RL32(p->buf) != MKTAG(0x2, 'd', 's', 's')) + if ( AV_RL32(p->buf) != MKTAG(0x2, 'd', 's', 's') + && AV_RL32(p->buf) != MKTAG(0x3, 'd', 's', 's')) return 0; return AVPROBE_SCORE_MAX; @@ -120,12 +121,15 @@ static int dss_read_header(AVFormatContext *s) DSSDemuxContext *ctx = s->priv_data; AVIOContext *pb = s->pb; AVStream *st; - int ret; + int ret, version; st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); + version = avio_r8(pb); + ctx->dss_header_size = version * DSS_BLOCK_SIZE; + ret = dss_read_metadata_string(s, DSS_HEAD_OFFSET_AUTHOR, DSS_AUTHOR_SIZE, "author"); if (ret) @@ -164,7 +168,7 @@ static int dss_read_header(AVFormatContext *s) /* Jump over header */ - if (avio_seek(pb, DSS_HEADER_SIZE, SEEK_SET) != DSS_HEADER_SIZE) + if (avio_seek(pb, ctx->dss_header_size, SEEK_SET) != ctx->dss_header_size) return AVERROR(EIO); ctx->counter = 0; @@ -361,7 +365,7 @@ static int dss_read_seek(AVFormatContext *s, int stream_index, if (seekto < 0) seekto = 0; - seekto += DSS_HEADER_SIZE; + seekto += ctx->dss_header_size; ret = avio_seek(s->pb, seekto, SEEK_SET); if (ret < 0) -- 1.7.10.4
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel