[mythtv-commits] Ticket #9425: [CRASH] mythtranscode segfault in AudioReencodeBuffer::AddFrames

MythTV noreply at mythtv.org
Tue Mar 1 13:06:56 UTC 2011

#9425: [CRASH] mythtranscode segfault in AudioReencodeBuffer::AddFrames
 Reporter:  timowi <mythtv@…>                  |          Owner:  jyavenard
     Type:  Bug Report                         |         Status:
 Priority:  minor                              |  infoneeded
Component:  MythTV - Mythtranscode             |      Milestone:  unknown
 Severity:  medium                             |        Version:
 Keywords:                                     |  0.24-fixes
                                               |     Resolution:
                                               |  Ticket locked:  0

Comment (by timowi <mythtv@…>):

 I do not have the exact command line I used. Mythtranscode was invoked by
 the mythjobque and crashed every time I tried. I took the same arguments
 as mythtv did. As far as I remember the arguments were starttime +
 channel, profile and honorcutlist.

 The problem is not related to the arguments (ok, does only happen with
 transcoding mpeg->nuv not with mpeg->mpeg). The problem are the video

 I have tracked the problem and I thought I did explain it good enough.
 AddFrames is called more than 128 times at a special case in this file
 (between two frames and between two reads of the buffer). When add Frames
 is called the 128th time *audiobuffer is overwritten by the value written
 to ab_time[128].

 This is cause by some (defect?) recordings. Perhaps missing video frames
 or a problem with the audio track? If I remember correctly the problem was
 at the end of commercials.

 I modified mythtranscode by resizing ab_len, ab_offset, ab_time and
 returning from AddFrames if ab_count is bigger than the length of ab_len[]
 etc. With these changes I had no problems transcoding the recording. With
 these fixes I added some additional output (frame number, video time,
 number of frames in audiobuffer). Almost the complete recording there were
 1-2 frames in the buffer. In some places there were about 10 to 20 frames
 is the buffer. Just in this one place there were about 170 audio frames
 between two video frames.

 I'm not sure where the problem is. Perhaps the Audio frames are needed
 later and ab_len, ab_offset and ab_time should be resized dynamically as
 needed (just as audiobuffer) or perhaps the there is a problem with the
 audio stream and instead of buffering the frames all audio frames should
 be flushed and audio and video resynced afterwards.

 An additional note: I had some problems with audio in transcoded files in
 the past. This happened in some rare cases (five to ten out of 400-600
 recordings). The recording was fine before transcoding (I could watch in
 mythtv and there were no problems with the audio). After transcoding these
 recording had issues with the audio stream. Depending on the player
 (mythtv, vlc, mplayer) either the player crashes at this position, there
 is no audio after this position or there is no a/v sync after this
 position. This my be related to this problem.

Ticket URL: <http://code.mythtv.org/trac/ticket/9425#comment:6>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center

More information about the mythtv-commits mailing list