]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparseskeleton.c
caf: fix 'pakt' chunk parsing
[ffmpeg] / libavformat / oggparseskeleton.c
index a3a5f75d15893111243f1e1dc7c395b3f2149be0..62dd14ded15c2e5dbae68d3b6a4360d12af33ed2 100644 (file)
@@ -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)
@@ -33,7 +34,7 @@ static int skeleton_header(AVFormatContext *s, int idx)
     int target_idx, start_time;
 
     strcpy(st->codec->codec_name, "skeleton");
-    st->codec->codec_type = CODEC_TYPE_DATA;
+    st->codec->codec_type = AVMEDIA_TYPE_DATA;
 
     if (os->psize < 8)
         return -1;
@@ -60,8 +61,10 @@ static int skeleton_header(AVFormatContext *s, int idx)
         start_den = AV_RL64(buf+20);
 
         if (start_den) {
-            av_reduce(&start_time, &st->time_base.den, start_num, start_den, INT_MAX);
-            st->time_base.num = 1;
+            int base_den;
+            av_reduce(&start_time, &base_den, start_num, start_den, INT_MAX);
+            avpriv_set_pts_info(st, 64, 1, base_den);
+            os->lastpts =
             st->start_time = start_time;
         }
     } else if (!strncmp(buf, "fisbone", 8)) {
@@ -71,6 +74,7 @@ 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);
         }
     }