]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mm.c
remove useless close function
[ffmpeg] / libavformat / mm.c
index a7a67e9f00137cca247a4e1bf8693136bf84abbb..4e6bac0271a670d3710c952dff6c361dec7184f0 100644 (file)
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /**
@@ -71,8 +71,8 @@ static int mm_probe(AVProbeData *p)
 static int mm_read_header(AVFormatContext *s,
                            AVFormatParameters *ap)
 {
-    MmDemuxContext *mm = (MmDemuxContext *)s->priv_data;
-    ByteIOContext *pb = &s->pb;
+    MmDemuxContext *mm = s->priv_data;
+    ByteIOContext *pb = s->pb;
     AVStream *st;
 
     unsigned int type, length;
@@ -95,7 +95,7 @@ static int mm_read_header(AVFormatContext *s,
     /* video stream */
     st = av_new_stream(s, 0);
     if (!st)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     st->codec->codec_type = CODEC_TYPE_VIDEO;
     st->codec->codec_id = CODEC_ID_MMVIDEO;
     st->codec->codec_tag = 0;  /* no fourcc */
@@ -108,7 +108,7 @@ static int mm_read_header(AVFormatContext *s,
     if (length == MM_HEADER_LEN_AV) {
         st = av_new_stream(s, 0);
         if (!st)
-            return AVERROR_NOMEM;
+            return AVERROR(ENOMEM);
         st->codec->codec_type = CODEC_TYPE_AUDIO;
         st->codec->codec_tag = 0; /* no fourcc */
         st->codec->codec_id = CODEC_ID_PCM_U8;
@@ -126,8 +126,8 @@ static int mm_read_header(AVFormatContext *s,
 static int mm_read_packet(AVFormatContext *s,
                            AVPacket *pkt)
 {
-    MmDemuxContext *mm = (MmDemuxContext *)s->priv_data;
-    ByteIOContext *pb = &s->pb;
+    MmDemuxContext *mm = s->priv_data;
+    ByteIOContext *pb = s->pb;
     unsigned char preamble[MM_PREAMBLE_SIZE];
     unsigned char pal[MM_PALETTE_SIZE];
     unsigned int type, length;
@@ -136,7 +136,7 @@ static int mm_read_packet(AVFormatContext *s,
     while(1) {
 
         if (get_buffer(pb, preamble, MM_PREAMBLE_SIZE) != MM_PREAMBLE_SIZE) {
-            return AVERROR_IO;
+            return AVERROR(EIO);
         }
 
         type = AV_RL16(&preamble[0]);
@@ -146,7 +146,7 @@ static int mm_read_packet(AVFormatContext *s,
         case MM_TYPE_PALETTE :
             url_fseek(pb, 4, SEEK_CUR);  /* unknown data */
             if (get_buffer(pb, pal, MM_PALETTE_SIZE) != MM_PALETTE_SIZE)
-                return AVERROR_IO;
+                return AVERROR(EIO);
             url_fseek(pb, length - (4 + MM_PALETTE_SIZE), SEEK_CUR);
 
             for (i=0; i<MM_PALETTE_COUNT; i++) {
@@ -168,18 +168,18 @@ static int mm_read_packet(AVFormatContext *s,
         case MM_TYPE_INTER_HHV :
             /* output preamble + data */
             if (av_new_packet(pkt, length + MM_PREAMBLE_SIZE))
-                return AVERROR_NOMEM;
+                return AVERROR(ENOMEM);
             memcpy(pkt->data, preamble, MM_PREAMBLE_SIZE);
             if (get_buffer(pb, pkt->data + MM_PREAMBLE_SIZE, length) != length)
-                return AVERROR_IO;
+                return AVERROR(EIO);
             pkt->size = length + MM_PREAMBLE_SIZE;
             pkt->stream_index = 0;
             pkt->pts = mm->video_pts++;
             return 0;
 
         case MM_TYPE_AUDIO :
-            if (av_get_packet(&s->pb, pkt, length)<0)
-                return AVERROR_NOMEM;
+            if (av_get_packet(s->pb, pkt, length)<0)
+                return AVERROR(ENOMEM);
             pkt->size = length;
             pkt->stream_index = 1;
             pkt->pts = mm->audio_pts++;