]> git.sesse.net Git - vlc/blobdiff - src/lpcm_decoder/lpcm_decoder_thread.c
* Mandatory step for video output IV and the audio output quality
[vlc] / src / lpcm_decoder / lpcm_decoder_thread.c
index f231c0a7f49e2ea620a25805ba5e3210921e223e..9a3c3d260c988bf5f699b7bcbfed187cfd2bcccd 100644 (file)
@@ -2,9 +2,9 @@
  * lpcm_decoder_thread.c: lpcm decoder thread
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: lpcm_decoder_thread.c,v 1.8 2001/01/05 14:46:37 sam Exp $
+ * $Id: lpcm_decoder_thread.c,v 1.14 2001/05/01 04:18:18 sam Exp $
  *
- * Authors:
+ * Authors: Samuel Hocevar <sam@zoy.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <unistd.h>                                              /* getpid() */
 
 #include <stdio.h>                                           /* "intf_msg.h" */
+#include <string.h>                                    /* memcpy(), memset() */
 #include <stdlib.h>                                      /* malloc(), free() */
-#include <sys/types.h>                        /* on BSD, uio.h needs types.h */
-#include <sys/uio.h>                                            /* "input.h" */
 
 #include "config.h"
 #include "common.h"
 #include "threads.h"
 #include "mtime.h"
-#include "plugins.h"
-#include "debug.h"                                      /* "input_netlist.h" */
 
 #include "intf_msg.h"                        /* intf_DbgMsg(), intf_ErrMsg() */
 
@@ -50,7 +47,7 @@
 #include "lpcm_decoder.h"
 #include "lpcm_decoder_thread.h"
 
-#define LPCMDEC_FRAME_SIZE (2*1536)                    /* May not be usefull */
+#define LPCMDEC_FRAME_SIZE (2*1536)                        /* May be useless */
 
 /*****************************************************************************
  * Local prototypes
@@ -87,7 +84,6 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
     /*
      * Initialize the output properties
      */
-    p_lpcmdec->p_aout = p_config->p_aout;
     p_lpcmdec->p_aout_fifo = NULL;
 
     /* Spawn the lpcm decoder thread */
@@ -108,7 +104,6 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
  *****************************************************************************/
 static int InitThread (lpcmdec_thread_t * p_lpcmdec)
 {
-    aout_fifo_t         aout_fifo;
     lpcm_byte_stream_t * byte_stream;
 
     intf_DbgMsg ( "LPCM Debug: initializing lpcm decoder thread %p", p_lpcmdec );
@@ -130,14 +125,11 @@ static int InitThread (lpcmdec_thread_t * p_lpcmdec)
     byte_stream->info = p_lpcmdec;
     vlc_mutex_unlock (&p_lpcmdec->p_fifo->data_lock);
 
-    aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
-    aout_fifo.i_channels = 2;
-    aout_fifo.b_stereo = 1;
-
-    aout_fifo.l_frame_size = LPCMDEC_FRAME_SIZE;
-
     /* Creating the audio output fifo */
-    if ((p_lpcmdec->p_aout_fifo = aout_CreateFifo(p_lpcmdec->p_aout, &aout_fifo)) == NULL) {
+    p_lpcmdec->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
+                                              LPCMDEC_FRAME_SIZE, NULL  );
+    if ( p_lpcmdec->p_aout_fifo == NULL )
+    {
         return -1;
     }
 
@@ -205,7 +197,9 @@ static void RunThread (lpcmdec_thread_t * p_lpcmdec)
         vlc_mutex_unlock (&p_lpcmdec->p_aout_fifo->data_lock);
 
         intf_DbgMsg( "LPCM Debug: %x", *buffer );
-        bad_frame:
+
+    bad_frame:
+        continue;
     }
 
     /* If b_error is set, the lpcm decoder thread enters the error loop */