p_mb->p_picture->i_deccount--;
b_finished = (p_mb->p_picture->i_deccount == 1);
vlc_mutex_unlock( &p_mb->p_picture->lock_deccount );
-//fprintf(stderr, "%d ", p_mb->p_picture->i_deccount);
+//intf_DbgMsg( "%d ", p_mb->p_picture->i_deccount );
/* Test if it was the last block of the picture */
if( b_finished )
{
-//fprintf(stderr, "Image decodee\n");
+//intf_DbgMsg( "Image decodee\n" );
/* Mark the picture to be displayed */
vout_DisplayPicture( p_fifo->p_vpar->p_vout, p_mb->p_picture );
/* Test if it was the last block of the picture */
if( b_finished )
{
-fprintf(stderr, "Image trashee\n");
+ intf_DbgMsg( "Image trashee\n" );
/* Mark the picture to be trashed */
vout_DestroyPicture( p_fifo->p_vpar->p_vout, p_mb->p_picture );
int ptr;
ac3_byte_stream_t * p_byte_stream;
- printf ("sync\n");
+ intf_Msg ("ac3dec: sync\n");
p_byte_stream = ac3_byte_stream (&p_ac3dec->ac3_decoder);
/*
if (p_ac3dec->bsi.acmod > 7)
- dprintf("(downmix) invalid acmod number\n");
+ intf_ErrMsg( "ac3dec: (downmix) invalid acmod number\n" );
*/
/* There are two main cases, with or without Dolby Surround */
case EXP_D15: /* 1 */
for (i = 0; i < ngrps; i++) {
if (exps[i] > 124) {
- fprintf (stderr, "ac3dec debug: invalid exponent\n");
+ intf_ErrMsg ( "ac3dec error: invalid exponent\n" );
return 1;
}
exp_acc += (exps_1[exps[i]] /*- 2*/);
case EXP_D25: /* 2 */
for (i = 0; i < ngrps; i++) {
if (exps[i] > 124) {
- fprintf (stderr, "ac3dec debug: invalid exponent\n");
+ intf_ErrMsg ( "ac3dec error: invalid exponent\n" );
return 1;
}
exp_acc += (exps_1[exps[i]] /*- 2*/);
case EXP_D45: /* 3 */
for (i = 0; i < ngrps; i++) {
if (exps[i] > 124) {
- fprintf (stderr, "ac3dec debug: invalid exponent\n");
+ intf_ErrMsg ( "ac3dec error: invalid exponent\n" );
return 1;
}
exp_acc += (exps_1[exps[i]] /*- 2*/);
group_code = p_ac3dec->bit_stream.buffer >> (32 - 5);
DumpBits (&(p_ac3dec->bit_stream), 5);
if (group_code >= 27) {
- fprintf (stderr, "ac3dec debug: invalid mantissa\n");
+ intf_ErrMsg ( "ac3dec error: invalid mantissa\n" );
}
q_1[ 1 ] = q_1_1[ group_code ];
DumpBits (&(p_ac3dec->bit_stream), 7);
if (group_code >= 125) {
- fprintf (stderr, "ac3dec debug: invalid mantissa\n");
+ intf_ErrMsg ( "ac3dec error: invalid mantissa\n" );
}
q_2[ 1 ] = q_2_1[ group_code ];
DumpBits (&(p_ac3dec->bit_stream), 3);
if (group_code >= 7) {
- fprintf (stderr, "ac3dec debug: invalid mantissa\n");
+ intf_ErrMsg ( "ac3dec error: invalid mantissa\n" );
}
return (q_3[group_code] * exp_lut[exp]);
DumpBits (&(p_ac3dec->bit_stream), 7);
if (group_code >= 121) {
- fprintf (stderr, "ac3dec debug: invalid mantissa\n");
+ intf_ErrMsg ( "ac3dec error: invalid mantissa\n" );
}
q_4[ 0 ] = q_4_1[ group_code ];
DumpBits (&(p_ac3dec->bit_stream), 4);
if (group_code >= 15) {
- fprintf (stderr, "ac3dec debug: invalid mantissa\n");
+ intf_ErrMsg ( "ac3dec error: invalid mantissa\n" );
}
return (q_5[group_code] * exp_lut[exp]);
/* XXX rewrite the byte counting system to reduce overhead */
#if 0
- printf ("skip %d\n",
- p_adec->frame_size - p_adec->bit_stream.total_bytes_read);
+ intf_DbgMsg ( "skip %d\n",
+ p_adec->frame_size - p_adec->bit_stream.total_bytes_read );
#endif
if (p_adec->bit_stream.total_bytes_read > p_adec->frame_size)
/* have to find a synchro point */
adec_byte_stream_t * p_byte_stream;
- printf ( "sync\n" );
+ intf_Msg ( "adec: sync\n" );
p_adec->align = 0;
p_byte_stream = adec_byte_stream ( &p_adec->audio_decoder );
#if 1
for (i = 0; i < (2*1152); i++)
- printf ("%04X\n",(u16)buffer[i]);
+ intf_DbgMsg ( "%04X\n",(u16)buffer[i] );
#endif
}
l_units = ((p_fifo->l_next_frame - p_fifo->l_start_frame) & AOUT_FIFO_SIZE) * (p_fifo->l_frame_size >> (p_fifo->b_stereo));
l_rate = p_fifo->l_rate + ((aout_date - p_fifo->date[p_fifo->l_start_frame]) / 256);
-// fprintf( stderr, "aout debug: %lli (%li);\n", aout_date - p_fifo->date[p_fifo->l_start_frame], l_rate );
+// intf_DbgMsg( "aout debug: %lli (%li);\n", aout_date - p_fifo->date[p_fifo->l_start_frame], l_rate );
InitializeIncrement( &p_fifo->unit_increment, l_rate, p_aout->l_rate );
if ( p_aout->fifo[i_fifo].l_units > l_units )
{
l_buffer_limit = p_aout->l_units /*<< 1*/; /* p_aout->b_stereo == 1 */
-//fprintf(stderr,"l_buffer_limit:%d\n",l_buffer_limit);
+//intf_DbgMsg( "l_buffer_limit:%d\n",l_buffer_limit );
while ( l_buffer < l_buffer_limit )
{
#if SOUND
(s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[COEFF*p_aout->fifo[i_fifo].l_unit+1] );
/*
-//fprintf(stderr,"1deb ");
+//intf_DbgMsg( "1deb " );
l_buffer++;
p_aout->s32_buffer[l_buffer] += (s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[COEFF*p_aout->fifo[i_fifo].l_unit] ) / 2;
p_aout->s32_buffer[l_buffer] += (s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[COEFF*p_aout->fifo[i_fifo].l_unit+1] ) / 2;
l_buffer++;
-//fprintf (stderr,"1fin ");
+//intf_DbgMsg( "1fin" );
*/
#endif
#if DEBUG
-//fprintf(stderr,"p_aout->s32_buffer[l_buffer] 11 : %x (%d)",p_aout->s32_buffer[l_buffer-1],p_aout->s32_buffer[l_buffer-1]);
-fprintf(stderr,"p_aout->fifo %ld\n",COEFF*p_aout->fifo[i_fifo].l_unit);
-fprintf(stderr,"%d - p_aout->s32b %ld\n", l_buffer, (s32) ( ((s16 *)p_aout->fifo[i_fifo].buffer)[COEFF*p_aout->fifo[i_fifo].l_unit] ) );
-//fprintf(stderr,"p_aout->s32_buffer[l_buffer] 12 : %x (%d)\n",p_aout->s32_buffer[l_buffer-1],p_aout->s32_buffer[l_buffer-1]);
+//intf_DbgMsg( "p_aout->s32_buffer[l_buffer] 11 : %x (%d)",p_aout->s32_buffer[l_buffer-1],p_aout->s32_buffer[l_buffer-1] );
+intf_DbgMsg( "p_aout->fifo %ld\n",COEFF*p_aout->fifo[i_fifo].l_unit );
+intf_DbgMsg( "%d - p_aout->s32b %ld\n", l_buffer, (s32) ( ((s16 *)p_aout->fifo[i_fifo].buffer)[COEFF*p_aout->fifo[i_fifo].l_unit] ) );
+//intf_DbgMsg( "p_aout->s32_buffer[l_buffer] 12 : %x (%d)\n",p_aout->s32_buffer[l_buffer-1],p_aout->s32_buffer[l_buffer-1] );
#endif
UPDATE_INCREMENT( p_aout->fifo[i_fifo].unit_increment, p_aout->fifo[i_fifo].l_unit )
{
//#if 0
l_buffer_limit = l_buffer + (p_aout->fifo[i_fifo].l_units /*<< 1*/);
-//fprintf(stderr,"l_buffer_limit:%d\n",l_buffer_limit);
+//intf_DbgMsg( "l_buffer_limit:%d\n",l_buffer_limit );
/* p_aout->b_stereo == 1 */
while ( l_buffer < l_buffer_limit )
{
(s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[COEFF*p_aout->fifo[i_fifo].l_unit+1] );
/*
-//fprintf(stderr,"2deb ");
+//intf_DbgMsg( "2deb " );
l_buffer++;
-//fprintf(stderr,"793 ");
+//intf_DbgMsg( "793 ");
// !!!!!! Seg Fault !!!!!!!
-//fprintf(stderr,"\n p->aout_buffer : %d\t%d\n",p_aout->s32_buffer[l_buffer],COEFF*p_aout->fifo[i_fifo].l_unit);
+//intf_DbgMsg( "\n p->aout_buffer : %d\t%d\n",p_aout->s32_buffer[l_buffer],COEFF*p_aout->fifo[i_fifo].l_unit );
if( COEFF*p_aout->fifo[i_fifo].l_unit < 60000 )
{
p_aout->s32_buffer[l_buffer] += (s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[COEFF*p_aout->fifo[i_fifo].l_unit] ) / 2;
-// fprintf(stderr,"795 ");
+// intf_DbgMsg( "795 ");
p_aout->s32_buffer[l_buffer] += (s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[COEFF*p_aout->fifo[i_fifo].l_unit+1] ) / 2;
-//fprintf(stderr,"797 ");
+//intf_DbgMsg( "797 ");
l_buffer++;
}
-//fprintf(stderr,"2fin ");
+//intf_DbgMsg( "2fin " );
*/
#endif
#if DEBUG
-//fprintf(stderr,"p_aout->s32_buffer[l_buffer] 21 : %x (%d)",p_aout->s32_buffer[l_buffer-1],p_aout->s32_buffer[l_buffer-1]);
-fprintf(stderr,"p_aout->fifo %ld\n",COEFF*p_aout->fifo[i_fifo].l_unit);
-fprintf(stderr,"%d - p_aout->s32b %ld\n", l_buffer, (s32) ( ((s16 *)p_aout->fifo[i_fifo].buffer)[COEFF*p_aout->fifo[i_fifo].l_unit] ) );
-//fprintf(stderr,"p_aout->s32_buffer[l_buffer] 22 : %x (%d)\n",p_aout->s32_buffer[l_buffer-1],p_aout->s32_buffer[l_buffer-1]);
+//intf_DbgMsg( "p_aout->s32_buffer[l_buffer] 21 : %x (%d)",p_aout->s32_buffer[l_buffer-1],p_aout->s32_buffer[l_buffer-1] );
+intf_DbgMsg( "p_aout->fifo %ld\n",COEFF*p_aout->fifo[i_fifo].l_unit );
+intf_DbgMsg( "%d - p_aout->s32b %ld\n", l_buffer, (s32) ( ((s16 *)p_aout->fifo[i_fifo].buffer)[COEFF*p_aout->fifo[i_fifo].l_unit] ) );
+//intf_DbgMsg( "p_aout->s32_buffer[l_buffer] 22 : %x (%d)\n",p_aout->s32_buffer[l_buffer-1],p_aout->s32_buffer[l_buffer-1] );
#endif
UPDATE_INCREMENT( p_aout->fifo[i_fifo].unit_increment, p_aout->fifo[i_fifo].l_unit )
-//fprintf(stderr,"807 ");
+//intf_DbgMsg( "807 ");
if ( p_aout->fifo[i_fifo].l_unit >= /* p_aout->fifo[i_fifo].b_stereo == 1 */
((AOUT_FIFO_SIZE + 1) * (p_aout->fifo[i_fifo].l_frame_size >> 2/*1*/)) )
{
-//fprintf(stderr,"811 ");
+//intf_DbgMsg( "811 ");
p_aout->fifo[i_fifo].l_unit -= /* p_aout->fifo[i_fifo].b_stereo == 1 */
((AOUT_FIFO_SIZE + 1) * (p_aout->fifo[i_fifo].l_frame_size >> 2/*1*/));
}
}
-//fprintf(stderr,"816 ");
+//intf_DbgMsg( "816 ");
l_units -= p_aout->fifo[i_fifo].l_units;
-//fprintf(stderr,"818 ");
+//intf_DbgMsg( "818 ");
vlc_mutex_lock( &p_aout->fifo[i_fifo].data_lock );
-//fprintf(stderr,"820 ");
+//intf_DbgMsg( "820 ");
p_aout->fifo[i_fifo].l_start_frame = p_aout->fifo[i_fifo].l_next_frame;
-//fprintf(stderr,"822 ");
+//intf_DbgMsg( "822 ");
vlc_cond_signal( &p_aout->fifo[i_fifo].data_wait );
-//fprintf(stderr,"824 ");
+//intf_DbgMsg( "824 ");
vlc_mutex_unlock( &p_aout->fifo[i_fifo].data_lock );
-//fprintf(stderr,"826 ");
+//intf_DbgMsg( "826 ");
/* p_aout->fifo[i_fifo].b_start_frame = 1; */
p_aout->fifo[i_fifo].l_next_frame += 1;
-//fprintf(stderr,"829 ");
+//intf_DbgMsg( "829 ");
p_aout->fifo[i_fifo].l_next_frame &= AOUT_FIFO_SIZE;
-//fprintf(stderr,"831 ");
+//intf_DbgMsg( "831 ");
p_aout->fifo[i_fifo].b_next_frame = 0;
//#endif
-//fprintf(stderr,"837 ");
+//intf_DbgMsg( "837 ");
}
-//fprintf(stderr,"838 ");
+//intf_DbgMsg( "838 ");
/* !!!!!!!!!!!!! Seg Fault !!!!!!!!!!!!!!!!! */
}
-//fprintf(stderr,"839 ");
+//intf_DbgMsg( "839 ");
break;
default:
-//fprintf(stderr,"841 ");
+//intf_DbgMsg( "841 ");
intf_DbgMsg("aout debug: unknown fifo type (%i)\n", p_aout->fifo[i_fifo].i_type);
-//fprintf(stderr,"842 ");
+//intf_DbgMsg( "842 ");
break;
}
}
-//fprintf(stderr,"843 ");
+//intf_DbgMsg( "843 ");
vlc_mutex_unlock( &p_aout->fifos_lock );
-//fprintf(stderr,"845 ");
+//intf_DbgMsg( "845 ");
l_buffer_limit = p_aout->l_units /*<< 1*/ ; /* p_aout->b_stereo == 1 */
-//fprintf(stderr,"\nici commence l'envoie sur sb\n");
+//intf_DbgMsg( "\nici commence l'envoi sur sb\n" );
for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ )
{
-//fprintf(stderr,"3deb ");
-//fprintf(stderr,"p_aout->s_32_buffer[l_buffer] : %x (%d)\n",p_aout->s32_buffer[l_buffer],p_aout->s32_buffer[l_buffer]);
+//intf_DbgMsg( "3deb ");
+//intf_DbgMsg( "p_aout->s_32_buffer[l_buffer] : %x (%d)\n",p_aout->s32_buffer[l_buffer],p_aout->s32_buffer[l_buffer] );
((u8 *)p_aout->buffer)[l_buffer] = (u8)( (p_aout->s32_buffer[/*2 **/ l_buffer] / 256) + 128 );
-//fprintf(stderr,"p_aout->buffer[l_buffer] : %x (%d)\n", ((u8 *)p_aout->buffer)[l_buffer], ((u8 *)p_aout->buffer)[l_buffer] );
+//intf_DbgMsg( "p_aout->buffer[l_buffer] : %x (%d)\n", ((u8 *)p_aout->buffer)[l_buffer], ((u8 *)p_aout->buffer)[l_buffer] );
p_aout->s32_buffer[/*2 **/ l_buffer] = 0;
// p_aout->s32_buffer[2 * l_buffer + 1] = 0;
-//fprintf(stderr,"3fin ");
+//intf_DbgMsg( "3fin ");
}
l_bytes = p_aout->p_sys_getbufinfo( p_aout, l_buffer_limit );
p_aout->date = mdate() + ((((mtime_t)(l_bytes / 2 )) * 1000000) / ((mtime_t)p_aout->l_rate)); /* sizeof(u8) << (p_aout->b_stereo) == 2 */
{
case AC3_AUDIO_ES:
- fprintf (stderr, "Start an AC3 decoder\n");
+ intf_Msg( "Start an AC3 decoder\n" );
/* Spawn ac3 thread */
if ( ((ac3dec_thread_t *)(p_input->p_es[i_es_loop].p_dec) =
ac3dec_CreateThread(p_input)) == NULL )
case LPCM_AUDIO_ES:
/* Spawn lpcm thread */
- fprintf (stderr, "Start a LPCM decoder\n");
+ intf_Msg ( "Start a LPCM decoder\n" );
if ( ((lpcmdec_thread_t *)(p_input->p_es[i_es_loop].p_dec) =
lpcmdec_CreateThread(p_input)) == NULL )
{
sendtime = p_synchro->last_pcr_time + p_synchro->delta_clock +
p_synchro->slope * ((ts - p_synchro->last_pcr + (BUF_SIZE+1)*TS_IN_UDP) % ((BUF_SIZE+1)*TS_IN_UDP));
wait = sendtime - mdate();
- //fprintf(stderr,"last PCR Time : %Ld\n", p_synchro->last_pcr_time );
if( wait > 0 )
{
retard_count = 0;
if(wait > 100000)
{
- fprintf( stderr, "Warning : wait time may be too long : %Ld\n", wait );
+ intf_DbgMsg( "input warning: wait time may be too long : %Ld\n", wait );
return;
}
msleep( wait );
if( retard_count == 16 )
{
retard_count = 0;
- //fprintf( stderr, "delay : %Ldms, max delay : %Ldms\n", -wait/1000, -wait_max/1000 );
- fflush(stdout);
}
}
}
if( (next_pcr_time - current_pcr_time < 0) || (next_pcr_time - current_pcr_time > 700000))
{
- fprintf( stderr, "Warning: possible discontinuity\n" );
+ intf_DbgMsg( "input warning: possible discontinuity\n" );
p_synchro->delta_clock = mdate() - next_pcr_time;
}
else
{
- //fprintf(stderr,"next - current : %Ld\n", next_pcr_time - current_pcr_time);
p_synchro->slope = (next_pcr_time - current_pcr_time) /
((next_pcr - ts + (BUF_SIZE+1)*TS_IN_UDP) % ((BUF_SIZE+1)*TS_IN_UDP));
- //fprintf(stderr,"slope : %Ld\n", p_synchro->slope);
}
}
p_ps->association_table[i] = tofind;
p_ps->media_counter[i] = 0;
- fprintf( stderr, "allocated new PID 0x%.2x to stream ID 0x%.2x\n", i, tofind );
+ intf_Msg( "input: allocated new PID 0x%.2x to stream ID 0x%.2x\n", i, tofind );
return ( i );
}
{
if (ps->pes_size < 184) {
- //fprintf(stderr,"[WARNING: small PES]\n");
ts[0] = 0x47; /* sync_byte */
ts[1] = 0x40; /* payload_unit_start_indicator si début de PES */
ts[2] = pid;
ps->pes_type = NO_PES;
ps->ps_data += ps->pes_size;
ps->offset += ps->pes_size;
- //fprintf( stderr, "wrote %i final data (size was 0x%.2x)\n", ps->offset, ps->pes_size);
return;
}
ts[1] = (ps->offset == 0) ? 0x40 : 0x00; /* payload_unit_start_indicator si début de PES */
ts[2] = pid;
- //fprintf( stderr, "checking clock for %.2x while we have %.2x\n", ps->pcr_pid, pid );
- //fprintf( stderr, "offset 0x%.2x, pts 0x%.2x, pid %i \n", ps->offset, ps->has_pts, pid );
if ( (ps->offset == 0) && (ps->has_pts == 0xc0) && (ps->pcr_pid == pid) )
{
(((s64)U16_AT(ps->ps_data + 10) << 14) - (1 << 14)) |
((s64)U16_AT(ps->ps_data + 12) >> 1) );
- //fprintf( stderr, "clock is %lli\n", clock );
ps->has_pts = 0;
extclock = 0x000;
ps->pes_type = NO_PES;
ps->sent_ts++;
- //fprintf( stderr, "wrote 0x%.2x data (size was 0x%.2x)\n", ps->offset, ps->pes_size);
}
- //fprintf(stderr, "[PES size: %i]\n", ps->pes_size);
}
/******************************************************************************
{
int i;
- //fprintf( stderr, "wrote a PAT\n");
-
ts[0] = 0x47; /* sync_byte */
ts[1] = 0x40;
ts[2] = 0x00; /* PID = 0x0000 */
{
int i;
- //fprintf( stderr, "wrote a PMT\n");
-
ts[0] = 0x47; /* sync_byte */
ts[1] = 0x40;
ts[2] = 0x0064; /* PID = 0x0064 */
if(readbytes == 0)
{
- fprintf (stderr,"ps READ ERROR\n");
+ intf_ErrMsg ( "input: ps read error\n");
return -1;
}
p_ps->ps_data = p_ps->ps_buffer;
{
if( p_ps->ps_data[0] || p_ps->ps_data[1] || (p_ps->ps_data[2] != 0x01) )
{
- fprintf (stderr,"Error: not a startcode (0x%.2x%.2x%.2x instead of 0x000001)\n", p_ps->ps_data[0], p_ps->ps_data[1], p_ps->ps_data[2] );
+ intf_ErrMsg ( "input error: not a startcode (0x%.2x%.2x%.2x instead of 0x000001)\n", p_ps->ps_data[0], p_ps->ps_data[1], p_ps->ps_data[2] );
return -1;
}
{
if (p_ps->has_pts)
{
- fprintf(stderr, "found a PTS, at last ...\n");
+ intf_Msg( "input: found a PTS, at last ...\n" );
p_ps->found_pts = 1;
}
else
* End condition not verified, should put a flag in ps_fill
*/
howmany = TS_IN_UDP;
- //fprintf( stderr, "XXX icount = %d\n", (int)i_count );
vlc_mutex_lock( &p_in_data->lock );
while( p_in_data->end == p_in_data->start )
#include <stdio.h>
#include "defs.h"
-#include "int_types.h"
+#include "config.h"
+#include "common.h"
+#include "threads.h"
+#include "mtime.h"
+#include "plugins.h"
+
+#include "intf_msg.h"
+
+//#include "int_types.h"
#include "lpcm_decoder.h"
int lpcm_init (lpcmdec_t * p_lpcmdec)
{
- fprintf (stderr, "LPCM Debug: lpmcm init called\n");
+ intf_DbgMsg( "LPCM Debug: lpmcm init called\n" );
return 0;
}
lpcmdec_thread_t * lpcmdec_CreateThread (input_thread_t * p_input)
{
lpcmdec_thread_t * p_lpcmdec;
- fprintf (stderr, "LPCM Debug: creating lpcm decoder thread\n");
+ intf_DbgMsg ( "LPCM Debug: creating lpcm decoder thread\n" );
/* Allocate the memory needed to store the thread's structure */
if ((p_lpcmdec = (lpcmdec_thread_t *)malloc (sizeof(lpcmdec_thread_t))) == NULL) {
- fprintf (stderr, "LPCM Error: not enough memory for lpcmdec_CreateThread() to create the new thread\n");
+ intf_ErrMsg ( "LPCM Error: not enough memory for lpcmdec_CreateThread() to create the new thread\n" );
return NULL;
}
/* Spawn the lpcm decoder thread */
if (vlc_thread_create(&p_lpcmdec->thread_id, "lpcm decoder", (vlc_thread_func_t)RunThread, (void *)p_lpcmdec)) {
- fprintf (stderr, "LPCM Error: can't spawn lpcm decoder thread\n");
+ intf_ErrMsg ( "LPCM Error: can't spawn lpcm decoder thread\n" );
free (p_lpcmdec);
return NULL;
}
- fprintf (stderr, "LPCM Debug: lpcm decoder thread (%p) created\n", p_lpcmdec);
+ intf_DbgMsg ( "LPCM Debug: lpcm decoder thread (%p) created\n", p_lpcmdec );
return p_lpcmdec;
}
*****************************************************************************/
void lpcmdec_DestroyThread (lpcmdec_thread_t * p_lpcmdec)
{
- fprintf (stderr, "LPCM Debug: requesting termination of lpcm decoder thread %p\n", p_lpcmdec);
+ intf_DbgMsg ( "LPCM Debug: requesting termination of lpcm decoder thread %p\n", p_lpcmdec );
/* Ask thread to kill itself */
p_lpcmdec->b_die = 1;
aout_fifo_t aout_fifo;
lpcm_byte_stream_t * byte_stream;
- fprintf (stderr, "LPCM Debug: initializing lpcm decoder thread %p\n", p_lpcmdec);
+ intf_DbgMsg ( "LPCM Debug: initializing lpcm decoder thread %p\n", p_lpcmdec );
/* Our first job is to initialize the bit stream structure with the
* beginning of the input stream */
return -1;
}
- fprintf (stderr,"LPCM Debug: lpcm decoder thread %p initialized\n", p_lpcmdec);
+ intf_DbgMsg ( "LPCM Debug: lpcm decoder thread %p initialized\n", p_lpcmdec );
return 0;
}
{
int sync;
- fprintf (stderr,"LPCM Debug: running lpcm decoder thread (%p) (pid== %i)\n", p_lpcmdec, getpid());
+ intf_DbgMsg( "LPCM Debug: running lpcm decoder thread (%p) (pid== %i)\n", p_lpcmdec, getpid() );
msleep (INPUT_PTS_DELAY);
vlc_cond_signal (&p_lpcmdec->p_aout_fifo->data_wait);
vlc_mutex_unlock (&p_lpcmdec->p_aout_fifo->data_lock);
- fprintf(stderr, "LPCM Debug: %x\n", *buffer);
+ intf_DbgMsg( "LPCM Debug: %x\n", *buffer );
bad_frame:
}
*****************************************************************************/
static void EndThread (lpcmdec_thread_t * p_lpcmdec)
{
- fprintf (stderr, "LPCM Debug: destroying lpcm decoder thread %p\n", p_lpcmdec);
+ intf_DbgMsg( "LPCM Debug: destroying lpcm decoder thread %p\n", p_lpcmdec );
/* If the audio output fifo was created, we destroy it */
if (p_lpcmdec->p_aout_fifo != NULL) {
/* Destroy descriptor */
free (p_lpcmdec);
- fprintf (stderr, "LPCM Debug: lpcm decoder thread %p destroyed\n", p_lpcmdec);
+ intf_DbgMsg( "LPCM Debug: lpcm decoder thread %p destroyed\n", p_lpcmdec );
}
void lpcm_byte_stream_next (lpcm_byte_stream_t * p_byte_stream)
#if defined(HAVE_DLFCN_H)
if( *p_plugin != NULL )
- return( 0 );
#elif defined(HAVE_IMAGE_H)
if( *p_plugin >= 0 )
- return( 0 );
#endif
+ {
+ return( 0 );
+ }
}
return( -1 );
if( b_aligned ) \
{ \
i_next = *p_from[i_id]; \
- /*printf("%.1x", i_next >> 4);*/ \
p_from[ i_id ]++; \
b_aligned = 0; \
i = i_next >> 4; \
else \
{ \
b_aligned = 1; \
- /*printf("%.1x", i_next & 0xf);*/ \
i = i_next & 0xf; \
}
if( b_aligned ) \
{ \
i_next = *p_from[i_id]; \
- /*printf("%.1x", i_next >> 4);*/ \
p_from[ i_id ]++; \
b_aligned = 0; \
i = (j) + (i_next >> 4); \
else \
{ \
b_aligned = 1; \
- /*printf("%.1x", i_next & 0xf);*/ \
i = (j) + (i_next & 0xf); \
}
#define V_RED_COEF ((int)(1.596 * (1<<SHIFT) / 1.164))
#define V_GREEN_COEF ((int)(-0.813 * (1<<SHIFT) / 1.164))
-#define MMX
-#ifdef MMX
+#ifdef HAVE_MMX
/* hope these constant values are cache line aligned */
static unsigned long long mmx_80w = 0x0080008000800080;
static unsigned long long mmx_10w = 0x1010101010101010;
#define SCALE_HEIGHT( CHROMA, BPP ) \
\
/* If line is odd, rewind 4:2:0 U and V samples */ \
- if( ((CHROMA == 420) || (CHROMA == 422)) && !(i_y & 0x1) ) \
- { \
- p_u -= i_chroma_width; \
- p_v -= i_chroma_width; \
- } \
+ /*if( ((CHROMA == 420) || (CHROMA == 422)) && !(i_y & 0x1) ) */\
+ /*{ */\
+ /* p_u -= i_chroma_width; */\
+ /* p_v -= i_chroma_width; */\
+ /*} */\
\
/* \
* Handle vertical scaling. The current line can be copied or next one \
int i_vertical_scaling; /* vertical scaling type */
int i_x, i_y; /* horizontal and vertical indexes */
int i_scale_count; /* scale modulo counter */
+#ifndef HAVE_MMX
int i_uval, i_vval; /* U and V samples */
int i_red, i_green, i_blue; /* U and V modified samples */
+#endif
int i_chroma_width; /* chroma width */
u16 * p_yuv; /* base conversion table */
+#ifndef HAVE_MMX
u16 * p_ybase; /* Y dependant conversion table */
+#endif
u16 * p_pic_start; /* beginning of the current line for copy */
u16 * p_buffer_start; /* conversion buffer start */
u16 * p_buffer; /* conversion buffer pointer */
p_buffer = b_horizontal_scaling ? p_buffer_start : p_pic;
-#ifndef MMX
+#ifndef HAVE_MMX
/* Do YUV conversion to buffer - YUV picture is always formed of 16
* pixels wide blocks */
i_displaydate = p_vpar->synchro.i_last_display_pts
+ 1000000.0 / (p_vpar->synchro.theorical_fps);
- //fprintf (stderr, " ");
}
decoder_fifo->buffer[decoder_fifo->i_start]->b_has_pts = 0;
- /* else fprintf (stderr, "R ");
- if (dropped) fprintf (stderr, " "); else fprintf (stderr, "* ");
- fprintf (stderr, "%i ", i_coding_type);
- fprintf (stderr, "pts %lli delta %lli\n", i_displaydate, i_displaydate - p_vpar->synchro.i_last_display_pts); */
-
p_vpar->synchro.i_images_since_pts--;
p_vpar->synchro.i_last_display_pts = i_displaydate;
p_vpar->synchro.displayable_b = 0;
#if 0
- fprintf( stderr,
- "I %i P %i (%f) B %i (%f)\n",
+ intf_DbgMsg( "I %i P %i (%f) B %i (%f)\n",
p_vpar->synchro.can_display_i,
p_vpar->synchro.can_display_p,
p_vpar->synchro.displayable_p,
if( p_vpar->synchro.displayable_p * i_delay
< p_vpar->synchro.i_mean_decode_time )
{
- //fprintf( stderr, "trashed a P\n");
+ //intf_ErrMsg( "trashed a P\n" );
return( 0 );
}
if( i_delay < (1 + (p_vpar->synchro.modulo & 0x3))
* p_vpar->synchro.i_mean_decode_time )
{
- //fprintf( stderr, "trashed a B\n");
+ //intf_ErrMsg( "trashed a B\n" );
return( 0 );
}
p_vpar->synchro.i_mean_decode_time =
( 7 * p_vpar->synchro.i_mean_decode_time + i_decode_time ) / 8;
- /* fprintf (stderr,
- "decoding time was %lli\n",
- p_vpar->synchro.i_mean_decode_time); */
+ /* intf_ErrMsg( "decoding time was %lli\n",
+ p_vpar->synchro.i_mean_decode_time ); */
p_vpar->synchro.i_fifo_start = (p_vpar->synchro.i_fifo_start + 1) & 0xf;
#if 0
static mtime_t i_delta = 0;
- fprintf( stderr,
- "displaying type %i with delay %lli and delta %lli\n",
+ intf_ErrMsg( "displaying type %i with delay %lli and delta %lli\n",
p_vpar->synchro.fifo[p_vpar->synchro.i_fifo_start].i_image_type,
i_displaydate - mdate(),
i_displaydate - i_delta );
- fprintf (stderr,
- "theorical fps: %f - actual fps: %f \n",
+ intf_ErrMsg ( "theorical fps: %f - actual fps: %f \n",
p_vpar->synchro.theorical_fps, p_vpar->synchro.actual_fps );
i_delta = i_displaydate;
{
case I_CODING_TYPE:
-//fprintf( stderr, "p : %d (%d), b : %d (%d)\n", p_vpar->synchro.i_p_count, p_vpar->synchro.i_p_nb,
-// p_vpar->synchro.i_b_count, p_vpar->synchro.i_b_nb );
-
p_vpar->synchro.r_p_average =
(p_vpar->synchro.r_p_average*(SYNC_AVERAGE_COUNT-1)+p_vpar->synchro.i_p_count)/SYNC_AVERAGE_COUNT;
p_vpar->synchro.r_b_average =
mtime_t vpar_SynchroDate( vpar_thread_t * p_vpar )
{
-//fprintf( stderr, "delay : %Ld\n" , mdate() - p_vpar->synchro.i_current_frame_date );
return( p_vpar->synchro.i_current_frame_date );
}