summaryrefslogtreecommitdiffstats
path: root/src/file_mpg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-12-14 21:36:24 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-12-14 21:40:04 +0100
commit3213247d998d58627eb4029afce6be8680de3b30 (patch)
tree96d4a64aca2201410703b5c15589715fe1557aa1 /src/file_mpg.c
parent5de0329f2184bdf89e087f414b651448df096c1f (diff)
PhotoRec: use an enum for values returned by data_check()
rename .m2ts and .ts using pid from header
Diffstat (limited to 'src/file_mpg.c')
-rw-r--r--src/file_mpg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/file_mpg.c b/src/file_mpg.c
index f7135e9..8d9b6bd 100644
--- a/src/file_mpg.c
+++ b/src/file_mpg.c
@@ -42,14 +42,14 @@ const file_hint_t file_hint_mpg= {
.register_header_check=&register_header_check_mpg
};
-static int data_check_mpg(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
+static data_check_t data_check_mpg(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
const unsigned char padding_iso_end[8]= {0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0xB9};
/* search padding + end code */
if(buffer_size>=8 && memcmp(&buffer[buffer_size/2-4], padding_iso_end, sizeof(padding_iso_end))==0)
{
file_recovery->calculated_file_size=file_recovery->file_size+4;
- return 2;
+ return DC_STOP;
}
/* search video sequence end followed by iso end code*/
if(buffer_size>=14)
@@ -61,13 +61,13 @@ static int data_check_mpg(const unsigned char *buffer, const unsigned int buffer
if(buffer[i]==0x00 && memcmp(&buffer[i], sequence_end_iso_end, sizeof(sequence_end_iso_end))==0)
{
file_recovery->calculated_file_size=file_recovery->file_size+i+sizeof(sequence_end_iso_end)-buffer_size/2;
- return 2;
+ return DC_STOP;
}
}
}
/* some files don't end by iso end code, so continue... */
file_recovery->calculated_file_size=file_recovery->file_size+(buffer_size/2);
- return 1;
+ return DC_CONTINUE;
}
static int header_check_mpg_Pack(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)