Fix continuation lines in the Makefile so it works.

Fix "if (err = EOF)", which should be a comparison.

Various pedantries (petty stuff):
* Remove compiler warning on use of build_TS_reader_with_fns - this was because
  "char *" is signed on my Mac, whilst "byte *" is not. Fixed by making it
  exepct "byte *", and whilst I'm at it make pcapreport.c use the datatypes from
  compat.h -- not because they're better than the stdint.h type, because they
  clearly aren't, but purely for consistancy (long term, I still want to move
  to stdint types - it should be easier now as we don't need to support ancient
  compilers))
* Reformat pcapreport.c (this is going to make for a big difference, oh well)
  to standard tstools indentation patterns.

--HG--
extra : convert_revision : svn%3Aeff31bef-be4a-0410-a8fe-e47997df2690/trunk%4062
issue20
tibs 2008-09-09 19:01:50 +00:00
rodzic 2b3fb08215
commit 223c96020a
6 zmienionych plików z 573 dodań i 590 usunięć

Wyświetl plik

@ -151,7 +151,7 @@ PROG_OBJS = \
$(OBJDIR)/tsreport.o \
$(OBJDIR)/tsserve.o \
$(OBJDIR)/ts_packet_insert.o \
$(OBJDIR)/m2ts2ts.o
$(OBJDIR)/m2ts2ts.o \
$(OBJDIR)/pcapreport.o
#\
# $(OBJDIR)/test_ps.o
@ -186,7 +186,7 @@ PROGS = \
$(BINDIR)/tsplay \
$(BINDIR)/tsserve \
$(BINDIR)/ts_packet_insert \
$(BINDIR)/m2ts2ts
$(BINDIR)/m2ts2ts \
$(BINDIR)/pcapreport
#\
# $(BINDIR)/test_ps

2
ac3.c
Wyświetl plik

@ -142,7 +142,7 @@ int read_next_ac3_frame(int file,
&data[SYNCINFO_SIZE]);
if (err)
{
if (err = EOF)
if (err == EOF)
fprintf(stderr, "### Unexpected EOF reading rest of AC3 frame\n");
else
fprintf(stderr, "### Error reading rest of AC3 frame\n");

Plik diff jest za duży Load Diff

22
ts.c
Wyświetl plik

@ -1214,13 +1214,13 @@ extern int build_TS_reader(int file,
}
/* Build a TS packet reader using the given functions as
* read() and seek().
/*
* Build a TS packet reader using the given functions as read() and seek().
*
* Returns 0 on success, 1 on failure.
*/
extern int build_TS_reader_with_fns(void *handle,
int (*read_fn)(void *, char *, size_t),
int (*read_fn)(void *, byte *, size_t),
int (*seek_fn)(void *, offset_t),
TS_reader_p *tsreader)
{
@ -1378,17 +1378,13 @@ static int read_next_TS_packets(TS_reader_p tsreader,
while (total < TS_READ_AHEAD_BYTES)
{
if (tsreader->read_fn)
{
length = tsreader->read_fn(tsreader->handle,
&(tsreader->read_ahead[total]),
TS_READ_AHEAD_BYTES-total);
}
length = tsreader->read_fn(tsreader->handle,
&(tsreader->read_ahead[total]),
TS_READ_AHEAD_BYTES-total);
else
{
length = read(tsreader->file,
&(tsreader->read_ahead[total]),
TS_READ_AHEAD_BYTES - total);
}
length = read(tsreader->file,
&(tsreader->read_ahead[total]),
TS_READ_AHEAD_BYTES - total);
if (length == 0) // EOF - no more data to read
break;
else if (length == -1)

Wyświetl plik

@ -55,10 +55,9 @@ struct _ts_reader
void *handle; // handle to pass to read_fn and seek_fn.
/* Reader and seek functions. If these are non-NULL we call them
* when we would call read().
*/
int (*read_fn)(void *, char *, size_t);
// Reader and seek functions. If these are non-NULL we call them
// when we would call read() or seek().
int (*read_fn)(void *, byte *, size_t);
int (*seek_fn)(void *, offset_t);
byte read_ahead[TS_READ_AHEAD_COUNT*TS_PACKET_SIZE];

Wyświetl plik

@ -290,12 +290,13 @@ extern int write_TS_null_packet(TS_writer_p output);
extern int build_TS_reader(int file,
TS_reader_p *tsreader);
/* Build a TS packet reader using given functions to read and
* seek.
/*
* Build a TS packet reader using the given functions as read() and seek().
*
* Returns 0 on success, 1 on failure.
*/
extern int build_TS_reader_with_fns(void *handle,
int (*read_fn)(void *, char *, size_t),
int (*read_fn)(void *, byte *, size_t),
int (*seek_fn)(void *, offset_t),
TS_reader_p *tsreader);