mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
cosmetics: make some arguments const, "unsigned char"->uint8_t
Mark input-only buffers as const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32652 b3059339-0415-0410-9bf9-f77b7e298cf2 Use uint8_t type instead of unsigned char. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32653 b3059339-0415-0410-9bf9-f77b7e298cf2 Mark input buffer that is never modified as const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32654 b3059339-0415-0410-9bf9-f77b7e298cf2 Mark input-only buffer as const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32655 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
bb4cca9b32
commit
e23bf53fad
@ -862,7 +862,7 @@ static int ty_XDSdecode( char b1, char b2 )
|
||||
// ===========================================================================
|
||||
// Callback from Video Display Processing to put up the OSD
|
||||
// ===========================================================================
|
||||
void ty_processuserdata( unsigned char* buf, int len )
|
||||
void ty_processuserdata( const unsigned char* buf, int len )
|
||||
{
|
||||
int index;
|
||||
|
||||
|
@ -20,6 +20,6 @@
|
||||
#define MPLAYER_DEMUX_TY_OSD_H
|
||||
|
||||
void ty_ClearOSD(int start);
|
||||
void ty_processuserdata(unsigned char *buf, int len);
|
||||
void ty_processuserdata(const unsigned char *buf, int len);
|
||||
|
||||
#endif /* MPLAYER_DEMUX_TY_OSD_H */
|
||||
|
@ -407,7 +407,7 @@ mpeg_header_parser:
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void process_userdata(unsigned char* buf,int len){
|
||||
static void process_userdata(const unsigned char* buf,int len){
|
||||
int i;
|
||||
/* if the user data starts with "CC", assume it is a CC info packet */
|
||||
if(len>2 && buf[0]=='C' && buf[1]=='C'){
|
||||
|
14
sub_cc.c
14
sub_cc.c
@ -182,8 +182,8 @@ static void cc_decode_EIA608(unsigned short int data)
|
||||
{
|
||||
|
||||
static unsigned short int lastcode=0x0000;
|
||||
unsigned char c1 = data & 0x7f;
|
||||
unsigned char c2 = (data >> 8) & 0x7f;
|
||||
uint8_t c1 = data & 0x7f;
|
||||
uint8_t c2 = (data >> 8) & 0x7f;
|
||||
|
||||
if (c1 & 0x60) { /* normal character, 0x20 <= c1 <= 0x7f */
|
||||
if (channel != (selected_channel() & 1))
|
||||
@ -254,7 +254,7 @@ static void cc_decode_EIA608(unsigned short int data)
|
||||
lastcode=data;
|
||||
}
|
||||
|
||||
static void subcc_decode(unsigned char *inputbuffer, unsigned int inputlength)
|
||||
static void subcc_decode(const uint8_t *inputbuffer, unsigned int inputlength)
|
||||
{
|
||||
/* The first number may denote a channel number. I don't have the
|
||||
* EIA-708 standard, so it is hard to say.
|
||||
@ -287,10 +287,10 @@ static void subcc_decode(unsigned char *inputbuffer, unsigned int inputlength)
|
||||
*
|
||||
* until end of packet
|
||||
*/
|
||||
unsigned char *current = inputbuffer;
|
||||
const uint8_t *current = inputbuffer;
|
||||
unsigned int curbytes = 0;
|
||||
unsigned char data1, data2;
|
||||
unsigned char cc_code;
|
||||
uint8_t data1, data2;
|
||||
uint8_t cc_code;
|
||||
int odd_offset = 1;
|
||||
|
||||
while (curbytes < inputlength) {
|
||||
@ -338,7 +338,7 @@ static void subcc_decode(unsigned char *inputbuffer, unsigned int inputlength)
|
||||
}
|
||||
|
||||
|
||||
void subcc_process_data(unsigned char *inputdata,unsigned int len)
|
||||
void subcc_process_data(const uint8_t *inputdata, unsigned int len)
|
||||
{
|
||||
if(!subcc_enabled) return;
|
||||
if(!initialized) subcc_init();
|
||||
|
4
sub_cc.h
4
sub_cc.h
@ -19,9 +19,11 @@
|
||||
#ifndef MPLAYER_SUB_CC_H
|
||||
#define MPLAYER_SUB_CC_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern int subcc_enabled;
|
||||
|
||||
void subcc_init(void);
|
||||
void subcc_process_data(unsigned char *inputdata,unsigned int len);
|
||||
void subcc_process_data(const uint8_t *inputdata, unsigned int len);
|
||||
|
||||
#endif /* MPLAYER_SUB_CC_H */
|
||||
|
Loading…
Reference in New Issue
Block a user