Skip to content

Commit

Permalink
dsicin: fix several audio-related fields in the CIN demuxer
Browse files Browse the repository at this point in the history
bits_per_coded_sample should be 8.
block_align is calculated incorrectly, but it is not needed anyway.
packet pts should be calculated in samples.
packet duration can be set.
  • Loading branch information
justinruggles committed Oct 29, 2011
1 parent 5bd0343 commit 44d2a98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libavformat/dsicin.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->codec_tag = 0; /* no tag */
st->codec->channels = 1;
st->codec->sample_rate = 22050;
st->codec->bits_per_coded_sample = 16;
st->codec->bits_per_coded_sample = 8;
st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample * st->codec->channels;
st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample;

return 0;
}
Expand Down Expand Up @@ -211,7 +210,8 @@ static int cin_read_packet(AVFormatContext *s, AVPacket *pkt)

pkt->stream_index = cin->audio_stream_index;
pkt->pts = cin->audio_stream_pts;
cin->audio_stream_pts += cin->audio_buffer_size * 2 / cin->file_header.audio_frame_size;
pkt->duration = cin->audio_buffer_size - (pkt->pts == 0);
cin->audio_stream_pts += pkt->duration;
cin->audio_buffer_size = 0;
return 0;
}
Expand Down

0 comments on commit 44d2a98

Please sign in to comment.