X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Foggparseskeleton.c;h=5333e17de693de1248af2d5b477d64a652f9d491;hb=99143140dea12363af680d02e23cb42cfe191679;hp=e318e9e7188f41652a43d7d7ecd3ddad24c769df;hpb=69ff14920429c9e128a8bcf65ce3f4b4aa93f3d1;p=ffmpeg diff --git a/libavformat/oggparseskeleton.c b/libavformat/oggparseskeleton.c index e318e9e7188..5333e17de69 100644 --- a/libavformat/oggparseskeleton.c +++ b/libavformat/oggparseskeleton.c @@ -1,25 +1,26 @@ /* * Copyright (C) 2010 David Conrad * - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav 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. * - * FFmpeg is distributed in the hope that it will be useful, + * Libav 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 FFmpeg; if not, write to the Free Software + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavcodec/bytestream.h" #include "avformat.h" +#include "internal.h" #include "oggdec.h" static int skeleton_header(AVFormatContext *s, int idx) @@ -29,10 +30,10 @@ static int skeleton_header(AVFormatContext *s, int idx) AVStream *st = s->streams[idx]; uint8_t *buf = os->buf + os->pstart; int version_major, version_minor; - int64_t start_num, start_den, start_granule; + int64_t start_num, start_den; + uint64_t start_granule; int target_idx, start_time; - strcpy(st->codec->codec_name, "skeleton"); st->codec->codec_type = AVMEDIA_TYPE_DATA; if (os->psize < 8) @@ -62,7 +63,7 @@ static int skeleton_header(AVFormatContext *s, int idx) if (start_den) { int base_den; av_reduce(&start_time, &base_den, start_num, start_den, INT_MAX); - av_set_pts_info(st, 64, 1, base_den); + avpriv_set_pts_info(st, 64, 1, base_den); os->lastpts = st->start_time = start_time; } @@ -72,9 +73,13 @@ static int skeleton_header(AVFormatContext *s, int idx) target_idx = ogg_find_stream(ogg, AV_RL32(buf+12)); start_granule = AV_RL64(buf+36); - if (target_idx >= 0 && start_granule != -1) { - ogg->streams[target_idx].lastpts = - s->streams[target_idx]->start_time = ogg_gptopts(s, target_idx, start_granule, NULL); + if (os->start_granule != OGG_NOGRANULE_VALUE) { + avpriv_report_missing_feature(s, + "Multiple fisbone for the same stream"); + return 1; + } + if (target_idx >= 0 && start_granule != OGG_NOGRANULE_VALUE) { + os->start_granule = start_granule; } } @@ -85,4 +90,5 @@ const struct ogg_codec ff_skeleton_codec = { .magic = "fishead", .magicsize = 8, .header = skeleton_header, + .nb_header = 0, };