/*****************************************************************************
* avi.c
*****************************************************************************
- * 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.
*****************************************************************************/
/*****************************************************************************
*****************************************************************************/
/* TODO: add OpenDML write support */
-#include <stdlib.h>
#include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/sout.h>
-
-#include "codecs.h"
+#include <vlc_sout.h>
+#include <vlc_block.h>
+#include <vlc_codecs.h>
/*****************************************************************************
* Module descriptor
vlc_module_begin();
set_description( _("AVI muxer") );
+ set_category( CAT_SOUT );
+ set_subcategory( SUBCAT_SOUT_MUX );
set_capability( "sout mux", 5 );
add_shortcut( "avi" );
set_callbacks( Open, Close );
char fcc[4];
- mtime_t i_duration; // in µs
+ mtime_t i_duration; // in µs
int i_frames; // total frame count
int64_t i_totalsize; // total stream size
case VLC_FOURCC( 'w', 'm', 'a', '1' ):
p_wf->wFormatTag = WAVE_FORMAT_WMA1;
break;
+ case VLC_FOURCC( 'w', 'm', 'a', ' ' ):
case VLC_FOURCC( 'w', 'm', 'a', '2' ):
p_wf->wFormatTag = WAVE_FORMAT_WMA2;
break;
- case VLC_FOURCC( 'w', 'm', 'a', '3' ):
- p_wf->wFormatTag = WAVE_FORMAT_WMA3;
+ case VLC_FOURCC( 'w', 'm', 'a', 'p' ):
+ p_wf->wFormatTag = WAVE_FORMAT_WMAP;
+ break;
+ case VLC_FOURCC( 'w', 'm', 'a', 'l' ):
+ p_wf->wFormatTag = WAVE_FORMAT_WMAL;
break;
/* raw codec */
case VLC_FOURCC( 'u', '8', ' ', ' ' ):
p_fifo = p_mux->pp_inputs[i]->p_fifo;
i_count = p_fifo->i_depth;
- while( i_count > 0 )
+ while( i_count > 1 )
{
avi_idx1_entry_t *p_idx;
block_t *p_data;
if( p_data->i_buffer & 0x01 )
{
p_data = block_Realloc( p_data, 0, p_data->i_buffer + 1 );
+ p_data->p_buffer[ p_data->i_buffer - 1 ] = '\0';
}
p_sys->i_movi_size += p_data->i_buffer;
}
#endif
-static void bo_AddFCC( buffer_out_t *p_bo, char *fcc )
+static void bo_AddFCC( buffer_out_t *p_bo, const char *fcc )
{
bo_AddByte( p_bo, fcc[0] );
bo_AddByte( p_bo, fcc[1] );
if( p_sys->stream[i_stream].i_duration > 0 )
{
i_maxbytespersec +=
- p_sys->stream[p_sys->i_stream_video].i_totalsize /
- p_sys->stream[p_sys->i_stream_video].i_duration;
+ p_sys->stream[i_stream].i_totalsize /
+ p_sys->stream[i_stream].i_duration;
}
}