summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-12-08 21:43:50 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-12-08 21:43:50 +0000
commit180ace8c194d76ba780847ea5b4eb3e6adf5befb (patch)
tree0fb5c990783df8487b97fe0aada2ab709721c2e9
parent3c919d37ea15fa0d0b1d63203a8ce2f7129a6f55 (diff)
downloadxine-lib-180ace8c194d76ba780847ea5b4eb3e6adf5befb.tar.gz
xine-lib-180ace8c194d76ba780847ea5b4eb3e6adf5befb.tar.bz2
- get xine_demux_control_headers_done() out of the demuxers.
i want to make sure we have a 1:1 mapping of sending and waiting for BUF_CONTROL_HEADERS_DONE.) - bring asf demuxer into a saner state when seeking. that fixes the problem of wrong audio pts and hanging audio_out on huge sleeps (at least for asf). CVS patchset: 3465 CVS date: 2002/12/08 21:43:50
-rw-r--r--src/demuxers/demux_aiff.c4
-rw-r--r--src/demuxers/demux_asf.c12
-rw-r--r--src/demuxers/demux_avi.c4
-rw-r--r--src/demuxers/demux_cda.c4
-rw-r--r--src/demuxers/demux_eawve.c4
-rw-r--r--src/demuxers/demux_elem.c4
-rw-r--r--src/demuxers/demux_film.c4
-rw-r--r--src/demuxers/demux_fli.c4
-rw-r--r--src/demuxers/demux_idcin.c4
-rw-r--r--src/demuxers/demux_mpeg.c4
-rw-r--r--src/demuxers/demux_mpeg_block.c4
-rw-r--r--src/demuxers/demux_mpgaudio.c4
-rw-r--r--src/demuxers/demux_ogg.c4
-rw-r--r--src/demuxers/demux_qt.c4
-rw-r--r--src/demuxers/demux_real.c4
-rw-r--r--src/demuxers/demux_realaudio.c4
-rw-r--r--src/demuxers/demux_roq.c4
-rw-r--r--src/demuxers/demux_smjpeg.c4
-rw-r--r--src/demuxers/demux_snd.c4
-rw-r--r--src/demuxers/demux_ts.c4
-rw-r--r--src/demuxers/demux_voc.c4
-rw-r--r--src/demuxers/demux_vqa.c4
-rw-r--r--src/demuxers/demux_wav.c5
-rw-r--r--src/demuxers/demux_wc3movie.c4
-rw-r--r--src/demuxers/demux_yuv4mpeg2.c4
-rw-r--r--src/xine-engine/xine.c23
26 files changed, 45 insertions, 87 deletions
diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c
index e0dacb8e6..0f790db56 100644
--- a/src/demuxers/demux_aiff.c
+++ b/src/demuxers/demux_aiff.c
@@ -19,7 +19,7 @@
*
* AIFF File Demuxer by Mike Melanson (melanson@pcisys.net)
*
- * $Id: demux_aiff.c,v 1.18 2002/11/28 10:21:05 petli Exp $
+ * $Id: demux_aiff.c,v 1.19 2002/12/08 21:43:50 miguelfreitas Exp $
*
*/
@@ -267,8 +267,6 @@ static void demux_aiff_send_headers(demux_plugin_t *this_gen) {
buf->size = 0;
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_aiff_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index 135e93924..61fceabec 100644
--- a/src/demuxers/demux_asf.c
+++ b/src/demuxers/demux_asf.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: demux_asf.c,v 1.86 2002/12/06 19:23:29 miguelfreitas Exp $
+ * $Id: demux_asf.c,v 1.87 2002/12/08 21:43:50 miguelfreitas Exp $
*
* demultiplexer for asf streams
*
@@ -1527,14 +1527,14 @@ static void demux_asf_send_headers (demux_plugin_t *this_gen) {
this->frame = 0;
this->nb_frames = 1;
- xine_demux_control_headers_done (this->stream);
}
static int demux_asf_seek (demux_plugin_t *this_gen,
off_t start_pos, int start_time) {
demux_asf_t *this = (demux_asf_t *) this_gen;
-
+ int i;
+
this->status = DEMUX_OK;
xine_demux_flush_engine(this->stream);
@@ -1549,6 +1549,12 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
this->packet_size_left = 0;
this->keyframe_found = (this->num_video_streams==0);
+ for(i = 0; i < this->num_streams; i++) {
+ this->streams[i].frag_offset = 0;
+ this->streams[i].seq = 0;
+ this->streams[i].timestamp = 0;
+ }
+
if (this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) {
if ( (!start_pos) && (start_time))
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index 809be0430..e63d87c62 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.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: demux_avi.c,v 1.135 2002/12/06 01:01:15 miguelfreitas Exp $
+ * $Id: demux_avi.c,v 1.136 2002/12/08 21:43:50 miguelfreitas Exp $
*
* demultiplexer for avi streams
*
@@ -1307,8 +1307,6 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) {
}
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_avi_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_cda.c b/src/demuxers/demux_cda.c
index b555f11b9..65f753dd3 100644
--- a/src/demuxers/demux_cda.c
+++ b/src/demuxers/demux_cda.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: demux_cda.c,v 1.35 2002/11/28 10:21:05 petli Exp $
+ * $Id: demux_cda.c,v 1.36 2002/12/08 21:43:50 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -141,8 +141,6 @@ static void demux_cda_send_headers(demux_plugin_t *this_gen) {
this->stream->stream_info[XINE_STREAM_INFO_AUDIO_CHANNELS] = 2;
this->stream->stream_info[XINE_STREAM_INFO_AUDIO_SAMPLERATE] = 44100;
this->stream->stream_info[XINE_STREAM_INFO_AUDIO_BITS] = 16;
-
- xine_demux_control_headers_done (this->stream);
}
/*
diff --git a/src/demuxers/demux_eawve.c b/src/demuxers/demux_eawve.c
index 443c06bca..f70e557b1 100644
--- a/src/demuxers/demux_eawve.c
+++ b/src/demuxers/demux_eawve.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: demux_eawve.c,v 1.9 2002/11/28 10:21:05 petli Exp $
+ * $Id: demux_eawve.c,v 1.10 2002/12/08 21:43:50 miguelfreitas Exp $
*
* demux_eawve.c, Demuxer plugin for Electronic Arts' WVE file format
*
@@ -319,8 +319,6 @@ static void demux_eawve_send_headers(demux_plugin_t *this_gen)
buf->decoder_info[3] = 2;
this->audio_fifo->put(this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_eawve_seek(demux_eawve_t *this, off_t start_pos, int start_time)
diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c
index 34dd9e79e..9bd98b94e 100644
--- a/src/demuxers/demux_elem.c
+++ b/src/demuxers/demux_elem.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: demux_elem.c,v 1.63 2002/11/28 10:21:06 petli Exp $
+ * $Id: demux_elem.c,v 1.64 2002/12/08 21:43:50 miguelfreitas Exp $
*
* demultiplexer for elementary mpeg streams
*
@@ -147,8 +147,6 @@ static void demux_mpeg_elem_send_headers (demux_plugin_t *this_gen) {
this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO] = 1;
this->stream->stream_info[XINE_STREAM_INFO_HAS_AUDIO] = 0;
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_mpeg_elem_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c
index 8eef08e4b..b35666c0f 100644
--- a/src/demuxers/demux_film.c
+++ b/src/demuxers/demux_film.c
@@ -21,7 +21,7 @@
* For more information on the FILM file format, visit:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: demux_film.c,v 1.45 2002/11/28 10:21:06 petli Exp $
+ * $Id: demux_film.c,v 1.46 2002/12/08 21:43:50 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -542,8 +542,6 @@ static void demux_film_send_headers(demux_plugin_t *this_gen) {
buf->decoder_info[3] = this->audio_channels;
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_film_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c
index be4aeed61..a992aa9cf 100644
--- a/src/demuxers/demux_fli.c
+++ b/src/demuxers/demux_fli.c
@@ -22,7 +22,7 @@
* avoid while programming a FLI decoder, visit:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: demux_fli.c,v 1.28 2002/11/28 10:21:06 petli Exp $
+ * $Id: demux_fli.c,v 1.29 2002/12/08 21:43:50 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -228,8 +228,6 @@ static void demux_fli_send_headers(demux_plugin_t *this_gen) {
buf->size = FLI_HEADER_SIZE;
buf->type = BUF_VIDEO_FLI;
this->video_fifo->put (this->video_fifo, buf);
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_fli_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c
index d3623d023..bfd017c9b 100644
--- a/src/demuxers/demux_idcin.c
+++ b/src/demuxers/demux_idcin.c
@@ -63,7 +63,7 @@
* - if any bytes exceed 63, do not shift the bytes at all before
* transmitting them to the video decoder
*
- * $Id: demux_idcin.c,v 1.29 2002/11/28 10:21:06 petli Exp $
+ * $Id: demux_idcin.c,v 1.30 2002/12/08 21:43:51 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -403,8 +403,6 @@ static void demux_idcin_send_headers(demux_plugin_t *this_gen) {
buf->decoder_info[3] = this->audio_channels;
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_idcin_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index e6c29ff7b..21b23a959 100644
--- a/src/demuxers/demux_mpeg.c
+++ b/src/demuxers/demux_mpeg.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: demux_mpeg.c,v 1.98 2002/11/28 10:21:06 petli Exp $
+ * $Id: demux_mpeg.c,v 1.99 2002/12/08 21:43:51 miguelfreitas Exp $
*
* demultiplexer for mpeg 1/2 program streams
* reads streams of variable blocksizes
@@ -830,8 +830,6 @@ static void demux_mpeg_send_headers (demux_plugin_t *this_gen) {
this->status = DEMUX_OK ;
this->stream->stream_info[XINE_STREAM_INFO_BITRATE] = this->rate * 50 * 8;
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_mpeg_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index 5b051cca1..8d6c0279d 100644
--- a/src/demuxers/demux_mpeg_block.c
+++ b/src/demuxers/demux_mpeg_block.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: demux_mpeg_block.c,v 1.146 2002/11/28 10:21:06 petli Exp $
+ * $Id: demux_mpeg_block.c,v 1.147 2002/12/08 21:43:51 miguelfreitas Exp $
*
* demultiplexer for mpeg 1/2 program streams
*
@@ -858,8 +858,6 @@ static void demux_mpeg_block_send_headers (demux_plugin_t *this_gen) {
this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO] = 1;
this->stream->stream_info[XINE_STREAM_INFO_HAS_AUDIO] = 1;
this->stream->stream_info[XINE_STREAM_INFO_BITRATE] = this->rate * 50 * 8;
-
- xine_demux_control_headers_done (this->stream);
}
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c
index 631ff4b33..df1242da7 100644
--- a/src/demuxers/demux_mpgaudio.c
+++ b/src/demuxers/demux_mpgaudio.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: demux_mpgaudio.c,v 1.83 2002/11/28 18:42:25 tmmm Exp $
+ * $Id: demux_mpgaudio.c,v 1.84 2002/12/08 21:43:51 miguelfreitas Exp $
*
* demultiplexer for mpeg audio (i.e. mp3) streams
*
@@ -411,8 +411,6 @@ static void demux_mpgaudio_send_headers (demux_plugin_t *this_gen) {
break;
}
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_mpgaudio_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c
index d83361c4b..2531b3fd8 100644
--- a/src/demuxers/demux_ogg.c
+++ b/src/demuxers/demux_ogg.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: demux_ogg.c,v 1.54 2002/11/28 10:21:06 petli Exp $
+ * $Id: demux_ogg.c,v 1.55 2002/12/08 21:43:51 miguelfreitas Exp $
*
* demultiplexer for ogg streams
*
@@ -869,8 +869,6 @@ static void demux_ogg_send_headers (demux_plugin_t *this_gen) {
this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO] = this->num_video_streams>0;
this->stream->stream_info[XINE_STREAM_INFO_HAS_AUDIO] = this->num_audio_streams>0;
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_ogg_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 979aa3356..6682d67eb 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.124 2002/12/06 01:02:23 miguelfreitas Exp $
+ * $Id: demux_qt.c,v 1.125 2002/12/08 21:43:51 miguelfreitas Exp $
*
*/
@@ -2015,8 +2015,6 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) {
this->audio_fifo->put (this->audio_fifo, buf);
}
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_qt_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index f7f0492ef..cdc688ec2 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -21,7 +21,7 @@
* For more information regarding the Real file format, visit:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: demux_real.c,v 1.19 2002/12/06 23:40:26 guenter Exp $
+ * $Id: demux_real.c,v 1.20 2002/12/08 21:43:51 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -974,8 +974,6 @@ static void demux_real_send_headers(demux_plugin_t *this_gen) {
_("demux_real: Real media file, running time: %d min, %d sec\n"),
this->duration / 1000 / 60,
this->duration / 1000 % 60);
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_real_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c
index 6f97fb81a..0bf171257 100644
--- a/src/demuxers/demux_realaudio.c
+++ b/src/demuxers/demux_realaudio.c
@@ -19,7 +19,7 @@
*
* RealAudio File Demuxer by Mike Melanson (melanson@pcisys.net)
*
- * $Id: demux_realaudio.c,v 1.6 2002/11/28 10:21:07 petli Exp $
+ * $Id: demux_realaudio.c,v 1.7 2002/12/08 21:43:51 miguelfreitas Exp $
*
*/
@@ -205,8 +205,6 @@ static void demux_ra_send_headers(demux_plugin_t *this_gen) {
buf->size = sizeof(this->wave);
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_ra_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c
index 016503344..89425bd5e 100644
--- a/src/demuxers/demux_roq.c
+++ b/src/demuxers/demux_roq.c
@@ -21,7 +21,7 @@
* For more information regarding the RoQ file format, visit:
* http://www.csse.monash.edu.au/~timf/
*
- * $Id: demux_roq.c,v 1.31 2002/11/28 10:21:07 petli Exp $
+ * $Id: demux_roq.c,v 1.32 2002/12/08 21:43:51 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -348,8 +348,6 @@ static void demux_roq_send_headers(demux_plugin_t *this_gen) {
buf->decoder_info[3] = this->audio_channels;
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_roq_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c
index fcda4a928..0cc9a46c1 100644
--- a/src/demuxers/demux_smjpeg.c
+++ b/src/demuxers/demux_smjpeg.c
@@ -21,7 +21,7 @@
* For more information on the SMJPEG file format, visit:
* http://www.lokigames.com/development/smjpeg.php3
*
- * $Id: demux_smjpeg.c,v 1.27 2002/11/28 10:21:07 petli Exp $
+ * $Id: demux_smjpeg.c,v 1.28 2002/12/08 21:43:51 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -363,8 +363,6 @@ static void demux_smjpeg_send_headers(demux_plugin_t *this_gen) {
buf->decoder_info[3] = this->audio_channels;
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_smjpeg_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c
index f08cdf70f..87252005c 100644
--- a/src/demuxers/demux_snd.c
+++ b/src/demuxers/demux_snd.c
@@ -19,7 +19,7 @@
*
* SND/AU File Demuxer by Mike Melanson (melanson@pcisys.net)
*
- * $Id: demux_snd.c,v 1.19 2002/11/28 10:21:07 petli Exp $
+ * $Id: demux_snd.c,v 1.20 2002/12/08 21:43:52 miguelfreitas Exp $
*
*/
@@ -250,8 +250,6 @@ static void demux_snd_send_headers(demux_plugin_t *this_gen) {
buf->size = 0;
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_snd_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index c6962d0bd..21c21c224 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.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: demux_ts.c,v 1.67 2002/11/28 10:21:07 petli Exp $
+ * $Id: demux_ts.c,v 1.68 2002/12/08 21:43:52 miguelfreitas Exp $
*
* Demultiplexer for MPEG2 Transport Streams.
*
@@ -1629,8 +1629,6 @@ static void demux_ts_send_headers (demux_plugin_t *this_gen) {
/* FIXME ? */
this->stream->stream_info[XINE_STREAM_INFO_HAS_VIDEO] = 1;
this->stream->stream_info[XINE_STREAM_INFO_HAS_AUDIO] = 1;
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_ts_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c
index 7517bb7e3..4de21ff59 100644
--- a/src/demuxers/demux_voc.c
+++ b/src/demuxers/demux_voc.c
@@ -23,7 +23,7 @@
* It will only play that block if it is PCM data. More variations will be
* supported as they are encountered.
*
- * $Id: demux_voc.c,v 1.19 2002/11/28 10:21:07 petli Exp $
+ * $Id: demux_voc.c,v 1.20 2002/12/08 21:43:52 miguelfreitas Exp $
*
*/
@@ -243,8 +243,6 @@ static void demux_voc_send_headers(demux_plugin_t *this_gen) {
buf->size = 0;
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_voc_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c
index fcc407970..9b1b32039 100644
--- a/src/demuxers/demux_vqa.c
+++ b/src/demuxers/demux_vqa.c
@@ -27,7 +27,7 @@
* block needs information from the previous audio block in order to be
* decoded, thus making random seeking difficult.
*
- * $Id: demux_vqa.c,v 1.22 2002/11/28 10:21:07 petli Exp $
+ * $Id: demux_vqa.c,v 1.23 2002/12/08 21:43:52 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -303,8 +303,6 @@ static void demux_vqa_send_headers(demux_plugin_t *this_gen) {
buf->decoder_info[3] = 1; /* channels */
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_vqa_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c
index 424f0f1b3..73724cfac 100644
--- a/src/demuxers/demux_wav.c
+++ b/src/demuxers/demux_wav.c
@@ -20,7 +20,7 @@
* MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net)
* based on WAV specs that are available far and wide
*
- * $Id: demux_wav.c,v 1.27 2002/11/28 10:21:08 petli Exp $
+ * $Id: demux_wav.c,v 1.28 2002/12/08 21:43:52 miguelfreitas Exp $
*
*/
@@ -237,9 +237,6 @@ static void demux_wav_send_headers(demux_plugin_t *this_gen) {
buf->size = this->wave_size;
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
-
}
static int demux_wav_seek (demux_plugin_t *this_gen,
diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c
index cf66e7c4f..b51860825 100644
--- a/src/demuxers/demux_wc3movie.c
+++ b/src/demuxers/demux_wc3movie.c
@@ -22,7 +22,7 @@
* For more information on the MVE file format, visit:
* http://www.pcisys.net/~melanson/codecs/
*
- * $Id: demux_wc3movie.c,v 1.27 2002/11/28 10:21:08 petli Exp $
+ * $Id: demux_wc3movie.c,v 1.28 2002/12/08 21:43:52 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -367,8 +367,6 @@ static void demux_mve_send_headers(demux_plugin_t *this_gen) {
buf->size = sizeof(this->wave);
this->audio_fifo->put (this->audio_fifo, buf);
}
-
- xine_demux_control_headers_done (this->stream);
}
/* returns 1 if the MVE file was opened successfully, 0 otherwise */
diff --git a/src/demuxers/demux_yuv4mpeg2.c b/src/demuxers/demux_yuv4mpeg2.c
index 7a5efa641..41fad5b6e 100644
--- a/src/demuxers/demux_yuv4mpeg2.c
+++ b/src/demuxers/demux_yuv4mpeg2.c
@@ -22,7 +22,7 @@
* tools, visit:
* http://mjpeg.sourceforge.net/
*
- * $Id: demux_yuv4mpeg2.c,v 1.12 2002/11/28 10:21:08 petli Exp $
+ * $Id: demux_yuv4mpeg2.c,v 1.13 2002/12/08 21:43:52 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -258,8 +258,6 @@ static void demux_yuv4mpeg2_send_headers(demux_plugin_t *this_gen) {
buf->size = sizeof(this->bih);
buf->type = BUF_VIDEO_YV12;
this->video_fifo->put (this->video_fifo, buf);
-
- xine_demux_control_headers_done (this->stream);
}
static int demux_yuv4mpeg2_seek (demux_plugin_t *this_gen,
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 6db978daa..aa554be30 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.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.c,v 1.198 2002/12/06 18:38:46 miguelfreitas Exp $
+ * $Id: xine.c,v 1.199 2002/12/08 21:43:52 miguelfreitas Exp $
*
* top-level xine functions
*
@@ -601,15 +601,6 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
* send and decode headers
*/
- pthread_mutex_lock (&stream->counter_lock);
- if (stream->audio_fifo)
- header_count_audio = stream->header_count_audio + 1;
- else
- header_count_audio = 0;
-
- header_count_video = stream->header_count_video + 1;
- pthread_mutex_unlock (&stream->counter_lock);
-
stream->demux_plugin->send_headers (stream->demux_plugin);
if (stream->demux_plugin->get_status(stream->demux_plugin) != DEMUX_OK) {
@@ -635,13 +626,23 @@ static int xine_open_internal (xine_stream_t *stream, const char *mrl) {
return 0;
}
-
+
pthread_mutex_lock (&stream->counter_lock);
+ if (stream->audio_fifo)
+ header_count_audio = stream->header_count_audio + 1;
+ else
+ header_count_audio = 0;
+
+ header_count_video = stream->header_count_video + 1;
+
+ xine_demux_control_headers_done (stream);
+
while ((stream->header_count_audio<header_count_audio) ||
(stream->header_count_video<header_count_video)) {
printf ("xine: waiting for headers.\n");
pthread_cond_wait (&stream->counter_changed, &stream->counter_lock);
}
+ printf ("xine: headers processed.\n");
pthread_mutex_unlock (&stream->counter_lock);
#ifdef LOG