1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

4xm: K&R formatting cosmetics

This commit is contained in:
Luca Barbato 2013-06-05 17:32:49 +02:00
parent 08859d19b4
commit e6496ea7e7

View File

@ -188,9 +188,9 @@ static int fourxm_read_header(AVFormatContext *s)
fourxm->tracks[current_track].sample_rate = AV_RL32(&header[i + 40]);
fourxm->tracks[current_track].bits = AV_RL32(&header[i + 44]);
fourxm->tracks[current_track].audio_pts = 0;
if( fourxm->tracks[current_track].channels <= 0
|| fourxm->tracks[current_track].sample_rate <= 0
|| fourxm->tracks[current_track].bits < 0){
if (fourxm->tracks[current_track].channels <= 0 ||
fourxm->tracks[current_track].sample_rate <= 0 ||
fourxm->tracks[current_track].bits < 0) {
av_log(s, AV_LOG_ERROR, "audio header invalid\n");
ret = -1;
goto fail;
@ -205,7 +205,8 @@ static int fourxm_read_header(AVFormatContext *s)
}
st->id = current_track;
avpriv_set_pts_info(st, 60, 1, fourxm->tracks[current_track].sample_rate);
avpriv_set_pts_info(st, 60, 1,
fourxm->tracks[current_track].sample_rate);
fourxm->tracks[current_track].stream_index = st->index;
@ -258,7 +259,6 @@ static int fourxm_read_packet(AVFormatContext *s,
int audio_frame_count;
while (!packet_read) {
if ((ret = avio_read(s->pb, header, 8)) < 0)
return ret;
fourcc_tag = AV_RL32(&header[0]);
@ -266,7 +266,6 @@ static int fourxm_read_packet(AVFormatContext *s,
if (pb->eof_reached)
return AVERROR(EIO);
switch (fourcc_tag) {
case LIST_TAG:
/* this is a good time to bump the video pts */
fourxm->video_pts++;
@ -302,7 +301,8 @@ static int fourxm_read_packet(AVFormatContext *s,
avio_skip(pb, 4);
size -= 8;
if (track_number < fourxm->track_count && fourxm->tracks[track_number].channels>0) {
if (track_number < fourxm->track_count &&
fourxm->tracks[track_number].channels > 0) {
ret = av_get_packet(s->pb, pkt, size);
if (ret < 0)
return AVERROR(EIO);
@ -314,17 +314,14 @@ static int fourxm_read_packet(AVFormatContext *s,
/* pts accounting */
audio_frame_count = size;
if (fourxm->tracks[track_number].adpcm)
audio_frame_count -=
2 * (fourxm->tracks[track_number].channels);
audio_frame_count /=
fourxm->tracks[track_number].channels;
audio_frame_count -= 2 * (fourxm->tracks[track_number].channels);
audio_frame_count /= fourxm->tracks[track_number].channels;
if (fourxm->tracks[track_number].adpcm) {
audio_frame_count *= 2;
} else
audio_frame_count /=
(fourxm->tracks[track_number].bits / 8);
fourxm->tracks[track_number].audio_pts += audio_frame_count;
} else {
avio_skip(pb, size);
}