diff options
author | Mike Melanson <mike@multimedia.cx> | 2004-02-29 18:42:39 +0000 |
---|---|---|
committer | Mike Melanson <mike@multimedia.cx> | 2004-02-29 18:42:39 +0000 |
commit | c27f11ddfb4c62a5d93ca48bb4627d17d01532ac (patch) | |
tree | 0cacd8e93e9994f9dfa64dcd5603f48409b13395 | |
parent | 5c94b9fcf9dbf45c9de005fc9e2772d3d2f270b0 (diff) | |
download | xine-lib-c27f11ddfb4c62a5d93ca48bb4627d17d01532ac.tar.gz xine-lib-c27f11ddfb4c62a5d93ca48bb4627d17d01532ac.tar.bz2 |
compute and set the bitrate for CBR audio streams
CVS patchset: 6195
CVS date: 2004/02/29 18:42:39
-rw-r--r-- | src/demuxers/demux_qt.c | 15 |
1 files changed, 14 insertions, 1 deletions
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; |