]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/thp.c
Add '#undef rand' to fix test program build.
[ffmpeg] / libavformat / thp.c
index 7f9a8881ca49c9b0f276692aa6ff36f0e104dc9d..a5c9476d1ad78012c6cf5cc6257f08ce76d2f89e 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;
+    ByteIOContext *pb = s->pb;
     int i;
 
     /* Read the file header.  */
@@ -141,14 +140,14 @@ static int thp_read_packet(AVFormatContext *s,
                             AVPacket *pkt)
 {
     ThpDemuxContext *thp = s->priv_data;
-    ByteIOContext *pb = &s->pb;
+    ByteIOContext *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;
@@ -190,7 +189,7 @@ static int thp_read_packet(AVFormatContext *s,
 
 AVInputFormat thp_demuxer = {
     "thp",
-    "THP",
+    NULL_IF_CONFIG_SMALL("THP"),
     sizeof(ThpDemuxContext),
     thp_probe,
     thp_read_header,