]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/thp.c
avio: rename ByteIOContext to AVIOContext.
[ffmpeg] / libavformat / thp.c
index a7403a60bc5123e9eb44bc4d364f6bd3131b143f..b6e7ae2f4a4eba47f248c8c2e780b341e6fb154e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * THP Demuxer
- * Copyright (c) 2007 Marco Gerards.
+ * Copyright (c) 2007 Marco Gerards
  *
  * This file is part of FFmpeg.
  *
@@ -19,9 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-
+#include "libavutil/intreadwrite.h"
 #include "avformat.h"
-#include "allformats.h"
 
 typedef struct ThpDemuxContext {
     int              version;
@@ -58,7 +57,7 @@ static int thp_read_header(AVFormatContext *s,
 {
     ThpDemuxContext *thp = s->priv_data;
     AVStream *st;
-    ByteIOContext *pb = &s->pb;
+    AVIOContext *pb = s->pb;
     int i;
 
     /* Read the file header.  */
@@ -96,12 +95,12 @@ static int thp_read_header(AVFormatContext *s,
             /* Video component.  */
             st = av_new_stream(s, 0);
             if (!st)
-                return AVERROR_NOMEM;
+                return AVERROR(ENOMEM);
 
             /* The denominator and numerator are switched because 1/fps
                is required.  */
             av_set_pts_info(st, 64, thp->fps.den, thp->fps.num);
-            st->codec->codec_type = CODEC_TYPE_VIDEO;
+            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
             st->codec->codec_id = CODEC_ID_THP;
             st->codec->codec_tag = 0;  /* no fourcc */
             st->codec->width = get_be32(pb);
@@ -119,9 +118,9 @@ static int thp_read_header(AVFormatContext *s,
             /* Audio component.  */
             st = av_new_stream(s, 0);
             if (!st)
-                return AVERROR_NOMEM;
+                return AVERROR(ENOMEM);
 
-            st->codec->codec_type = CODEC_TYPE_AUDIO;
+            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
             st->codec->codec_id = CODEC_ID_ADPCM_THP;
             st->codec->codec_tag = 0;  /* no fourcc */
             st->codec->channels    = get_be32(pb); /* numChannels.  */
@@ -141,14 +140,14 @@ static int thp_read_packet(AVFormatContext *s,
                             AVPacket *pkt)
 {
     ThpDemuxContext *thp = s->priv_data;
-    ByteIOContext *pb = &s->pb;
+    AVIOContext *pb = s->pb;
     int size;
     int ret;
 
     if (thp->audiosize == 0) {
         /* Terminate when last frame is reached.  */
         if (thp->frame >= thp->framecnt)
-            return AVERROR_IO;
+            return AVERROR(EIO);
 
         url_fseek(pb, thp->next_frame, SEEK_SET);
 
@@ -169,7 +168,7 @@ static int thp_read_packet(AVFormatContext *s,
         ret = av_get_packet(pb, pkt, size);
         if (ret != size) {
             av_free_packet(pkt);
-            return AVERROR_IO;
+            return AVERROR(EIO);
         }
 
         pkt->stream_index = thp->video_stream_index;
@@ -177,7 +176,7 @@ static int thp_read_packet(AVFormatContext *s,
         ret = av_get_packet(pb, pkt, thp->audiosize);
         if (ret != thp->audiosize) {
             av_free_packet(pkt);
-            return AVERROR_IO;
+            return AVERROR(EIO);
         }
 
         pkt->stream_index = thp->audio_stream_index;
@@ -188,9 +187,9 @@ static int thp_read_packet(AVFormatContext *s,
     return 0;
 }
 
-AVInputFormat thp_demuxer = {
+AVInputFormat ff_thp_demuxer = {
     "thp",
-    "THP",
+    NULL_IF_CONFIG_SMALL("THP"),
     sizeof(ThpDemuxContext),
     thp_probe,
     thp_read_header,