diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-12-03 03:07:07 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-12-03 03:07:07 +0000 |
commit | d10ebcc967cd804d220dd92a09480bc37e086cd6 (patch) | |
tree | bdee55c9dcd6f291a506f68da818aa1746952050 | |
parent | 22952f5ad21503c45ee520cd68977136dae786b3 (diff) | |
download | xine-lib-d10ebcc967cd804d220dd92a09480bc37e086cd6.tar.gz xine-lib-d10ebcc967cd804d220dd92a09480bc37e086cd6.tar.bz2 |
remove nasty ogg_pack hack. now just pure vorbis data is sent to
decoder. that change prevents segfaulting with those (even nastier)
ogg-in-avi files, but does not play the beasts either.
CVS patchset: 5825
CVS date: 2003/12/03 03:07:07
-rw-r--r-- | src/demuxers/demux_ogg.c | 18 | ||||
-rw-r--r-- | src/libvorbis/xine_decoder.c | 19 |
2 files changed, 15 insertions, 22 deletions
diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index c4714ca6b..31ac698ea 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_ogg.c,v 1.120 2003/12/02 14:07:27 miguelfreitas Exp $ + * $Id: demux_ogg.c,v 1.121 2003/12/03 03:07:07 miguelfreitas Exp $ * * demultiplexer for ogg streams * @@ -413,20 +413,8 @@ static void send_ogg_buf (demux_ogg_t *this, read_language_comment(this, op, stream_num); } - if ((this->buf_types[stream_num] & 0xFFFF0000) == BUF_AUDIO_VORBIS) { - int op_size = sizeof(ogg_packet); - ogg_packet *og_ghost; - op_size += (4 - (op_size % 4)); - - /* nasty hack to pack op as well as (vorbis) content - in one xine buffer */ - memcpy (buf->content + op_size, op->packet, op->bytes); - memcpy (buf->content, op, op_size); - og_ghost = (ogg_packet *) buf->content; - og_ghost->packet = buf->content + op_size; - - buf->size = op->bytes; - } else if ((this->buf_types[stream_num] & 0xFFFF0000) == BUF_AUDIO_SPEEX) { + if ((this->buf_types[stream_num] & 0xFFFF0000) == BUF_AUDIO_SPEEX || + (this->buf_types[stream_num] & 0xFFFF0000) == BUF_AUDIO_VORBIS) { memcpy (buf->content, op->packet, op->bytes); buf->size = op->bytes; } else { diff --git a/src/libvorbis/xine_decoder.c b/src/libvorbis/xine_decoder.c index abfcdcf38..0c2e7afd2 100644 --- a/src/libvorbis/xine_decoder.c +++ b/src/libvorbis/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.33 2003/11/29 14:47:50 miguelfreitas Exp $ + * $Id: xine_decoder.c,v 1.34 2003/12/03 03:07:08 miguelfreitas Exp $ * * (ogg/)vorbis audio decoder plugin (libvorbis wrapper) for xine */ @@ -57,6 +57,8 @@ typedef struct vorbis_decoder_s { int output_open; int output_mode; + ogg_packet op; /* we must use this struct to sent data to libvorbis */ + /* vorbis stuff */ vorbis_info vi; /* stores static vorbis bitstream settings */ vorbis_comment vc; @@ -134,17 +136,20 @@ static void get_metadata (vorbis_decoder_t *this) { static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen; - ogg_packet *op = (ogg_packet *) buf->content; - lprintf ("decode buf=%p content=%p op=%p packet=%p flags=%08x\n", - buf, buf->content, op, op->packet, buf->decoder_flags); - + memset( &this->op, 0, sizeof(this->op) ); + this->op.packet = buf->content; + this->op.bytes = buf->size; + if (buf->decoder_flags & BUF_FLAG_PREVIEW) { lprintf ("preview buffer, %d headers to go\n", this->header_count); if (this->header_count) { - if(vorbis_synthesis_headerin(&this->vi,&this->vc,op)<0){ + if (this->header_count == 3) + this->op.b_o_s = 1; + + if(vorbis_synthesis_headerin(&this->vi,&this->vc,&this->op)<0){ /* error case; not a vorbis header */ printf("libvorbis: this bitstream does not contain vorbis audio data.\n"); return; @@ -212,7 +217,7 @@ static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { float **pcm; int samples; - if(vorbis_synthesis(&this->vb,op)==0) + if(vorbis_synthesis(&this->vb,&this->op)==0) vorbis_synthesis_blockin(&this->vd,&this->vb); if (buf->pts!=0) |