diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-27 12:46:32 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-29 16:43:40 -0400 |
commit | 44d2a982acd858ebb518710b4c7738bf7258558b (patch) | |
tree | ccfa9c2413dfd9b8e08af112449c0a771d25b39c | |
parent | 5bd0343bee1ed3df9cae1093bd909d07d07fa145 (diff) | |
download | ffmpeg-44d2a982acd858ebb518710b4c7738bf7258558b.tar.gz |
dsicin: fix several audio-related fields in the CIN demuxer
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.
-rw-r--r-- | libavformat/dsicin.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c index 3c7589b556..5f02f79501 100644 --- a/libavformat/dsicin.c +++ b/libavformat/dsicin.c @@ -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; } @@ -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; } |