From 015a50bafde606b6125aca8681893932e8e94a26 Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari Date: Mon, 7 Jul 2014 17:45:12 +0530 Subject: [PATCH] put wtv specific dump in WTV_DEBUG macro --- src/ccextractor.c | 6 +++++- src/constants.h | 2 ++ src/general_loop.c | 3 ++- src/params.c | 4 ++++ src/params_dump.c | 4 ++++ src/stream_functions.c | 2 ++ src/timing.c | 2 ++ 7 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/ccextractor.c b/src/ccextractor.c index 0688c3ca..5fe45e74 100644 --- a/src/ccextractor.c +++ b/src/ccextractor.c @@ -614,9 +614,11 @@ int main(int argc, char *argv[]) case CCX_SM_MP4: mprint ("\rFile seems to be a MP4\n"); break; +#ifdef WTV_DEBUG case CCX_SM_HEX_DUMP: mprint ("\rFile seems to be an hexadecimal dump\n"); break; +#endif case CCX_SM_MYTH: case CCX_SM_AUTODETECT: fatal(EXIT_BUG_BUG, "Cannot be reached!"); @@ -693,10 +695,12 @@ int main(int argc, char *argv[]) close_input_file(); // No need to have it open. GPAC will do it for us processmp4 (inputfile[0]); break; +#ifdef WTV_DEBUG case CCX_SM_HEX_DUMP: close_input_file(); // processhex will open it in text mode - processhex (inputfile[0]); + processhex (inputfile[0]); break; +#endif case CCX_SM_AUTODETECT: fatal(EXIT_BUG_BUG, "Cannot be reached!"); break; diff --git a/src/constants.h b/src/constants.h index 0b7418ba..902c938e 100644 --- a/src/constants.h +++ b/src/constants.h @@ -173,7 +173,9 @@ enum ccx_stream_mode_enum CCX_SM_RCWT = 5, // Raw Captions With Time, not used yet. CCX_SM_MYTH = 6, // Use the myth loop CCX_SM_MP4 = 7, // MP4, ISO- +#ifdef WTV_DEBUG CCX_SM_HEX_DUMP = 8, // Hexadecimal dump generated by wtvccdump +#endif CCX_SM_WTV = 9, CCX_SM_AUTODETECT = 16 }; diff --git a/src/general_loop.c b/src/general_loop.c index ffda75ac..af2b779f 100644 --- a/src/general_loop.c +++ b/src/general_loop.c @@ -266,6 +266,7 @@ LLONG general_getmoredata(void) return bytesread; } +#ifdef WTV_DEBUG // Hexadecimal dump process void processhex (char *filename) { @@ -425,7 +426,7 @@ void processhex (char *filename) } fclose(fr); } - +#endif // Raw file process void raw_loop () { diff --git a/src/params.c b/src/params.c index 274b71e1..4e8d7dda 100644 --- a/src/params.c +++ b/src/params.c @@ -318,8 +318,10 @@ void set_input_format (const char *format) auto_stream = CCX_SM_RCWT; else if (strcmp (format,"mp4")==0) auto_stream = CCX_SM_MP4; +#ifdef WTV_DEBUG else if (strcmp (format,"hex")==0) auto_stream = CCX_SM_HEX_DUMP; +#endif else fatal (EXIT_MALFORMED_PARAMETER, "Unknown input file format: %s\n", format); } @@ -391,7 +393,9 @@ void usage (void) mprint (" bin -> CCExtractor's own binary format.\n"); mprint (" raw -> For McPoodle's raw files.\n"); mprint (" mp4 -> MP4/MOV/M4V and similar.\n"); +#ifdef WTV_DEBUG mprint (" hex -> Hexadecimal dump as generated by wtvccdump.\n"); +#endif mprint (" -ts, -ps, -es, -mp4, -wtv and -asf (or --dvr-ms) can be used as shorts.\n\n"); mprint ("Output formats:\n\n"); mprint (" -out=format\n\n"); diff --git a/src/params_dump.c b/src/params_dump.c index 2e46aed0..298f9051 100644 --- a/src/params_dump.c +++ b/src/params_dump.c @@ -56,9 +56,11 @@ void params_dump(void) case CCX_SM_MP4: mprint ("MP4"); break; +#ifdef WTV_DEBUG case CCX_SM_HEX_DUMP: mprint ("Hex"); break; +#endif default: fatal (EXIT_BUG_BUG, "BUG: Unknown stream mode.\n"); break; @@ -283,9 +285,11 @@ void print_file_report(void) case CCX_SM_RCWT: printf("BIN\n"); break; +#ifdef WTV_DEBUG case CCX_SM_HEX_DUMP: printf("Hex\n"); break; +#endif default: break; } diff --git a/src/stream_functions.c b/src/stream_functions.c index 38a80b3d..9573c12f 100644 --- a/src/stream_functions.c +++ b/src/stream_functions.c @@ -30,6 +30,7 @@ void detect_stream_type (void) startbytes[3]==0x20) stream_mode=CCX_SM_WTV; } +#ifdef WTV_DEBUG if (stream_mode==CCX_SM_ELEMENTARY_OR_NOT_FOUND && startbytes_avail>=6) { // Check for hexadecimal dump generated by wtvccdump @@ -42,6 +43,7 @@ void detect_stream_type (void) startbytes[5]=='D') stream_mode= CCX_SM_HEX_DUMP; } +#endif if (stream_mode==CCX_SM_ELEMENTARY_OR_NOT_FOUND && startbytes_avail>=11) { diff --git a/src/timing.c b/src/timing.c index 2d2b7aa6..f8b2cc62 100644 --- a/src/timing.c +++ b/src/timing.c @@ -37,7 +37,9 @@ void set_fts(void) case CCX_SM_MCPOODLESRAW: case CCX_SM_RCWT: case CCX_SM_MP4: +#ifdef WTV_DEBUG case CCX_SM_HEX_DUMP: +#endif dif = 0; break; default: