diff options
Diffstat (limited to 'libavformat/oggparsedirac.c')
-rw-r--r-- | libavformat/oggparsedirac.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libavformat/oggparsedirac.c b/libavformat/oggparsedirac.c index b0a3796168..74b9ba4f8b 100644 --- a/libavformat/oggparsedirac.c +++ b/libavformat/oggparsedirac.c @@ -1,23 +1,24 @@ /* * Copyright (C) 2008 David Conrad * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" #include "libavcodec/dirac.h" #include "avformat.h" @@ -36,7 +37,7 @@ static int dirac_header(AVFormatContext *s, int idx) if (st->codecpar->codec_id == AV_CODEC_ID_DIRAC) return 0; - ret = av_dirac_parse_sequence_header(&dsh, os->buf + os->pstart + 13, (os->psize - 13) * 8, s); + ret = av_dirac_parse_sequence_header(&dsh, os->buf + os->pstart + 13, (os->psize - 13), s); if (ret < 0) return ret; @@ -51,12 +52,13 @@ static int dirac_header(AVFormatContext *s, int idx) st->codecpar->color_space = dsh->colorspace; st->codecpar->profile = dsh->profile; st->codecpar->level = dsh->level; + if (av_image_check_sar(st->codecpar->width, st->codecpar->height, dsh->sample_aspect_ratio) >= 0) + st->sample_aspect_ratio = dsh->sample_aspect_ratio; // Dirac in Ogg always stores timestamps as though the video were interlaced avpriv_set_pts_info(st, 64, dsh->framerate.den, 2 * dsh->framerate.num); av_freep(&dsh); - return 1; } |