From c27f11ddfb4c62a5d93ca48bb4627d17d01532ac Mon Sep 17 00:00:00 2001 From: Mike Melanson Date: Sun, 29 Feb 2004 18:42:39 +0000 Subject: compute and set the bitrate for CBR audio streams CVS patchset: 6195 CVS date: 2004/02/29 18:42:39 --- src/demuxers/demux_qt.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index 6bc7fc155..1200b3fbf 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -30,7 +30,7 @@ * build_frame_table * free_qt_info * - * $Id: demux_qt.c,v 1.178 2004/02/29 17:55:28 tmmm Exp $ + * $Id: demux_qt.c,v 1.179 2004/02/29 18:42:39 tmmm Exp $ * */ @@ -2366,6 +2366,7 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) { buf_element_t *buf; qt_trak *video_trak = NULL; qt_trak *audio_trak = NULL; + unsigned int audio_bitrate; /* for deciding data start and data size */ int64_t first_video_offset = -1; @@ -2538,6 +2539,18 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) { (audio_trak->properties->audio.codec_buftype) && this->audio_fifo) { + /* set the audio bitrate field (only for CBR audio) */ + if (!audio_trak->properties->audio.vbr) { + audio_bitrate = + audio_trak->properties->audio.sample_rate / + audio_trak->properties->audio.samples_per_frame * + audio_trak->properties->audio.bytes_per_frame * + audio_trak->properties->audio.channels * + 8; + _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, + audio_bitrate); + } + buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = audio_trak->properties->audio.codec_buftype; buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END; -- cgit v1.2.3