]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/electronicarts.c
spelling/grammar
[ffmpeg] / libavformat / electronicarts.c
index f9fbfef78cbff53f3f0dba1d08a5adce7ae5b124..871a2f75fe42f23255e07680068912a45c826739 100644 (file)
@@ -1,18 +1,20 @@
 /* Electronic Arts Multimedia File Demuxer
  * Copyright (c) 2004  The ffmpeg Project
  *
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * 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 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
  *
- * This library 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 this library; 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
  */
 
@@ -78,7 +80,7 @@ static uint32_t read_arbitary(ByteIOContext *pb) {
 static int process_ea_header(AVFormatContext *s) {
     int inHeader;
     uint32_t blockid, size;
-    EaDemuxContext *ea = (EaDemuxContext *)s->priv_data;
+    EaDemuxContext *ea = s->priv_data;
     ByteIOContext *pb = &s->pb;
 
     if (get_buffer(pb, (void*)&blockid, 4) != 4) {
@@ -163,10 +165,7 @@ static int process_ea_header(AVFormatContext *s) {
 
 static int ea_probe(AVProbeData *p)
 {
-    if (p->buf_size < 4)
-        return 0;
-
-    if (LE_32(&p->buf[0]) != SCHl_TAG)
+    if (AV_RL32(&p->buf[0]) != SCHl_TAG)
         return 0;
 
     return AVPROBE_SCORE_MAX;
@@ -175,17 +174,17 @@ static int ea_probe(AVProbeData *p)
 static int ea_read_header(AVFormatContext *s,
                           AVFormatParameters *ap)
 {
-    EaDemuxContext *ea = (EaDemuxContext *)s->priv_data;
+    EaDemuxContext *ea = s->priv_data;
     AVStream *st;
 
     if (!process_ea_header(s))
-        return AVERROR_IO;
+        return AVERROR(EIO);
 
 #if 0
     /* initialize the video decoder stream */
     st = av_new_stream(s, 0);
     if (!st)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     av_set_pts_info(st, 33, 1, 90000);
     ea->video_stream_index = st->index;
     st->codec->codec_type = CODEC_TYPE_VIDEO;
@@ -196,7 +195,7 @@ static int ea_read_header(AVFormatContext *s,
     /* initialize the audio decoder stream */
     st = av_new_stream(s, 0);
     if (!st)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
     av_set_pts_info(st, 33, 1, EA_SAMPLE_RATE);
     st->codec->codec_type = CODEC_TYPE_AUDIO;
     st->codec->codec_id = CODEC_ID_ADPCM_EA;
@@ -227,16 +226,16 @@ static int ea_read_packet(AVFormatContext *s,
     while (!packet_read) {
 
         if (get_buffer(pb, preamble, EA_PREAMBLE_SIZE) != EA_PREAMBLE_SIZE)
-            return AVERROR_IO;
-        chunk_type = LE_32(&preamble[0]);
-        chunk_size = LE_32(&preamble[4]) - EA_PREAMBLE_SIZE;
+            return AVERROR(EIO);
+        chunk_type = AV_RL32(&preamble[0]);
+        chunk_size = AV_RL32(&preamble[4]) - EA_PREAMBLE_SIZE;
 
         switch (chunk_type) {
         /* audio data */
         case SCDl_TAG:
             ret = av_get_packet(pb, pkt, chunk_size);
             if (ret != chunk_size)
-                ret = AVERROR_IO;
+                ret = AVERROR(EIO);
             else {
                     pkt->stream_index = ea->audio_stream_index;
                     pkt->pts = 90000;
@@ -254,7 +253,7 @@ static int ea_read_packet(AVFormatContext *s,
 
         /* ending tag */
         case SCEl_TAG:
-            ret = AVERROR_IO;
+            ret = AVERROR(EIO);
             packet_read = 1;
             break;
 
@@ -273,7 +272,7 @@ static int ea_read_packet(AVFormatContext *s,
 
 static int ea_read_close(AVFormatContext *s)
 {
-//    EaDemuxContext *ea = (EaDemuxContext *)s->priv_data;
+//    EaDemuxContext *ea = s->priv_data;
 
     return 0;
 }