Ticket #5150: programs_mythtranscode_replex_replex.c-check-save_read-count-in-replex_fill_buffers-ticket-5150.2.patch

File programs_mythtranscode_replex_replex.c-check-save_read-count-in-replex_fill_buffers-ticket-5150.2.patch, 975 bytes (added by Erik Hovland <erik@…>, 12 years ago)

Fresh patch for old ticket.

  • mythtv/programs/mythtranscode/replex/replex.c

    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.
    ---
    
     mythtv/programs/mythtranscode/replex/replex.c |    9 +++++----
     1 files changed, 5 insertions(+), 4 deletions(-)
    
    
    diff --git a/mythtv/programs/mythtranscode/replex/replex.c b/mythtv/programs/mythtranscode/replex/replex.c
    index 103bec2..7397b34 100644
    a b int replex_fill_buffers(struct replex *rx, uint8_t *mbuf) 
    15741574       
    15751575#define MAX_TRIES 5
    15761576                while (count < rsize && tries < MAX_TRIES){
    1577                         if ((re = save_read(rx,buf+i,rsize-i)+i)<0)
    1578                                 perror("reading");
    1579                         else
    1580                                 count += re;
     1577                        if ((re = save_read(rx,buf+i,rsize-i))<0){
     1578                                fprintf(stderr,"save_read failed\n");
     1579                                return -1;
     1580                        } else
     1581                                count += (re+i);
    15811582                        tries++;
    15821583                       
    15831584                        if (!rx->vpid || !(rx->apidn || rx->ac3n)){