From a38d57d3ffcfb68ac20bd722c52e07853d661541 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 30 Jun 2007 10:42:33 +0000 Subject: [PATCH] Cosmetics --- src/extract/xtr_vobsub.cpp | 47 +++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/src/extract/xtr_vobsub.cpp b/src/extract/xtr_vobsub.cpp index f0ca9584d..6b9c84042 100644 --- a/src/extract/xtr_vobsub.cpp +++ b/src/extract/xtr_vobsub.cpp @@ -149,42 +149,37 @@ xtr_vobsub_c::handle_frame(memory_cptr &frame, memset(&ps, 0, sizeof(mpeg_ps_header_t)); - ps.pfx[2] = 0x01; - ps.pfx[3] = 0xba; c = timecode * 9 / 100000; - ps.scr[0] = 0x40 | ((uint8_t)(c >> 27) & 0x38) | 0x04 | - ((uint8_t)(c >> 28) & 0x03); - ps.scr[1] = (uint8_t)(c >> 20); - ps.scr[2] = ((uint8_t)(c >> 12) & 0xf8) | 0x04 | - ((uint8_t)(c >> 13) & 0x03); - ps.scr[3] = (uint8_t)(c >> 5); - ps.scr[4] = ((uint8_t)(c << 3) & 0xf8) | 0x04; - ps.scr[5] = 1; + ps.pfx[2] = 0x01; + ps.pfx[3] = 0xba; + ps.scr[0] = 0x40 | ((uint8_t)(c >> 27) & 0x38) | 0x04 | ((uint8_t)(c >> 28) & 0x03); + ps.scr[1] = (uint8_t)(c >> 20); + ps.scr[2] = ((uint8_t)(c >> 12) & 0xf8) | 0x04 | ((uint8_t)(c >> 13) & 0x03); + ps.scr[3] = (uint8_t)(c >> 5); + ps.scr[4] = ((uint8_t)(c << 3) & 0xf8) | 0x04; + ps.scr[5] = 1; ps.muxr[0] = 1; ps.muxr[1] = 0x89; ps.muxr[2] = 0xc3; // just some value - ps.stlen = 0xf8; + ps.stlen = 0xf8; if ((padding < 8) && (first == size)) ps.stlen |= (uint8_t)padding; memset(&es, 0, sizeof(mpeg_es_header_t)); - es.pfx[2] = 1; + es.pfx[2] = 1; es.stream_id = 0xbd; - es.len[0] = (uint8_t)((first + 9) >> 8); - es.len[1] = (uint8_t)(first + 9); - es.flags[0] = 0x81; - es.flags[1] = 0x80; - es.hlen = 5; - es.pts[0] = 0x20 | ((uint8_t)(c >> 29) & 0x0e) | 0x01; - es.pts[1] = (uint8_t)(c >> 22); - es.pts[2] = ((uint8_t)(c >> 14) & 0xfe) | 0x01; - es.pts[3] = (uint8_t)(c >> 7); - es.pts[4] = (uint8_t)(c << 1) | 0x01; - if (NULL == master) - es.lidx = 0x20; - else - es.lidx = stream_id; + es.len[0] = (uint8_t)((first + 9) >> 8); + es.len[1] = (uint8_t)(first + 9); + es.flags[0] = 0x81; + es.flags[1] = 0x80; + es.hlen = 5; + es.pts[0] = 0x20 | ((uint8_t)(c >> 29) & 0x0e) | 0x01; + es.pts[1] = (uint8_t)(c >> 22); + es.pts[2] = ((uint8_t)(c >> 14) & 0xfe) | 0x01; + es.pts[3] = (uint8_t)(c >> 7); + es.pts[4] = (uint8_t)(c << 1) | 0x01; + es.lidx = NULL == master ? 0x20 : stream_id; vmaster->out->write(&ps, sizeof(mpeg_ps_header_t)); if ((padding > 0) && (padding < 8) && (first == size))