Ticket #5148: programs_mythtranscode_replex_multiplex.c-check-write_video_foo.patch

File programs_mythtranscode_replex_multiplex.c-check-write_video_foo.patch, 1.1 KB (added by Erik Hovland <erik@…>, 16 years ago)

check write_video_ts and write_video_pes

  • programs/mythtranscode/replex/multiplex.c

    write_video_ts and write_video_pes both can return negative values if things don't
    
    From: Erik Hovland <erik@hovland.org>
    
    work out.
    ---
    
     programs/mythtranscode/replex/multiplex.c |    9 +++++++++
     1 files changed, 9 insertions(+), 0 deletions(-)
    
    diff --git a/programs/mythtranscode/replex/multiplex.c b/programs/mythtranscode/replex/multiplex.c
    index 75a99cd..c341e7f 100644
    a b static void writeout_video(multiplex_t *mx) 
    272272                                           mx->SCR, mx->muxr, outbuf, &nlength,
    273273                                           ptsdts, mx->vrbuffer);
    274274
     275        // something bad happened with the PES or TS write, bail
     276        if (written == -1)
     277                return;
     278
    275279        length -= nlength;
    276280        dummy_add(&mx->vdbuf, uptsdiff( viu->dts+mx->video_delay,0)
    277281                  , viu->length-length);
    static void writeout_ext(multiplex_t *mx, int n) 
    420424                break;
    421425        }
    422426
     427        // something bad happened when writing TS or PES to the MPEG or AC3
     428        // audio stream
     429        if (written == -1)
     430                return;
     431
    423432        length -= nlength;
    424433        write(mx->fd_out, outbuf, written);
    425434