Opened 10 years ago

Last modified 10 years ago

#1700 new defect

no audio in ts file with demux_ts

Reported by: bernd.paysan@… Owned by: reimar
Priority: normal Component: demuxer
Version: unspecified Severity: normal
Keywords: Cc: compn
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:


This file ("just" 15 Megabytes) has been recorded with a Panasonic HDC-TM700, and makes MPlayer crash - any version I could get hold of. Crash report (with SVN head, debugging enabled) from gdb:

Playing 00039.mts.
TS file format detected.
VIDEO H264(pid=4113) AUDIO A52(pid=4608) NO SUBS (yet)! PROGRAM N. 1

Program received signal SIGSEGV, Segmentation fault.
0x00007fffeff37f2c in ?? () from /lib64/
(gdb) bt
#0 0x00007fffeff37f2c in ?? () from /lib64/
#1 0x00007fffeff35bc9 in memmove () from /lib64/
#2 0x0000000000585d9a in ts_parse (demuxer=<value optimized out>,

es=<value optimized out>, packet=<value optimized out>,
probe=<value optimized out>) at libmpdemux/demux_ts.c:3106

#3 0x00000000005874fc in demux_ts_fill_buffer (demuxer=0xf9afe8,

ds=<value optimized out>) at libmpdemux/demux_ts.c:3313

#4 0x000000000054e37e in ds_fill_buffer (ds=0x1646ac0)

at libmpdemux/demuxer.c:656

#5 0x000000000054e7f4 in demux_pattern_3 (ds=0x1646ac0, mem=0x0,

maxlen=10485760, read=0x7fffffffb7fc, pattern=<value optimized out>)
at libmpdemux/demuxer.c:724

#6 0x0000000000592427 in sync_video_packet (ds=0x1646ac0)

at libmpdemux/parse_es.c:45

#7 0x0000000000594075 in video_read_properties (sh_video=0x167a580)

at libmpdemux/video.c:219

#8 0x0000000000487dd1 in main (argc=23349040, argv=0x1645170)

at mplayer.c:3470

I've started some debugging, and the root cause is an undersized A52 packet. I've added some guarding to the interpretation of this field, to avoid MPlayer to try to copy -1 bytes somewhere (which is really fatal!!!), and the resulting code at least plays the video - the audio stream is discarded (the camera can play it fine, so there must be a way to gloss over this garbled stuff). The patch is vs. SVN head:

Index: libmpdemux/demux_ts.c
--- libmpdemux/demux_ts.c (Revision 31179)
+++ libmpdemux/demux_ts.c (Arbeitskopie)
@@ -1469,8 +1469,9 @@

else if (pes_is_aligned && ((p[0] & 0xE0) == 0x20)) SPU_DVD


+ if(packet_len < 1) fprintf(stderr, "DVD Subs packet length too small\n");

es->start = p+1;

  • es->size = packet_len-1;

+ es->size = packet_len < 1 ? 0 : packet_len-1;

es->type = SPU_DVD;
es->payload_size -= packet_len;

@@ -1478,9 +1479,10 @@

else if (pes_is_aligned && (p[0] & 0xF8) == 0x80)

+ if(packet_len < 4) fprintf(stderr, "A52 packet length too small\n");

es->start = p+4;

  • es->size = packet_len - 4;

+ es->size = packet_len < 4 ? 0 : packet_len - 4;

es->type = AUDIO_A52;
es->payload_size -= packet_len;

Change History (2)

comment:1 Changed 10 years ago by compn

  • Cc patriotact@… added
  • op_sys changed from Linux to All
  • Owner changed from r_togni@… to reimar
  • rep_platform changed from PC (x86_64) to All
  • Severity changed from critical to normal
  • Summary changed from Mplayer crashes when demuxing that file to no audio in ts file with demux_ts

no longer crashes for me, still no audio.

mplayer -demuxer lavf 00039.mts plays audio.

comment:2 Changed 10 years ago by reimar

Both setting tsprobesize (or whatever it is called) as well as trying audio switching at a later point in the file might work.

Note: See TracTickets for help on using tickets.