| 1 | /* |
| 2 | * fix_headers.c |
| 3 | * |
| 4 | * Copyright (C) Peter Schlaile - January 2001 |
| 5 | * |
| 6 | * This file is part of libdv, a free DV (IEC 61834/SMPTE 314M) |
| 7 | * codec. |
| 8 | * |
| 9 | * libdv is free software; you can redistribute it and/or modify it |
| 10 | * under the terms of the GNU Lesser Public License as published by |
| 11 | * the Free Software Foundation; either version 2.1, or (at your |
| 12 | * option) any later version. |
| 13 | * |
| 14 | * libdv is distributed in the hope that it will be useful, but |
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 | * Lesser Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU Lesser Public License |
| 20 | * along with libdv; see the file COPYING. If not, write to |
| 21 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | * |
| 23 | * The libdv homepage is http://libdv.sourceforge.net/. |
| 24 | */ |
| 25 | |
| 26 | #include "libdv/dv_types.h"cxx . . $ `<file>/libdv/dv_types.h`/ |
| 27 | |
| 28 | #include <stdio.h> |
| 29 | #include <stdlib.h> |
| 30 | #include <unistd.h> |
| 31 | #include <string.h> |
| 32 | #include <assert.h> |
| 33 | #include <sys/types.h> |
| 34 | #include <sys/stat.h> |
| 35 | #include <fcntl.h> |
| 36 | #include <time.h> |
| 37 | |
| 38 | #include <libdv/headers.h>cxx . . $ `<file>/libdv/headers.h`/ |
| 39 | |
| 40 | int read_framecxx . . $ read_frame(319757e74fda37e9).(FILEcxx . . $ FILE#* in_fp, unsigned char* frame_buf, int * isPAL) |
| 41 | { |
| 42 | if (freadcxx . . $ fread(738fc8ac1d711e58).(frame_buf, 1, 120000, in_fp ) != 120000) { |
| 43 | return 0; |
| 44 | } |
| 45 | |
| 46 | *isPAL = (frame_buf[3] & 0x80); |
| 47 | |
| 48 | if (*isPAL) { |
| 49 | if (freadcxx . . $ fread(738fc8ac1d711e58).(frame_buf + 120000, 1, 144000 - 120000, in_fp) != |
| 50 | 144000 - 120000) { |
| 51 | return 0; |
| 52 | } |
| 53 | } |
| 54 | return 1; |
| 55 | } |
| 56 | |
| 57 | int maincxx . . $ main(d8e43b79a186046c).(int argc, const char** argv) |
| 58 | { |
| 59 | unsigned char frame_buf[144000]; |
| 60 | int isPAL; |
| 61 | int frame_count = 0; |
| 62 | time_tcxx . . $ time_t# t = timecxx . . $ time(7f38134db6521d23).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!); |
| 63 | int wide = 0; |
| 64 | if (argc == 2 && strcmpcxx . . $ strcmp(5ae29d726ae57f88).(argv[1], "-w") == 0) { |
| 65 | wide = 1; |
| 66 | } |
| 67 | |
| 68 | while (read_framecxx . . $ read_frame(319757e74fda37e9).(stdincxx . . $ `<external>/232824719582829767/stdio.h:157:9`!, frame_buf, &isPAL)) { |
| 69 | _dv_write_meta_datacxx . . $ _dv_write_meta_data(d8030c255064409a).(frame_buf, frame_count++, isPAL, wide, &t); |
| 70 | fwritecxx . . $ fwrite(ab0609fa07c47d6e).(frame_buf, 1, isPAL ? 144000 : 120000, stdoutcxx . . $ `<external>/232824719582829767/stdio.h:158:9`!); |
| 71 | } |
| 72 | return 0; |
| 73 | } |