/* number of bytes played */ static int play (void *data, int len, int flags) { if (ao_data.format != AF_FORMAT_MPEG2) return 0; send_mpeg_pes_packet (data, len, MPEG_AUDIO_ID, ao_data.pts, 2, ivtv_write); return len; }
// plays 'len' bytes of 'data' // it should round it down to outburst*n // return: number of bytes played static int play(void* data,int len,int flags){ // printf("\nao_mpegpes: play(%d) freq=%d\n",len,freq_id); if(ao_data.format==AF_FORMAT_MPEG2) send_mpeg_pes_packet (data, len, 0x1C0, ao_data.pts, 1, my_ao_write); else { // if(len>2000) len=2000; // printf("ao_mpegpes: len=%d \n",len); send_mpeg_lpcm_packet(data, len, 0xA0, ao_data.pts, freq_id, my_ao_write); } return len; }
/* number of bytes played */ static int play (void *data, int len, int flags) { extern int v4l2_write (unsigned char *data, int len); if (ao_data.format != AF_FORMAT_MPEG2) return 0; send_mpeg_pes_packet (data, len, MPEG_AUDIO_ID, ao_data.pts, 2, v4l2_write); return len; }
// plays 'len' bytes of 'data' // it should round it down to outburst*n // return: number of bytes played static int play(void* data,int len,int flags){ // printf("\nao_mpegpes: play(%d) freq=%d\n",len,freq_id); if(ao_data.format==AF_FORMAT_MPEG2) send_mpeg_pes_packet (data, len, 0x1C0, ao_data.pts, 1, my_ao_write); else { int i; unsigned short *s=data; // if(len>2000) len=2000; // printf("ao_mpegpes: len=%d \n",len); if(ao_data.format==AF_FORMAT_S16_LE || ao_data.format==AF_FORMAT_AC3) for(i=0;i<len/2;i++) s[i]=(s[i]>>8)|(s[i]<<8); // le<->be send_mpeg_lpcm_packet(data, len, 0xA0, ao_data.pts, freq_id, my_ao_write); } return len; }
static void flip_page (void) { if (ivtv_fd < 0) return; if (!pes) return; send_mpeg_pes_packet (pes->data, pes->size, pes->id, pes->timestamp ? pes->timestamp : vo_pts, 2, ivtv_write); /* ensure flip_page() won't be called twice */ pes = NULL; }
static void send_pes_packet(unsigned char* data, int len, int id, int timestamp) { send_mpeg_pes_packet (data, len, id, timestamp, 1, my_write); }