diff options
Diffstat (limited to 'src/input/pnm.c')
-rw-r--r-- | src/input/pnm.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/input/pnm.c b/src/input/pnm.c index 432520f6e..564151279 100644 --- a/src/input/pnm.c +++ b/src/input/pnm.c @@ -15,14 +15,14 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * $Id: pnm.c,v 1.22 2006/06/20 01:46:41 dgp85 Exp $ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * pnm protocol implementation * based upon code from joschka */ +#include <config.h> + #include <unistd.h> #include <stdio.h> #include <sys/socket.h> @@ -45,9 +45,9 @@ #include "pnm.h" #include "libreal/rmff.h" #include "bswap.h" -#include "io_helper.h" -#include "xineutils.h" -#include "xine_internal.h" +#include <xine/io_helper.h> +#include <xine/xineutils.h> +#include <xine/xine_internal.h> #define BUF_SIZE 4096 #define HEADER_SIZE 4096 @@ -92,7 +92,7 @@ struct pnm_s { /* header of rm files */ #define RM_HEADER_SIZE 0x12 -const unsigned char rm_header[]={ +static const unsigned char rm_header[]={ 0x2e, 0x52, 0x4d, 0x46, /* object_id ".RMF" */ 0x00, 0x00, 0x00, 0x12, /* header_size 0x12 */ 0x00, 0x00, /* object_version 0x00 */ @@ -102,7 +102,7 @@ const unsigned char rm_header[]={ /* data chunk header */ #define PNM_DATA_HEADER_SIZE 18 -const unsigned char pnm_data_header[]={ +static const unsigned char pnm_data_header[]={ 'D','A','T','A', 0,0,0,0, /* data chunk size */ 0,0, /* object version */ @@ -169,13 +169,13 @@ static const uint32_t pnm_available_bandwidths[]={14400,19200,28800,33600,34430, 115200,262200,393216,524300,1544000,10485800}; #define PNM_TWENTYFOUR_SIZE 16 -static unsigned char pnm_twentyfour[]={ +static const unsigned char pnm_twentyfour[]={ 0xd5, 0x42, 0xa3, 0x1b, 0xef, 0x1f, 0x70, 0x24, 0x85, 0x29, 0xb3, 0x8d, 0xba, 0x11, 0xf3, 0xd6 }; /* now other data follows. marked with 0x0000 at the beginning */ -int after_chunks_length=6; -unsigned char after_chunks[]={ +static const int after_chunks_length=6; +static const unsigned char after_chunks[]={ 0x00, 0x00, /* mark */ 0x50, 0x84, /* seems to be fixated */ @@ -734,9 +734,7 @@ pnm_t *pnm_connect(xine_stream_t *stream, const char *mrl) { pathbegin=slash-mrl_ptr; hostend=colon-mrl_ptr; - p->host = malloc(sizeof(char)*hostend+1); - strncpy(p->host, mrl_ptr, hostend); - p->host[hostend]=0; + p->host = strndup(mrl_ptr, hostend); if (pathbegin < strlen(mrl_ptr)) p->path=strdup(mrl_ptr+pathbegin+1); if (colon != slash) { |