Merge commit '163a729725c6eb0081b0af41a7279f7d19aee86e'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 16 Aug 2013 10:18:41 +0000 (12:18 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 16 Aug 2013 10:25:07 +0000 (12:25 +0200)
* commit '163a729725c6eb0081b0af41a7279f7d19aee86e':
  electronicarts: Let functions always returning the same value return void

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/electronicarts.c

@@@ -282,15 -276,13 +282,13 @@@ static void process_audio_header_eacs(A
          ea->audio_codec = AV_CODEC_ID_ADPCM_IMA_EA_EACS;
          break;
      default:
 -        av_log(s, AV_LOG_ERROR,
 -               "unsupported stream type; audio compression_type=%i\n",
 -               compression_type);
 +        avpriv_request_sample(s,
 +                              "stream type; audio compression_type=%i",
 +                              compression_type);
      }
-     return 1;
  }
  
- static int process_audio_header_sead(AVFormatContext *s)
+ static void process_audio_header_sead(AVFormatContext *s)
  {
      EaDemuxContext *ea = s->priv_data;
      AVIOContext *pb    = s->pb;
@@@ -312,30 -302,20 +308,28 @@@ static void process_video_header_mdec(A
      ea->height      = avio_rl16(pb);
      ea->time_base   = (AVRational) { 1, 15 };
      ea->video_codec = AV_CODEC_ID_MDEC;
-     return 1;
  }
  
 -static void process_video_header_vp6(AVFormatContext *s)
 +static int process_video_header_vp6(AVFormatContext *s)
  {
      EaDemuxContext *ea = s->priv_data;
      AVIOContext *pb    = s->pb;
  
 -    avio_skip(pb, 16);
 +    avio_skip(pb, 8);
 +    ea->nb_frames = avio_rl32(pb);
 +    avio_skip(pb, 4);
      ea->time_base.den = avio_rl32(pb);
      ea->time_base.num = avio_rl32(pb);
 +    if (ea->time_base.den <= 0 || ea->time_base.num <= 0) {
 +        av_log(s, AV_LOG_ERROR, "Timebase is invalid\n");
 +        return AVERROR_INVALIDDATA;
 +    }
      ea->video_codec   = AV_CODEC_ID_VP6;
 +
 +    return 1;
  }
  
- static int process_video_header_cmv(AVFormatContext *s)
+ static void process_video_header_cmv(AVFormatContext *s)
  {
      EaDemuxContext *ea = s->priv_data;
      int fps;
@@@ -372,10 -350,10 +364,10 @@@ static int process_ea_header(AVFormatCo
          switch (blockid) {
          case ISNh_TAG:
              if (avio_rl32(pb) != EACS_TAG) {
 -                av_log(s, AV_LOG_ERROR, "unknown 1SNh headerid\n");
 +                avpriv_request_sample(s, "unknown 1SNh headerid");
                  return 0;
              }
-             err = process_audio_header_eacs(s);
+             process_audio_header_eacs(s);
              break;
  
          case SCHl_TAG: