replex_fill_buffers does something a little strange when checking save_read.

From: Erik Hovland <erik@hovland.org>

I am reworking it so it is readable.
---

 programs/mythtranscode/replex/replex.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/programs/mythtranscode/replex/replex.c b/programs/mythtranscode/replex/replex.c
index dfea4e6..38f1789 100644
--- a/programs/mythtranscode/replex/replex.c
+++ b/programs/mythtranscode/replex/replex.c
@@ -1569,10 +1569,10 @@ int replex_fill_buffers(struct replex *rx, uint8_t *mbuf)
 	
 #define MAX_TRIES 5
 		while (count < rsize && tries < MAX_TRIES){
-			if ((re = save_read(rx,buf+i,rsize-i)+i)<0)
+			if ((re = save_read(rx,buf+i,rsize-i))<0)
 				perror("reading");
 			else 
-				count += re;
+				count += (re+i);
 			tries++;
 			
 			if (!rx->vpid || !(rx->apidn || rx->ac3n)){
@@ -1835,17 +1835,12 @@ void init_replex(struct replex *rx)
 		avi_context *ac;
 		uint8_t buf[AVI_S];
 		int re=0;
-		ssize_t read_count = 0;
 		
 		lseek(rx->fd_in, 0, SEEK_SET);
 		ac = &rx->ac;
 		memset(ac, 0, sizeof(avi_context));
-		if ((read_count = save_read(rx, buf, 12)) != 12) {
-			fprintf(stderr,
-				"Error reading in 12 bytes from replex. Read %d bytes\n",
-				read_count);
-			exit(1);
-		}
+		if (save_read(rx, buf, 12)<0)
+			perror("reading");
 		
 		if (check_riff(ac, buf, 12) < 0){
 			fprintf(stderr, "Wrong RIFF header\n");
