[mythtv-commits] Ticket #5110: Zero length file left after building a seek table for a video.
MythTV
mythtv at cvs.mythtv.org
Mon Oct 13 21:42:40 UTC 2008
#5110: Zero length file left after building a seek table for a video.
--------------------------------------------------+-------------------------
Reporter: mythtv at phipps-hutton.freeserve.co.uk | Owner: ijr
Type: defect | Status: new
Priority: trivial | Milestone: unknown
Component: mythtranscode | Version: unknown
Severity: low | Resolution:
Mlocked: 0 |
--------------------------------------------------+-------------------------
Comment(by simonwalls at yahoo.com):
I've had a look around the source with a view to fixing this, and have
come up with a patch.
Due to the complexity of the command line options of mythtranscode, it
took a while to understand the logic of the options & output file
creation. I think this works OK but would appreciate it being checked
further.
Submitter executes: mythtranscode --mpeg2 --video --buildindex --infile
"$movie"
Problem: Works OK but a zero byte "movie.tmp" file is created in the
current directory.
Looking at the source, mythtranscode's main.cpp calls MPEG2fixup() which
creates the "$movie.tmp" file (mpeg2fix.cpp line 533 in my copy of
0.21-fixes).
Since mythtranscode does not re-write the input file (proved this by
timestamp unchanged), and there is no output file specified, the results
of the MPEG2fixup call must be discarded at exit. However this call cannot
be skipped, as the results are required temporarily to build the
filemarkup table.
The existing code contains a condition to define the output file name (eg.
"movie.tmp") when one is not specified at invocation, otherwise it remains
null. So this patch changes this condition to define the output file as
non-null ("movie.tmp") when the required condition is present.
Furthermore, the map file is created using a filename which is defined by
the output file being present. I have separated the two (using a new
variable out_map_file) and added a further conditional test to prevent the
zero byte ".tmp" file while allowing the .map file to be created.
Tests:
Original mythtranscode
----------------------
./mythtranscode --mpeg2 --buildindex -i /mnt/video/Jet.mpg --video
... no files created. This is the desired result.
./mythtranscode --mpeg2 --buildindex -i /mnt/video/Jet.mpg --video
--outfile temp.mpg
temp.mpg was created (nonzero size). temp.mpg.map was created (nonzero
size). The .mpg file is not wanted.
./mythtranscode --mpeg2 -i /mnt/video/Jet.mpg --video --outfile temp.mpg
temp.mpg (nonzero size) and temp.mpg.map files were both created (nonzero
size). This is the desired result.
Patched mythtranscode
---------------------
./mythtranscode --mpeg2 --buildindex -i /mnt/video/Jet.mpg --video
... no files created. This is the desired result.
./mythtranscode --mpeg2 --buildindex -i /mnt/video/Jet.mpg --video
--outfile temp.mpg
temp.mpg.map was created (nonzero size). This is the desired result.
./mythtranscode --mpeg2 -i /mnt/video/Jet.mpg --video --outfile temp.mpg
temp.mpg (nonzero size) and temp.mpg.map files were both created (nonzero
size). This is the desired result.
Patch is attached.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/5110#comment:1>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list