]> git.sesse.net Git - vlc/blobdiff - modules/mux/mpeg/ps.c
Use the new block_Fifo functions
[vlc] / modules / mux / mpeg / ps.c
index a333dc087fe87d69e9175e4277b5ee8d81cfa36e..eff0bd0f7f2b96d3acde29d9f66d003971aae1bd 100644 (file)
@@ -2,7 +2,7 @@
  * ps.c: MPEG PS (ISO/IEC 13818-1) / MPEG SYSTEM (ISO/IEC 1172-1)
  *       multiplexer module for vlc
  *****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
+ * Copyright (C) 2001, 2002 the VideoLAN team
  * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>
 
 #include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/sout.h>
+#include <vlc_sout.h>
+#include <vlc_codecs.h>
+#include <vlc_block.h>
 
-#include "codecs.h"
 #include "bits.h"
 #include "pes.h"
 
  * Module descriptor
  *****************************************************************************/
 #define DTS_TEXT N_("DTS delay (ms)")
-#define DTS_LONGTEXT N_("This option will delay the DTS (decoding time " \
+#define DTS_LONGTEXT N_("Delay the DTS (decoding time " \
   "stamps) and PTS (presentation timestamps) of the data in the " \
   "stream, compared to the SCRs. This allows for some buffering inside " \
   "the client decoder.")
 
 #define PES_SIZE_TEXT N_("PES maximum size")
-#define PES_SIZE_LONGTEXT N_("This option will set the maximum allowed PES "\
-  "size when producing the MPEG PS stream.")
+#define PES_SIZE_LONGTEXT N_("Set the maximum allowed PES "\
+  "size when producing the MPEG PS streams.")
 
 static int     Open   ( vlc_object_t * );
 static void    Close  ( vlc_object_t * );
@@ -122,7 +121,7 @@ struct sout_mux_sys_t
     int i_system_header;
     int i_dts_delay;
     int i_rate_bound; /* units of 50 bytes/second */
-    
     int64_t i_instant_bitrate;
     int64_t i_instant_size;
     int64_t i_instant_dts;
@@ -149,7 +148,7 @@ static int Open( vlc_object_t *p_this )
     vlc_value_t val;
 
     msg_Info( p_mux, "Open" );
-    sout_CfgParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
+    config_ChainParse( p_mux, SOUT_CFG_PREFIX, ppsz_sout_options, p_mux->p_cfg );
 
     p_mux->pf_control   = Control;
     p_mux->pf_addstream = AddStream;
@@ -260,7 +259,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
 {
     sout_mux_sys_t  *p_sys = p_mux->p_sys;
     ps_stream_t *p_stream;
-    
 
     msg_Dbg( p_mux, "adding input codec=%4.4s",
              (char*)&p_input->p_fmt->i_codec );
@@ -344,7 +343,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
     p_sys->i_instant_bitrate += p_input->p_fmt->i_bitrate + 1000/* overhead */;
 
     /* FIXME -- spec requires  an upper limit rate boundary in the system header;
-       our codecs are VBR; using 2x nominal rate, convert to 50 bytes/sec */ 
+       our codecs are VBR; using 2x nominal rate, convert to 50 bytes/sec */
     p_sys->i_rate_bound += p_input->p_fmt->i_bitrate * 2 / (8 * 50);
     p_sys->i_psm_version++;
 
@@ -606,7 +605,7 @@ static void MuxWritePackHeader( sout_mux_t *p_mux, block_t **p_buf,
 
     if( p_sys->b_mpeg2 )
     {
-        bits_write( &bits, 9,  0 ); // src extention
+        bits_write( &bits, 9,  0 ); // src extension
     }
     bits_write( &bits, 1,  1 );     // marker
 
@@ -664,7 +663,7 @@ static void MuxWriteSystemHeader( sout_mux_t *p_mux, block_t **p_buf,
     bits_write( &bits, 32, 0x01bb );
     bits_write( &bits, 16, 12 - 6 + i_nb_stream * 3 );
     bits_write( &bits, 1,  1 ); // marker bit
-    bits_write( &bits, 22, i_rate_bound); 
+    bits_write( &bits, 22, i_rate_bound);
     bits_write( &bits, 1,  1 ); // marker bit
 
     bits_write( &bits, 6,  p_sys->i_audio_bound );
@@ -815,7 +814,7 @@ static int MuxGetStream( sout_mux_t *p_mux, int *pi_stream, mtime_t *pi_dts )
         sout_input_t *p_input = p_mux->pp_inputs[i];
         block_t *p_data;
 
-        if( p_input->p_fifo->i_depth <= 0 )
+        if( block_FifoCount( p_input->p_fifo ) <= 0 )
         {
             if( p_input->p_fmt->i_cat == AUDIO_ES ||
                 p_input->p_fmt->i_cat == VIDEO_ES )