Opened 13 years ago
Closed 12 years ago
#7935 closed bug (duplicate)
Text files on NTFS disk are mistakenly marked as MPEG-2 file
Reported by: | Giova84 | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | - General | Version: | R1/alpha3 |
Keywords: | text file as video file on ntfs | Cc: | |
Blocked By: | #9193 | Blocking: | |
Platform: | x86 |
Description
I have a lot of text file inside a folder on a NTFS disk, most of these are mistakenly marked as MPEG-2 file (they are open with mediaplayer). to read them i have to change the file type with "FileType" add-ons.
Attachments (1)
Change History (8)
by , 13 years ago
Attachment: | trouble.png added |
---|
comment:1 by , 13 years ago
I'll bet that all these texts files content starts with a 'G' character. ;-)
comment:2 by , 13 years ago
The culprit is obviously src/data/beos_mime/video/mp2t :
The sniffing rule only check that the first byte is 0x47 ('G'), but in fact a MPEG2 TS has most probably more than just one packet, so we could check that there a second TS packet at expected place instead:
resource(2, "META:SNIFF_RULE") "0.30 ([0] 0x47) ([188] 0x47)";
Could you try, using File Types preferences, to modify your video/mp2t MIME sniffing rule to that new pattern?
This will only handle TS with packet of 188 bytes, but that's the majority. Detecting both 188 and 204 packet sizes should be possible, but I'm not enough skilled in the sniffing rule syntax to have a solution to write a match for (first byte should be 0x47) AND (byte 188 OR byte 204 should be 0x47). If someone knows, feel free.
comment:3 by , 13 years ago
It's so weak in either case, that's it's probably a good idea to remove it completely, and only match by the file's extension.
comment:4 by , 13 years ago
Component: | File Systems/NTFS → - General |
---|---|
Owner: | changed from | to
comment:5 by , 13 years ago
The issue is still present in hrev43375. And yes: if a text file start with the "G" character, the text file is mistakenly marked as Mpeg-2 file.
comment:7 by , 12 years ago
Blocked By: | 9193 added |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Text file (from NTFS disk) marked as MPEG-2 video file