summaryrefslogtreecommitdiff
path: root/libavformat/dsicin.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-30 01:33:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-30 01:33:41 +0200
commitd17e7070a099af04a1dc7bc9ddd82f67bfcf9827 (patch)
tree4be589d09939bead88ef3d4e1d5e90fe0348af6c /libavformat/dsicin.c
parent1af3571e05522df4e71a5b33de05bdb9e953a6c4 (diff)
parent7d1b17b83330aefe2f32a66fe84effe46ae51014 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (51 commits) cin audio: use sign_extend() instead of casting to int16_t cin audio: restructure decoding loop to avoid a separate counter variable cin audio: use local variable for delta value cin audio: remove unneeded cast from void* cin audio: validate the channel count cin audio: remove unneeded AVCodecContext pointer from CinAudioContext dsicin: fix several audio-related fields in the CIN demuxer flacdec: use av_get_bytes_per_sample() to get sample size dca: handle errors from dca_decode_block() dca: return error if the frame header is invalid dca: return proper error codes instead of -1 utvideo: handle empty Huffman trees binkaudio: change short to int16_t binkaudio: only decode one block at a time. binkaudio: store interleaved overlap samples in BinkAudioContext. binkaudio: pre-calculate quantization factors binkaudio: add some buffer overread checks. atrac3: support float or int16 output using request_sample_fmt atrac3: add CODEC_CAP_SUBFRAMES capability atrac3: return appropriate error codes instead of -1 ... Conflicts: libavcodec/atrac1.c libavcodec/dca.c libavformat/mov.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/dsicin.c')
-rw-r--r--libavformat/dsicin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c
index 09e80e944f..ab098dc017 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;
}