]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/vc1test.c
Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
[ffmpeg] / libavformat / vc1test.c
index e127941a35a29473051ab1e2cb1054df631c635c..1414426d02b1f6ca6bcc9247c2d3e04ccbc19252 100644 (file)
@@ -2,20 +2,20 @@
  * VC1 Test Bitstreams Format Demuxer
  * Copyright (c) 2006, 2008 Konstantin Shishkov
  *
- * 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
  */
 
@@ -61,11 +61,8 @@ static int vc1t_read_header(AVFormatContext *s)
     st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
     st->codecpar->codec_id = AV_CODEC_ID_WMV3;
 
-    st->codecpar->extradata = av_malloc(VC1_EXTRADATA_SIZE);
-    if (!st->codecpar->extradata)
+    if (ff_get_extradata(st->codecpar, pb, VC1_EXTRADATA_SIZE) < 0)
         return AVERROR(ENOMEM);
-    st->codecpar->extradata_size = VC1_EXTRADATA_SIZE;
-    avio_read(pb, st->codecpar->extradata, VC1_EXTRADATA_SIZE);
     st->codecpar->height = avio_rl32(pb);
     st->codecpar->width = avio_rl32(pb);
     if(avio_rl32(pb) != 0xC)
@@ -94,7 +91,7 @@ static int vc1t_read_packet(AVFormatContext *s,
     int keyframe = 0;
     uint32_t pts;
 
-    if(pb->eof_reached)
+    if(avio_feof(pb))
         return AVERROR(EIO);
 
     frame_size = avio_rl24(pb);