1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

Write functions used by send_mpeg_*_packet may _not_ modify data

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25701 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2008-01-12 16:05:04 +00:00
parent 16ca65e83a
commit 7172339ff9
4 changed files with 10 additions and 10 deletions

View File

@ -157,7 +157,7 @@ static int get_space(void){
static void dxr2_send_lpcm_packet(unsigned char* data,int len,int id,unsigned int timestamp,int freq_id)
{
extern int write_dxr2(unsigned char *data, int len);
extern int write_dxr2(const unsigned char *data, int len);
if(dxr2_fd < 0) {
mp_msg(MSGT_AO,MSGL_ERR,"DXR2 fd is not valid\n");
@ -176,7 +176,7 @@ static void dxr2_send_lpcm_packet(unsigned char* data,int len,int id,unsigned in
// it should round it down to outburst*n
// return: number of bytes played
static int play(void* data,int len,int flags){
extern int write_dxr2(unsigned char *data, int len);
extern int write_dxr2(const unsigned char *data, int len);
// MPEG and AC3 don't work :-(
if(ao_data.format==AF_FORMAT_MPEG2)

View File

@ -48,7 +48,7 @@ static const unsigned char ps1_header[] = {
static int
send_mpeg_pes_packet_ll(unsigned char *data, int len, int id, uint64_t pts,
int type, unsigned char *header, int header_len,
int align4, int my_write (unsigned char *data, int len))
int align4, int my_write (const unsigned char *data, int len))
{
int ptslen = (pts ? 5 : 0);
int n = 0;
@ -139,7 +139,7 @@ send_mpeg_pes_packet_ll(unsigned char *data, int len, int id, uint64_t pts,
int
send_mpeg_pes_packet (unsigned char *data, int len, int id, uint64_t pts,
int type, int my_write (unsigned char *data, int len))
int type, int my_write (const unsigned char *data, int len))
{
return send_mpeg_pes_packet_ll(data, len, id, pts, type, NULL, 0, 0, my_write);
}
@ -148,7 +148,7 @@ send_mpeg_pes_packet (unsigned char *data, int len, int id, uint64_t pts,
/* Send MPEG <type> PS packet */
int
send_mpeg_ps_packet(unsigned char *data, int len, int id, uint64_t pts, int type,
int my_write (unsigned char *data, int len))
int my_write (const unsigned char *data, int len))
{
if(type == 2)
my_write (ps2_header, sizeof (ps2_header));
@ -161,7 +161,7 @@ send_mpeg_ps_packet(unsigned char *data, int len, int id, uint64_t pts, int type
int
send_mpeg_lpcm_packet(unsigned char* data, int len,
int id, uint64_t pts, int freq_id,
int my_write (unsigned char *data, int len))
int my_write (const unsigned char *data, int len))
{
unsigned char header[7] = {0xA0, 0x07, 0x00, 0x04, 0x0C, 1 | (freq_id << 4), 0x80};
return send_mpeg_pes_packet_ll(data, len, 0xBD, pts, 2, header, sizeof(header), 1, my_write);

View File

@ -27,15 +27,15 @@
/* Send MPEG <type> PES packet */
int send_mpeg_pes_packet (unsigned char *data, int len, int id, uint64_t pts,
int type, int my_write (unsigned char *data, int len));
int type, int my_write (const unsigned char *data, int len));
/* Send MPEG <type> PS packet */
int send_mpeg_ps_packet (unsigned char *data, int len, int id, uint64_t pts,
int type,int my_write (unsigned char *data, int len));
int type,int my_write (const unsigned char *data, int len));
/* Send MPEG 2 LPCM packet */
int send_mpeg_lpcm_packet (unsigned char *data, int len,
int id, uint64_t pts, int freq_id,
int my_write (unsigned char *data, int len));
int my_write (const unsigned char *data, int len));
#endif /* MPEG_PACKETIZER_H */

View File

@ -153,7 +153,7 @@ static char *ucodesearchpath[] = {
static unsigned char dxr2buf[BUF_SIZE];
static unsigned int dxr2bufpos = 0;
int write_dxr2(unsigned char *data, int len)
int write_dxr2(const unsigned char *data, int len)
{
int w = 0;