[FFmpeg-devel] [PATCH 1/2] avformat/hlsenc: fix hls_write_trailer() on hls_start() failure
Christian Suloway
csuloway at globaleagleent.com
Tue Dec 16 23:09:04 CET 2014
On 12/16/14, 3:23 AM, "Carl Eugen Hoyos" <cehoyos at ag.or.at> wrote:
>Christian Suloway <csuloway <at> row44.com> writes:
>
>> Close segment I/O context and append segment in
>> hls_write_trailer() only when segment I/O context
>> is allocated.
>
>Was this a regression since 25ccf5df?
>(And should be backported to 2.5?)
This does not appear specific to 25ccf5df and goes back to 2.2. Also, the
patch does not cover the mpegtsenc context accessing the null I/O context
from hls_write_trailer or hls_write_packet. I don¹t know if this should be
covered in hlsenc or mpegtsenc.
Examples:
177 void avio_write(AVIOContext *s, const unsigned char *buf, int size)
178 {
-> 179 if (s->direct && !s->update_checksum) {
180 avio_flush(s);
181 writeout(s, buf, size);
182 return;
* thread #1: tid = 0x1548b77, 0x00000001002879f7
libavformat.56.dylib`avio_write(s=0x0000000000000000,
buf=0x00007fff5fbff690, size=188) + 23 at aviobuf.c:179, queue =
'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1,
address=0xa0)
* frame #0: 0x00000001002879f7
libavformat.56.dylib`avio_write(s=0x0000000000000000,
buf=0x00007fff5fbff690, size=188) + 23 at aviobuf.c:179
frame #1: 0x000000010034542b
libavformat.56.dylib`mpegts_write_pes(s=0x0000000103032200,
st=0x00000001021026f0, payload=0x000000010303c0a8, payload_size=1256,
pts=1341180, dts=1341180, key=1) + 4347 at mpegtsenc.c:1187
frame #2: 0x0000000100344303
libavformat.56.dylib`mpegts_write_flush(s=0x0000000103032200) + 147 at
mpegtsenc.c:1379
frame #3: 0x0000000100344161
libavformat.56.dylib`mpegts_write_end(s=0x0000000103032200) + 33 at
mpegtsenc.c:1403
frame #4: 0x000000010034d834
libavformat.56.dylib`av_write_trailer(s=0x0000000103032200) + 276 at
mux.c:949
frame #5: 0x00000001002cdf1d
libavformat.56.dylib`hls_write_trailer(s=0x0000000103030400) + 45 at
hlsenc.c:476
frame #6: 0x000000010034d834
libavformat.56.dylib`av_write_trailer(s=0x0000000103030400) + 276 at
mux.c:949
frame #7: 0x000000010001bdb8 ffmpeg`transcode + 568 at ffmpeg.c:3799
frame #8: 0x000000010001b3df ffmpeg`main(argc=11,
argv=0x00007fff5fbffa28) + 447 at ffmpeg.c:3946
or
* thread #1: tid = 0x1564f17, 0x00000001002879f7
libavformat.56.dylib`avio_write(s=0x0000000000000000,
buf=0x00007fff5fbff3c0, size=188) + 23 at aviobuf.c:179, queue =
'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1,
address=0xa0)
* frame #0: 0x00000001002879f7
libavformat.56.dylib`avio_write(s=0x0000000000000000,
buf=0x00007fff5fbff3c0, size=188) + 23 at aviobuf.c:179
frame #1: 0x000000010034542b
libavformat.56.dylib`mpegts_write_pes(s=0x000000010365f600,
st=0x000000010210d6d0, payload=0x00000001036694a8, payload_size=2619,
pts=396540, dts=396540, key=1) + 4347 at mpegtsenc.c:1187
frame #2: 0x00000001003482c4
libavformat.56.dylib`mpegts_write_packet_internal(s=0x000000010365f600,
pkt=0x00007fff5fbff718) + 2068 at mpegtsenc.c:1341
frame #3: 0x0000000100344130
libavformat.56.dylib`mpegts_write_packet(s=0x000000010365f600,
pkt=0x00007fff5fbff718) + 64 at mpegtsenc.c:1393
frame #4: 0x000000010034c6ef
libavformat.56.dylib`write_packet(s=0x000000010365f600,
pkt=0x00007fff5fbff718) + 975 at mux.c:598
frame #5: 0x000000010034b7f5
libavformat.56.dylib`av_write_frame(s=0x000000010365f600,
pkt=0x00007fff5fbff718) + 421 at mux.c:654
frame #6: 0x000000010034db6a
libavformat.56.dylib`ff_write_chained(dst=0x000000010365f600,
dst_stream=1, pkt=0x00007fff5fbff900, src=0x0000000103030400,
interleave=0) + 394 at mux.c:999
frame #7: 0x00000001002cded1
libavformat.56.dylib`hls_write_packet(s=0x0000000103030400,
pkt=0x00007fff5fbff900) + 929 at hlsenc.c:466
frame #8: 0x000000010034c6ef
libavformat.56.dylib`write_packet(s=0x0000000103030400,
pkt=0x00007fff5fbff900) + 975 at mux.c:598
frame #9: 0x000000010034d77f
libavformat.56.dylib`av_write_trailer(s=0x0000000103030400) + 95 at
mux.c:934
frame #10: 0x000000010001bdb8 ffmpeg`transcode + 568 at ffmpeg.c:3799
frame #11: 0x000000010001b3df ffmpeg`main(argc=11,
argv=0x00007fff5fbffa30) + 447 at ffmpeg.c:3946
More information about the ffmpeg-devel
mailing list