Hello<div><br></div><div>I am developing an application that publishes a h264/aac FLV stream via RTMP, I'm using libav to do all the correct flv packaging and to interface with librtmp.</div><div><br></div><div>It seems that whenever the server terminates (I'm using Wowza Media Server), librtmp causes a SIGPIPE ( I guess from trying to write to the closed socket), Libav/avconv normally exists here due to the SIGPIPE, If I ignore the sigpipe then what seems to happen is that rtmp still attempts to write to the broken pipe another 40 or so times till it finally seg faults.</div>
<div><br></div><div>I've attached a trace below taken from the first SIGPIPE</div><div><br></div><div>----------------------------------------------------------------------------------------------</div><div><br></div>
<div><div>WriteN, RTMP send error 104 (136 bytes)</div><div><br></div><div>Program received signal SIGPIPE, Broken pipe.</div><div>[Switching to Thread 0xa7b90b70 (LWP 27290)]</div><div>0xb7fe1424 in __kernel_vsyscall ()</div>
<div>(gdb) bt</div><div>#0 0xb7fe1424 in __kernel_vsyscall ()</div><div>#1 0xb7fbb9d8 in send () from /lib/i386-linux-gnu/libpthread.so.0</div><div>#2 0xb6e64392 in RTMPSockBuf_Send () from /usr/lib/librtmp.so.0</div><div>
#3 0xb6e648d3 in WriteN () from /usr/lib/librtmp.so.0</div><div>#4 0xb6e64e41 in RTMP_SendPacket () from /usr/lib/librtmp.so.0</div><div>#5 0xb6e6510b in SendFCUnpublish () from /usr/lib/librtmp.so.0</div><div>#6 0xb6e647de in RTMP_Close () from /usr/lib/librtmp.so.0</div>
<div>#7 0xb6e64938 in WriteN () from /usr/lib/librtmp.so.0</div><div>#8 0xb6e64e41 in RTMP_SendPacket () from /usr/lib/librtmp.so.0</div><div>#9 0xb6e6bde2 in RTMP_Write () from /usr/lib/librtmp.so.0</div><div>#10 0xb7d757d7 in retry_transfer_wrapper (h=0x8599000, buf=0x85a3500 "\b", size=544) at libavformat/avio.c:271</div>
<div>#11 ffurl_write (h=0x8599000, buf=0x85a3500 "\b", size=544) at libavformat/avio.c:315</div><div>#12 0xb7d75e72 in flush_buffer (s=0x85a3220) at libavformat/aviobuf.c:127</div><div>#13 0xb7d7690f in avio_flush (s=0x85a3220) at libavformat/aviobuf.c:179</div>
<div>#14 0xb7d89066 in flv_write_packet (s=0x85951a0, pkt=0x851b2c4) at libavformat/flvenc.c:455</div><div>#15 0xb7e179e0 in av_write_frame (s=0x85951a0, pkt=0x851b2c4) at libavformat/utils.c:3051</div></div><div><br></div>
<div>----------------------------------------------------------------------------------------------</div><div><br></div><div>Is there an easy way to get around this, for me it would be best if librtmp would simply return an error from the RTMP_Write Call.</div>
<div><br></div><div>Regards,</div><div>Evgeny</div>