Mercurial > mplayer.hg
changeset 25673:d576b679747b
Write functions used by send_mpeg_*_packet may _not_ modify data
author | reimar |
---|---|
date | Sat, 12 Jan 2008 16:05:04 +0000 |
parents | f7151c256b72 |
children | b13f792efe7b |
files | libao2/ao_dxr2.c libmpdemux/mpeg_packetizer.c libmpdemux/mpeg_packetizer.h libvo/vo_dxr2.c |
diffstat | 4 files changed, 10 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/libao2/ao_dxr2.c Sat Jan 12 15:55:52 2008 +0000 +++ b/libao2/ao_dxr2.c Sat Jan 12 16:05:04 2008 +0000 @@ -157,7 +157,7 @@ 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 @@ // 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)
--- a/libmpdemux/mpeg_packetizer.c Sat Jan 12 15:55:52 2008 +0000 +++ b/libmpdemux/mpeg_packetizer.c Sat Jan 12 16:05:04 2008 +0000 @@ -48,7 +48,7 @@ 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 @@ 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 <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 @@ 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);
--- a/libmpdemux/mpeg_packetizer.h Sat Jan 12 15:55:52 2008 +0000 +++ b/libmpdemux/mpeg_packetizer.h Sat Jan 12 16:05:04 2008 +0000 @@ -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 */
--- a/libvo/vo_dxr2.c Sat Jan 12 15:55:52 2008 +0000 +++ b/libvo/vo_dxr2.c Sat Jan 12 16:05:04 2008 +0000 @@ -153,7 +153,7 @@ 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;