Commit Graph

3314 Commits

Author SHA1 Message Date
Moritz Bunkus
4684ba868e Update to the Simplified Chinese translation. 2009-05-17 13:29:59 +02:00
Moritz Bunkus
d102d760a5 Drop surplus timecodes of dropped frames after flushing the frame queue when converting from VfW to native MPEG-4 part 2 storage.
Fix for bug 236.
2009-05-17 12:14:36 +02:00
Moritz Bunkus
842fdee9ba Honor the '--redirect-output' in the 'chapters', 'cuesheet' and 'tags' extraction modes. 2009-05-16 19:30:05 +02:00
Moritz Bunkus
9cfd365b50 Always write the BOM at the start of the file. 2009-05-16 19:22:44 +02:00
Moritz Bunkus
13d44e0db7 Wrong name for the variable. 2009-05-16 19:07:35 +02:00
Moritz Bunkus
8de10df229 Made the mm_io_c object responsible for standard output globally available. 2009-05-16 19:06:25 +02:00
Moritz Bunkus
5c2dd90f0e Updated the Japanese translation. 2009-05-16 17:40:53 +02:00
Moritz Bunkus
db7e9b9471 Fixed a typo. 2009-05-16 17:40:25 +02:00
Moritz Bunkus
ba82e6bf3e Added the new hack vobsub_subpic_stop_cmds to mmg including a description. 2009-05-16 16:21:05 +02:00
Moritz Bunkus
45e41550b5 Added a hack for adding "stop displaying" commands to certain VobSub subtitle packets.
Patch by Todd Schmuland.

Explanation by Todd Schmuland:

I own a WDTV.  So far it's the only hardware media player that can
handle VobSub subtitles.  It's not perfect however.  One major flaw it
has is not displaying subtitles that have no SPU duration embedded in
them (the cause of the vobsub_reader: Could not extract the duration
for a SPU packet).  The normal behavior a player should do is display
the subtitle frame until the next subtitle is displayed, but the WDTV
simply chooses to not display the subtitle at all.

So I wrote a hack --engage vobsub_subpic_stop_cmds that writes in a
Stop Display command into these packets.  The end result is that the
WDTV displays the subtitles now.  There is a slight flicker if the two
subtitle frames are the same, but it's a lot better than not seeing
the subtitle at all.  Since this is adding SPU content not in the
original VobSub, I used the hacks mechanism to implement it.
Hopefully WD will properly handle VobSub subtitle frames with no Stop
Display command in a future firmware update, but until then I'll use
this hack.
2009-05-16 16:03:57 +02:00
Moritz Bunkus
dbf8e376a2 Split up the files src/common/mpeg4.{h,cpp} and src/output/p_video.{h,cpp} into several ones by topic/type. 2009-05-16 11:39:40 +02:00
Moritz Bunkus
482f91bca2 Set the output file name automatically for each file added as long as it is not changed manually.
Fix for bug 229.
2009-05-15 09:40:22 +02:00
Moritz Bunkus
ecda4f805f Made the comments a bit clearer. 2009-05-14 22:27:20 +02:00
Moritz Bunkus
938d4ead50 Improved support for QuickTime audio tracks with version 2 of the STSD sound descriptor. 2009-05-14 22:09:47 +02:00
Moritz Bunkus
e5cce2b37e Avoid compiler warnings by actually checking the return value of fgets(). 2009-05-14 19:18:27 +02:00
Moritz Bunkus
18c1c8086d Avoid a compiler warning due to glibc having flagged 'nice' with 'warn if return value is ignored'. 2009-05-14 19:15:22 +02:00
Moritz Bunkus
93f826dd4e Enable the "remove all" button if there are files left to be removed. 2009-05-14 09:28:03 +02:00
Moritz Bunkus
2b1b065840 Try to detect invalid padding packet lengths in MPEG program streams.
Patch by Todd Schmuland (see AUTHORS).

His explanation:

I was muxing a DVD and mkvmerge complained about losing sync while
parsing the vob.  I checked to see what was happening and discovered
the length of a 00 00 01 BE padding packet was way too long.  This
resulted in several packets being skipped over and therefore caused a
gap in the resulting mkv.  I've seen this before where the packet
length specified in a 00 00 01 BE padding packet is incorrect.

I've made adjustments to the r_mpeg_ps.cpp code to detect when 00 00
01 BE padding packets have the wrong length specified.  Padding
packets should always fill the gap to the next 2048 (800 hex) page in
the file.  Now the code will detect lengths that are way too long, or
lengths that are just under or just over what they should be, and
correct it.

I also changed it so that with one -v switch, you won't get 100s of
mpeg_ps: parse_packet failed messages anymore.  Adjusted padding
packet lengths will be indicated with one -v switch, but now good 00
00 01 BE padding stream packets and 00 00 01 BF private 2 stream
packets won't be output as failing anymore.

I was finally able to get a good mkv mux of the DVD with the attached
r_mpeg_ps.cpp file.

I just did another DVD and it had a similar bad padding stream packet.
Packet length in vob was 44036 but should only be 1918.  The new
r_mpeg_ps detected and corrected it, whereas the old code would have
skipped (44036-1918)/2048 = ~21 good packets of video/audio.
2009-05-14 09:20:39 +02:00
Moritz Bunkus
9f3672eda8 Updated the simplified Chinese translation. 2009-05-14 09:12:32 +02:00
Moritz Bunkus
9a52aab580 Only print the "chapter charset missing" warning if the title or chapter information is actually used. 2009-05-14 09:11:48 +02:00
Moritz Bunkus
df9ef4005d Allow the use of the 'no chapters' checkbox for OGM files, too. 2009-05-14 08:59:12 +02:00
Moritz Bunkus
0b981e9ae3 Fixed a small memory leak. 2009-05-13 22:53:02 +02:00
Moritz Bunkus
f9dd69c1f3 Updated the Japanese translation. 2009-05-13 22:06:11 +02:00
Moritz Bunkus
2c5d10a971 Enable the "no chapters" checkbox for MP4 files as well. 2009-05-13 20:25:58 +02:00
Moritz Bunkus
8c7d0a737b The VobSub extraction was made more compatible with most applications.
Fix for bug 245. Patch by Todd Schmuland (see AUTHORS).

Explanation from Todd:

I tried using mkvextract to get VobSub tracks out of a mkv to make sure I
muxed in the correct subtitle stream.  What I noticed is that programs like
Subtitle Creator and VobSubStrip would error out on one particular sub file.
 After looking into it, the issue is in how mkvextract handles padding
lengths of 1 to 7.

There are two methods, the one mkvextract currently uses is to use the 00 00
01 BA packet where the 3 least significant bits of the last header byte
indicate how many padding FF bytes follow. There's nothing wrong with this,
however, many programs don't decode this properly and error out since they
are expecting the next bytes to be 00 00 01.

The other method is to pad the 00 00 01 BD packet header with FF bytes and
simply increase the header length byte to include the pad count.  For
example where padding = 5:
method 1
00 00 01 BA 44 32 4C 46 44 01 01 89 C3 FD FF FF FF FF FF
00 00 01 BD 07 E7 81 80 05 21 0C 93 11 91 <payload>

becomes

method 2
00 00 01 BA 44 32 4C 46 44 01 01 89 C3 F8
00 00 01 BD 07 EC 81 80 0A 21 0C 93 11 91 FF FF FF FF FF <payload>

Notice the 00 00 01 BD total packet length increased from 07E7 to 07EC and
the packet header length increased from 05 to 0A.  The benefit of this is
that the 00 00 01 BD header length includes the pad length with no
additional work by a program's decoder, so the SUB file is always properly
parsed while decoding.  In fact the DVD this particular VobSub came from
used method 2.
2009-05-13 20:02:19 +02:00
Moritz Bunkus
51308541ce Fixed wrong UTF8 char in name. 2009-05-13 19:59:28 +02:00
Moritz Bunkus
844d2fe3f6 Fixed support for code pages not supported by iconv on Windows.
Some Windows installation use code pages as its ANSI code page
that are not supported by the iconv library (e.g. code page 720).
These have to be converted using Windows' own MultiByteToWideChar
and WideCharToMultiByte functions.

Fix for bug 376.
2009-05-13 19:18:30 +02:00
Moritz Bunkus
a990d120d1 Fix compilation with mingw. 2009-05-13 18:01:33 +02:00
Moritz Bunkus
10e3b7f152 Missing initialization. 2009-05-13 17:58:09 +02:00
Moritz Bunkus
5247e44d2f Cosmetics. 2009-05-13 14:06:11 +02:00
Moritz Bunkus
03e4b92b15 Fix compilation of the tools. 2009-05-13 12:41:57 +02:00
Moritz Bunkus
5119a6bef9 Rewrote the utf8 conversion functions into classes.
Windows support is still missing; will not even compile.
2009-05-13 12:25:20 +02:00
Moritz Bunkus
8f163ab7a9 Fix compilation if FLAC is not available. 2009-05-12 21:14:57 +02:00
Moritz Bunkus
8f289cee85 Added an option to the --sync arg that causes mkvmerge to start the timecodes of the given track at 0 even if the source container might suggest otherwise. 2009-05-12 21:00:12 +02:00
Moritz Bunkus
fde784aca4 Removed "--delay" from the command line help. 2009-05-12 20:01:43 +02:00
Moritz Bunkus
328c700f0e Update to the translations. 2009-05-12 18:47:24 +02:00
Moritz Bunkus
503f2f9d39 Added support for MPEG-1/-2 video in AVI files.
Fix for bug 388.
2009-05-12 18:37:01 +02:00
Moritz Bunkus
3361c96032 Added documentation for the "--apend-mode" option. 2009-05-12 10:15:56 +02:00
Moritz Bunkus
8d7774aff5 Fixed segfaults when appending Dirac, VC-1 and DTS track types.
generic_packetizer_c::set_headers() must not be called for appended
files. If it is not called then track_entry is NULL before
generic_packetizer_c::connect() is called. Therefore appended files
must not use track_entry; calls to generic_packetizer_c::set_headers()
hint at wrong usage.
2009-05-11 23:26:33 +02:00
Moritz Bunkus
038ed86534 A small speed improvement for the memory_slice_c class and therefore to all classes using it extensively (e.g. the MPEG program stream parser). 2009-05-11 22:25:52 +02:00
Moritz Bunkus
e6900f2906 No need to set variables twice. 2009-05-11 21:36:57 +02:00
Moritz Bunkus
7708969419 Deconstruct global variables in a predefined way.
Otherwise the mm_file_io_c might be destructed before the m_dev_urandom
object resulting in invalid memory access when checking for fadvised
files in the destructor of mm_file_io_c.
2009-05-11 21:16:19 +02:00
Moritz Bunkus
497500053d Updates to the Japanese and simplified Chinese translations. 2009-05-11 09:49:02 +02:00
Moritz Bunkus
7bd47a45ea Output a friendly error message instead of crashing if a file is locked. 2009-05-10 23:56:43 +02:00
Moritz Bunkus
32174e37e3 Patch the SPU length field if it differs from the packet length.
There are often off-by-one cases in which the SPU length field is larger
than the actual packet. Most playback applications ignore that error
when reading external VobSub files but skip the whole packet if it comes
from a Matroska file.

Fix for bug 383.
2009-05-10 22:39:47 +02:00
Moritz Bunkus
a4f3f87077 Let the user change the chapter charset for MP4 files with the "--chapter-charset" option. 2009-05-10 21:33:51 +02:00
Moritz Bunkus
879b5a18c8 Sort chapters by their timecodes. 2009-05-10 21:11:42 +02:00
Moritz Bunkus
c2944caf29 Seek back to the beginning of the file before parsing headers.
Otherwise the line number count will be off because the reader
tries to parse the version line before handing off to
parse_headers();.
2009-05-10 19:39:58 +02:00
Moritz Bunkus
87ee063eb8 The timecodes are already scaled to nanoseconds; no need to scale them again during output. 2009-05-10 19:31:55 +02:00
Moritz Bunkus
c68f41b435 Intentional change due to 8a072ba704 2009-05-10 18:59:08 +02:00