Commit 542c814a authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* More backports:

  [16302]-[16304],[16310],[16317],[16323],[16325],[16327],[16329],[16330]-[16332],[16335],[16344],[16345],[16349],[16350],[16390]-[16394],[16406],[16422],[16423],[16427]-[16429],[16432],[16433],[16437],[16443],[16452],[16453],[16465],[16466],[16475],[16477]

  Skipped some mozilla stuff: 16376,16395,402,403,416,417,418,426,435,440,470,471
  Skipped v4l2, mono filter
parent 1cd58841
......@@ -315,7 +315,7 @@ D: Mac OS X OpenGL video output
S: France
N: Benjamin Pracht
E: bigben@videolan.org
E: bigben+spam@videolan.org
C: bigben
D: MacOS X Interface (playlist)
D: documentation
......
......@@ -1447,8 +1447,8 @@ if test "${enable_shout}" = "yes"; then
PKG_CHECK_MODULES(SHOUT, shout >= 2.1,
[AC_DEFINE(HAVE_SHOUT, [], [Define if you have the libshout library])
VLC_ADD_PLUGINS([access_output_shout])
VLC_ADD_LDFLAGS([vlc access_output_shout],[$SHOUT_LIBS])
VLC_ADD_CFLAGS([vlc access_output_shout],[$SHOUT_CFLAGS])],
VLC_ADD_LDFLAGS([access_output_shout],[$SHOUT_LIBS])
VLC_ADD_CFLAGS([access_output_shout],[$SHOUT_CFLAGS])],
[AC_MSG_WARN(libshout library not found)])
fi
......@@ -4919,30 +4919,12 @@ AC_ARG_ENABLE(gnutls,
[ --enable-gnutls gnutls TLS/SSL support (default enabled)])
AS_IF([test "${enable_gnutls}" != "no"], [
gcrypt_LIBS="-lgpg-error"
AS_IF([test "${SYS}" = "mingw32"], [
gcrypt_LIBS="${gcrypt_LIBS} -lws2_32"
VLC_ADD_LDFLAGS([gnutls],[-lws2_32])
])
gnutls_LIBS="-lgcrypt -lz ${gcrypt_LIBS}"
AS_IF([test "${SYS}" = "darwin"], [
gnutls_LIBS="-lintl ${gnutls_LIBS}"
VLC_ADD_LDFLAGS([gnutls],[-lintl])
])
AC_CHECK_HEADER(gcrypt.h, [
AC_CHECK_LIB(gcrypt, gcry_control, [
AC_CHECK_HEADER(gnutls/gnutls.h, [
AC_CHECK_LIB(gnutls, gnutls_certificate_verify_peers2,
[have_gnutls="yes"],[old_gnutls="yes"],[${gnutls_LIBS}])
])
],,[${gcrypt_LIBS}])
])
PKG_CHECK_EXISTS([gnutls >= 1.0.17], [have_gnutls="yes"], [have_gnutls="no"])
AS_IF([test "${have_gnutls}" = "yes"], [
VLC_ADD_PLUGINS([gnutls])
VLC_ADD_LDFLAGS([gnutls], [-lgnutls ${gnutls_LIBS}])
VLC_ADD_CFLAGS([gnutls], [$("${PKG_CONFIG}" --cflags gnutls)])
VLC_ADD_LDFLAGS([gnutls], [$("${PKG_CONFIG}" --libs gnutls)])
], [
AS_IF([test "${enable_gnutls}" = "yes"], [
AC_MSG_ERROR([gnutls not present or too old (version 1.0.17 required)])
......
......@@ -16,6 +16,7 @@ EXTRA_DIST = \
ChangeLog-2002 \
ChangeLog-2003 \
ChangeLog-2004 \
ChangeLog-2005 \
vlc.1 \
vlc-config.1 \
bugreport-howto.txt \
......
......@@ -31,10 +31,6 @@ extern "C" {
#include <vlc/vlc.h>
#ifndef WIN32
#include <X11/Xlib.h>
#endif
struct libvlc_instance_t
{
vlc_t *p_vlc;
......
......@@ -1138,10 +1138,10 @@ VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) );
# else
# define _(String) dgettext(PACKAGE_NAME, String)
# endif
# define N_(String) ((char*)(String))
# define N_(String) (String)
#else
# define _(String) ((char*)(String))
# define N_(String) ((char*)(String))
# define _(String) (String)
# define N_(String) (String)
#endif
/*****************************************************************************
......
......@@ -201,7 +201,7 @@ static inline void es_format_Init( es_format_t *fmt,
fmt->psz_description = NULL;
fmt->i_extra_languages = 0;
fmt->p_extra_languages = NULL;
fmt->p_extra_languages = NULL;
memset( &fmt->audio, 0, sizeof(audio_format_t) );
memset( &fmt->video, 0, sizeof(video_format_t) );
......@@ -269,7 +269,8 @@ static inline void es_format_Clean( es_format_t *fmt )
if( fmt->i_extra > 0 ) free( fmt->p_extra );
fmt->i_extra = 0; fmt->p_extra = NULL;
if( fmt->video.p_palette ) free( fmt->video.p_palette );
if( fmt->video.p_palette )
free( fmt->video.p_palette );
fmt->video.p_palette = NULL;
if( fmt->subs.psz_encoding ) free( fmt->subs.psz_encoding );
......
......@@ -495,6 +495,8 @@ struct module_symbols_t
vlc_bool_t (*input_AddSubtitles_inner) (input_thread_t *, char *, vlc_bool_t);
int (*utf8_fprintf_inner) (FILE *, const char *, ...);
int (*utf8_vfprintf_inner) (FILE *stream, const char *fmt, va_list ap);
int (*utf8_fprintf_inner) (FILE *, const char *, ...);
int (*utf8_vfprintf_inner) (FILE *stream, const char *fmt, va_list ap);
};
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
......@@ -970,6 +972,8 @@ struct module_symbols_t
# define input_AddSubtitles (p_symbols)->input_AddSubtitles_inner
# define utf8_fprintf (p_symbols)->utf8_fprintf_inner
# define utf8_vfprintf (p_symbols)->utf8_vfprintf_inner
# define utf8_fprintf (p_symbols)->utf8_fprintf_inner
# define utf8_vfprintf (p_symbols)->utf8_vfprintf_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
......@@ -1448,6 +1452,8 @@ struct module_symbols_t
((p_symbols)->input_AddSubtitles_inner) = input_AddSubtitles; \
((p_symbols)->utf8_fprintf_inner) = utf8_fprintf; \
((p_symbols)->utf8_vfprintf_inner) = utf8_vfprintf; \
((p_symbols)->utf8_fprintf_inner) = utf8_fprintf; \
((p_symbols)->utf8_vfprintf_inner) = utf8_vfprintf; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->__stats_CounterGet_deprecated = NULL; \
(p_symbols)->__stats_TimerDumpAll_deprecated = NULL; \
......
......@@ -217,11 +217,12 @@ static inline int vlc_UrlIsNotEncoded( const char *psz_url )
*****************************************************************************
*
*****************************************************************************/
static inline char *vlc_b64_encode( char *src )
static inline char *vlc_b64_encode( const char *src )
{
static const char b64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
size_t len = strlen( src );
const uint8_t *in = (const uint8_t *)src;
char *ret;
char *dst = (char *)malloc( ( len + 4 ) * 4 / 3 );
......@@ -232,38 +233,29 @@ static inline char *vlc_b64_encode( char *src )
while( len > 0 )
{
/* pops (up to) 3 bytes of input */
uint32_t v = *src++ << 24;
/* pops (up to) 3 bytes of input, push 4 bytes */
uint32_t v = *in++ << 24; // 1/3
*dst++ = b64[v >> 26]; // 1/4
v = v << 6;
if( len >= 2 )
{
v |= *src++ << 16;
if( len >= 3 )
v |= *src++ << 8;
}
v |= *in++ << 22; // 2/3
*dst++ = b64[v >> 26]; // 2/4
v = v << 6;
/* pushes (up to) 4 bytes of output */
while( v )
{
*dst++ = b64[v >> 26];
v = v << 6;
}
if( len >= 3 )
v |= *in++ << 20; // 3/3
*dst++ = ( len >= 2 ) ? b64[v >> 26] : '='; // 3/4
v = v << 6;
switch( len )
*dst++ = ( len >= 3 ) ? b64[v >> 26] : '='; // 4/4
len--;
if( len > 0 )
{
case 1:
*dst++ = '=';
*dst++ = '=';
len--;
if( len > 0 )
len--;
break;
case 2:
*dst++ = '=';
len -= 2;
break;
default:
len -= 3;
}
}
......
......@@ -28,6 +28,7 @@
#include <vlc/vlc.h>
#include <vlc/input.h>
#include <vlc_playlist.h>
#include <vlc_input.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -868,6 +868,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
i_out = avcodec_encode_video( p_sys->p_context, (uint8_t*)p_sys->p_buffer_out,
p_sys->p_context->height * p_sys->p_context->width * 3, &frame );
p_context->height * p_context->width * 3, &frame );
if( i_out > 0 )
{
......
......@@ -2200,17 +2200,17 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
{
tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'D', 'I', 'V', '3' );
}
else if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG4/ISO/AVC" ) )
else if( !strncmp( tracks[i_track]->psz_codec, "V_MPEG4/ISO", 11 ) )
{
tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'a', 'v', 'c', '1' );
/* A MPEG 4 codec, SP, ASP, AP or AVC */
if( !strcmp( tracks[i_track]->psz_codec, "V_MPEG4/ISO/AVC" ) )
tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'a', 'v', 'c', '1' );
else
tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' );
tracks[i_track]->fmt.i_extra = tracks[i_track]->i_extra_data;
tracks[i_track]->fmt.p_extra = malloc( tracks[i_track]->i_extra_data );
memcpy( tracks[i_track]->fmt.p_extra,tracks[i_track]->p_extra_data, tracks[i_track]->i_extra_data );
}
else
{
tracks[i_track]->fmt.i_codec = VLC_FOURCC( 'm', 'p', '4', 'v' );
}
}
else if( !strcmp( tracks[i_track]->psz_codec, "V_QUICKTIME" ) )
{
......
......@@ -29,6 +29,7 @@
#include <vlc/input.h>
#include <vlc_playlist.h>
#include <vlc_md5.h>
#include "charset.h"
#include "iso_lang.h"
#include "vlc_meta.h"
......
......@@ -171,13 +171,14 @@ static int Control( demux_t *, int, va_list );
*****************************************************************************/
static int Open ( vlc_object_t *p_this )
{
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
es_format_t fmt;
float f_fps;
char *psz_type;
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
es_format_t fmt;
input_thread_t *p_input;
float f_fps;
char *psz_type;
int (*pf_read)( demux_t *, subtitle_t* );
int i, i_max;
int i, i_max;
if( strcmp( p_demux->psz_demux, "subtitle" ) )
{
......@@ -188,11 +189,12 @@ static int Open ( vlc_object_t *p_this )
p_demux->pf_demux = Demux;
p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
p_sys->psz_header = NULL;
p_sys->i_subtitle = 0;
p_sys->i_subtitles= 0;
p_sys->subtitle = NULL;
p_sys->psz_header = NULL;
p_sys->i_subtitle = 0;
p_sys->i_subtitles = 0;
p_sys->subtitle = NULL;
p_sys->i_microsecperframe = 0;
p_sys->i_original_mspf = 0;
/* Get the FPS */
f_fps = var_CreateGetFloat( p_demux, "sub-fps" );
......@@ -200,19 +202,15 @@ static int Open ( vlc_object_t *p_this )
{
p_sys->i_microsecperframe = (int64_t)( (float)1000000 / f_fps );
}
else
{
p_sys->i_microsecperframe = 0;
}
f_fps = var_CreateGetFloat( p_demux, "sub-original-fps" );
if( f_fps >= 1.0 )
p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
if( p_input )
{
p_sys->i_original_mspf = (int64_t)( (float)1000000 / f_fps );
}
else
{
p_sys->i_original_mspf = 0;
f_fps = var_GetFloat( p_input, "sub-original-fps" );
if( f_fps >= 1.0 )
p_sys->i_original_mspf = (int64_t)( (float)1000000 / f_fps );
vlc_object_release( p_input );
}
/* Get or probe the type */
......@@ -711,6 +709,7 @@ static int ParseMicroDvd( demux_t *p_demux, subtitle_t *p_subtitle )
p_subtitle->i_stop = 0;
p_subtitle->psz_text = NULL;
next:
for( ;; )
{
if( ( s = TextGetLine( txt ) ) == NULL )
......@@ -727,6 +726,15 @@ static int ParseMicroDvd( demux_t *p_demux, subtitle_t *p_subtitle )
break;
}
}
if( i_start == 1 && i_stop == 1 )
{
/* We found a possible setting of the framerate "{1}{1}23.976" */
float tmp = us_strtod( buffer_text, NULL );
if( tmp > 0.0 && !var_GetFloat( p_demux, "sub-fps" ) > 0.0 )
p_sys->i_microsecperframe = (int64_t)( (float)1000000 / tmp );
goto next;
}
/* replace | by \n */
for( i = 0; i < strlen( buffer_text ); i++ )
{
......
......@@ -319,8 +319,10 @@ InterfaceWindow::InterfaceWindow( intf_thread_t * _p_intf, BRect frame,
/* Add the Show menu */
fShowMenu = new BMenu( _("Window") );
#if 0
ADD_ELLIPSIS( _("Playlist") );
fShowMenu->AddItem( new BMenuItem( psz_tmp, new BMessage( OPEN_PLAYLIST ), 'P') );
#endif
ADD_ELLIPSIS( _("Messages") );
fShowMenu->AddItem( new BMenuItem( psz_tmp, new BMessage( OPEN_MESSAGES ), 'M' ) );
ADD_ELLIPSIS( _("Preferences") );
......
......@@ -725,6 +725,21 @@ static VLCMain *_o_sharedMainInstance = nil;
case kRemoteButtonVolume_Minus:
[o_controls volumeDown: self];
break;
case kRemoteButtonRight:
[o_controls next: self];
break;
case kRemoteButtonLeft:
[o_controls prev: self];
break;
case kRemoteButtonRight_Hold:
[o_controls forward: self];
break;
case kRemoteButtonLeft_Hold:
[o_controls backward: self];
break;
case kRemoteButtonMenu:
[o_controls windowAction: self];
break;
default:
/* Add here whatever you want other buttons to do */
......
......@@ -97,7 +97,10 @@ Interpreter::Interpreter( intf_thread_t *pIntf ): SkinObject( pIntf )
VarTree &rVarTree = VlcProc::instance( getIntf() )->getPlaytreeVar();
m_commandMap["playlist.del()"] =
CmdGenericPtr( new CmdPlaytreeDel( getIntf(), rVarTree ) );
m_commandMap["playtree.del()"] =
CmdGenericPtr( new CmdPlaytreeDel( getIntf(), rVarTree ) );
REGISTER_CMD( "playlist.sort()", CmdPlaytreeSort )
REGISTER_CMD( "playtree.sort()", CmdPlaytreeSort )
REGISTER_CMD( "vlc.fullscreen()", CmdFullscreen )
REGISTER_CMD( "vlc.play()", CmdPlay )
REGISTER_CMD( "vlc.pause()", CmdPause )
......
......@@ -439,9 +439,18 @@ void TopWindow::onTooltipChange( const CtrlGeneric &rCtrl )
// Check that the control is the active one
if( m_pLastHitControl && m_pLastHitControl == &rCtrl )
{
// Set the tooltip text variable
VarManager *pVarManager = VarManager::instance( getIntf() );
pVarManager->getTooltipText().set( rCtrl.getTooltipText() );
if( rCtrl.getTooltipText().size() )
{
// Set the tooltip text variable
VarManager *pVarManager = VarManager::instance( getIntf() );
pVarManager->getTooltipText().set( rCtrl.getTooltipText() );
m_rWindowManager.showTooltip();
}
else
{
// Nothing to display, so hide the tooltip
m_rWindowManager.hideTooltip();
}
}
}
......
......@@ -158,7 +158,7 @@ void Win32DragDrop::HandleDrop( HDROP HDrop )
DragQueryFile( HDrop, i, psz_fileName, nameLength );
// Add the file
CmdAddItem cmd( getIntf(), psz_fileName, m_playOnDrop );
CmdAddItem cmd( getIntf(), sFromLocale( psz_fileName ), m_playOnDrop );
cmd.execute();
delete[] psz_fileName;
......
......@@ -23,8 +23,10 @@
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "vlc_meta.h"
#include "vlc_strings.h"
#include "charset.h"
#include "xspf.h"
#include "charset.h"
......
......@@ -84,6 +84,7 @@ struct decoder_sys_t
int i_nal_ref_idc;
int i_idr_pic_id;
int i_frame_num;
int i_frame_type;
};
enum
......@@ -133,6 +134,7 @@ static int Open( vlc_object_t *p_this )
p_dec->fmt_in.i_codec != VLC_FOURCC( 'H', '2', '6', '4') &&
p_dec->fmt_in.i_codec != VLC_FOURCC( 'V', 'S', 'S', 'H') &&
p_dec->fmt_in.i_codec != VLC_FOURCC( 'v', 's', 's', 'h') &&
p_dec->fmt_in.i_codec != VLC_FOURCC( 'D', 'A', 'V', 'C') &&
( p_dec->fmt_in.i_codec != VLC_FOURCC( 'a', 'v', 'c', '1') ||
p_dec->fmt_in.i_extra < 7 ) )
{
......@@ -163,6 +165,7 @@ static int Open( vlc_object_t *p_this )
p_sys->i_nal_ref_idc = -1;
p_sys->i_idr_pic_id = -1;
p_sys->i_frame_num = -1;
p_sys->i_frame_type = 0;
/* Setup properties */
es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
......@@ -477,7 +480,9 @@ static block_t *ParseNALBlock( decoder_t *p_dec, block_t *p_frag )
do { \
p_pic = block_ChainGather( p_sys->p_frame ); \
p_pic->i_length = 0; /* FIXME */ \
p_pic->i_flags |= p_sys->i_frame_type; \
\
p_sys->i_frame_type = 0; \
p_sys->p_frame = NULL; \
p_sys->b_slice = VLC_FALSE; \
\
......@@ -514,7 +519,7 @@ static block_t *ParseNALBlock( decoder_t *p_dec, block_t *p_frag )
else if( i_nal_type >= NAL_SLICE && i_nal_type <= NAL_SLICE_IDR )
{
uint8_t *dec;
int i_dec, i_first_mb, i_slice_type, i_frame_num, i_pic_flags = 0;
int i_dec, i_first_mb, i_slice_type, i_frame_num;
vlc_bool_t b_pic = VLC_FALSE;
bs_t s;
......@@ -529,23 +534,22 @@ static block_t *ParseNALBlock( decoder_t *p_dec, block_t *p_frag )
/* slice_type */
switch( (i_slice_type = bs_read_ue( &s )) )
{
case 0: case 5:
i_pic_flags = BLOCK_FLAG_TYPE_P;
break;
case 1: case 6:
i_pic_flags = BLOCK_FLAG_TYPE_B;
break;
case 2: case 7:
i_pic_flags = BLOCK_FLAG_TYPE_I;
break;
case 3: case 8: /* SP */
i_pic_flags = BLOCK_FLAG_TYPE_P;
break;
case 4: case 9:
i_pic_flags = BLOCK_FLAG_TYPE_I;
break;
case 0: case 5:
p_sys->i_frame_type = BLOCK_FLAG_TYPE_P;
break;
case 1: case 6:
p_sys->i_frame_type = BLOCK_FLAG_TYPE_B;
break;
case 2: case 7:
p_sys->i_frame_type = BLOCK_FLAG_TYPE_I;
break;
case 3: case 8: /* SP */
p_sys->i_frame_type = BLOCK_FLAG_TYPE_P;
break;
case 4: case 9:
p_sys->i_frame_type = BLOCK_FLAG_TYPE_I;
break;
}
p_frag->i_flags |= i_pic_flags;
/* pic_parameter_set_id */
bs_read_ue( &s );
......
......@@ -431,7 +431,10 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
if ( p_sys->i_height || p_sys->i_width )
{
video_format_t fmt_out = {0}, fmt_in = {0};
video_format_t fmt_out, fmt_in;
memset( &fmt_in, 0, sizeof(video_format_t) );
memset( &fmt_out, 0, sizeof(video_format_t) );
fmt_in = p_sys->p_decoder->fmt_out.video;
fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
......
......@@ -51,7 +51,6 @@
#define SOUT_CFG_PREFIX "sout-switcher-"
#define MAX_PICTURES 10
#define MAX_AUDIO 30
#define AVCODEC_MAX_VIDEO_FRAME_SIZE (3*1024*1024)
#define MAX_THRESHOLD 99999999
/*****************************************************************************
......@@ -651,7 +650,7 @@ static void NetCommand( sout_stream_t *p_stream )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
char psz_buffer[10];
int i_len = net_ReadNonBlock( p_stream, p_sys->i_fd, NULL, psz_buffer,
int i_len = net_ReadNonBlock( p_stream, p_sys->i_fd, NULL, (char *)&psz_buffer[0],
sizeof( psz_buffer ), 0 );
if ( i_len > 0 )
......@@ -779,7 +778,7 @@ static mtime_t VideoCommand( sout_stream_t *p_stream, sout_stream_id_t *id )
return 0;
}
id->p_buffer_out = malloc( AVCODEC_MAX_VIDEO_FRAME_SIZE );
id->p_buffer_out = malloc( id->ff_enc_c->width * id->ff_enc_c->height * 3 );
id->p_frame = avcodec_alloc_frame();
id->p_frame->linesize[0] = p_sys->p_pictures[p_sys->i_cmd-1].p[0].i_pitch;
id->p_frame->linesize[1] = p_sys->p_pictures[p_sys->i_cmd-1].p[1].i_pitch;
......@@ -833,7 +832,7 @@ static block_t *VideoGetBuffer( sout_stream_t *p_stream, sout_stream_id_t *id,
}
i_out = avcodec_encode_video( id->ff_enc_c, id->p_buffer_out,
AVCODEC_MAX_VIDEO_FRAME_SIZE,
id->ff_enc_c->width * id->ff_enc_c->height * 3,
id->p_frame );
if ( i_out <= 0 )
......@@ -847,7 +846,7 @@ static block_t *VideoGetBuffer( sout_stream_t *p_stream, sout_stream_id_t *id,
int mb_height = (id->ff_enc_c->height + 15) / 16;
int h_chroma_shift, v_chroma_shift;
int i;
avcodec_get_chroma_sub_sample( id->ff_enc_c->pix_fmt, &h_chroma_shift,
&v_chroma_shift );
......@@ -859,7 +858,7 @@ static block_t *VideoGetBuffer( sout_stream_t *p_stream, sout_stream_id_t *id,
id->ff_enc_c->coded_frame->mb_type,
(mb_width + 1) * mb_height
* sizeof(id->p_frame->mb_type[0]));
for ( i = 0; i < 2; i++ )
{
int stride = ((16 * mb_width )
......@@ -942,4 +941,3 @@ static block_t *AudioGetBuffer( sout_stream_t *p_stream, sout_stream_id_t *id,
return p_out;
}
......@@ -1287,7 +1287,7 @@ static int transcode_audio_new( sout_stream_t *p_stream,
{
msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_aenc );
module_Unneed( id->p_decoder, id->p_decoder->p_module );
id->p_decoder->p_module = 0;
id->p_decoder->p_module = NULL;
return VLC_EGENERIC;
}
id->p_encoder->fmt_in.audio.i_format = id->p_encoder->fmt_in.i_codec;
......@@ -1336,11 +1336,11 @@ static int transcode_audio_new( sout_stream_t *p_stream,
if( fmt_last.audio.i_channels != id->p_encoder->fmt_in.audio.i_channels )
{
msg_Err( p_stream, "no audio filter found for mixing from"
" %i to %i channels", fmt_last.audio.i_channels,
id->p_encoder->fmt_in.audio.i_channels );
#if 0
/* FIXME : this might work, but only if the encoder is restarted */
#if 1
module_Unneed( id->p_encoder, id->p_encoder->p_module );
id->p_encoder->p_module = NULL;
/* This might work, but only if the encoder is restarted */
id->p_encoder->fmt_in.audio.i_channels = fmt_last.audio.i_channels;
id->p_encoder->fmt_out.audio.i_channels = fmt_last.audio.i_channels;
......@@ -1350,7 +1350,30 @@ static int transcode_audio_new( sout_stream_t *p_stream,
id->p_encoder->fmt_out.audio.i_physical_channels =
id->p_encoder->fmt_out.audio.i_original_channels =
fmt_last.audio.i_physical_channels;
msg_Dbg( p_stream, "number of audio channels for mixing changed, "
"trying to reopen the encoder for mixing %i to %i channels",
fmt_last.audio.i_channels,
id->p_encoder->fmt_in.audio.i_channels );
/* reload encoder */
id->p_encoder->p_cfg = p_stream->p_sys->p_audio_cfg;
id->p_encoder->p_module =
module_Need( id->p_encoder, "encoder", p_sys->psz_aenc, VLC_TRUE );
if( !id->p_encoder->p_module )
{
msg_Err( p_stream, "cannot find encoder (%s)", p_sys->psz_aenc );
transcode_audio_close( p_stream, id );
return VLC_EGENERIC;
}
id->p_encoder->fmt_in.audio.i_format = id->p_encoder->fmt_in.i_codec;
id->p_encoder->fmt_in.audio.i_bitspersample =
audio_BitsPerSample( id->p_encoder->fmt_in.i_codec );
#else
msg_Err( p_stream, "no audio filter found for mixing from"
" %i to %i channels", fmt_last.audio.i_channels,
id->p_encoder->fmt_in.audio.i_channels );
transcode_audio_close( p_stream, id );
return VLC_EGENERIC;
#endif
......@@ -1386,12 +1409,12 @@ static void transcode_audio_close( sout_stream_t *p_stream,
/* Close decoder */
if( id->p_decoder->p_module )
module_Unneed( id->p_decoder, id->p_decoder->p_module );
id->p_decoder->p_module = 0;
id->p_decoder->p_module = NULL;
/* Close encoder */
if( id->p_encoder->p_module )
module_Unneed( id->p_encoder, id->p_encoder->p_module );
id->p_encoder->p_module = 0;
id->p_encoder->p_module = NULL;
/* Close filters */
for( i = 0; i < id->i_filter; i++ )
......
......@@ -52,6 +52,11 @@
#include <netinet/in.h>
#include <pthread.h>
#if defined (AF_INET6) && !defined (IPV6_V6ONLY)
# warning Uho, your IPv6 support is broken and has been disabled. Fix your C library.
# undef AF_INET6
#endif
/*#ifndef HAVE_CLEARENV
extern char **environ;
......
......@@ -62,7 +62,10 @@ static picture_t *osd_LoadImage( vlc_object_t *p_this, const char *psz_filename
{
picture_t *p_pic = NULL;
image_handler_t *p_image;
video_format_t fmt_in = {0}, fmt_out = {0};
video_format_t fmt_in, fmt_out;
memset( &fmt_in, 0, sizeof(video_format_t) );
memset( &fmt_out, 0, sizeof(video_format_t) );
fmt_out.i_chroma = VLC_FOURCC('Y','U','V','A');
p_image = image_HandlerCreate( p_this );
......
......@@ -25,21 +25,36 @@
#include <stdio.h>
#include <stdlib.h>
void test_decode (const char *in, const char *out)
typedef char * (*conv_t) (const char *);
static void test (conv_t f, const char *in, const char *out)
{
char *res;
printf ("\"%s\" -> \"%s\" ?\n", in, out);
res = decode_URI_duplicate (in);
res = f (in);
if (res == NULL)
exit (1);
if (strcmp (res, out))
{
printf (" ERROR: got \"%s\"\n", res);
exit (2);
}
free (res);
}
static inline void test_decode (const char *in, const char *out)
{
test (decode_URI_duplicate, in, out);
}
static inline void test_b64 (const char *in, const char *out)
{
test (vlc_b64_encode, in, out);
}
int main (void)
{
(void)setvbuf (stdout, NULL, _IONBF, 0);
......@@ -64,5 +79,12 @@ int main (void)
test_decode ("T%E9l%E9vision", "T?l?vision");
test_decode ("%C1%94%C3%a9l%c3%A9vision", "??élévision"); /* overlong */
/* Base 64 tests */
test_b64 ("", "");
test_b64 ("d", "ZA==");
test_b64 ("ab", "YWI=");
test_b64 ("abc", "YWJj");
test_b64 ("abcd", "YWJjZA==");
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment