hi,guys, i’m trying to reconnect the rtmp live stream connection when
socket receives timeout
simply likes
ffplay “rtmp://xxxxxx timeout=5”


but after av_read_frame receiving timeout,  no flag can specify it is eof
or timeout, it returns eof all the time, but it’s fine, whatever i
reconnect to it.

my code is just like this, but after i reopen the io_context,
 av_read_frame will be stucked

ret = av_read_frame(format_ctx, pkt);

if (avio_feof(format_ctx->pb)) {

            avio_close(format_ctx->pb);

            avio_open(&format_ctx->pb, filename, AVIO_FLAG_READ) ;

            ic->pb->eof_reached = 0;

            av_free_packet(pkt);

            ret = av_read_frame(format_ctx, pkt);

}

i cannot just call avformat_open_input and avformat_find_stream_info,
because of the format_ctx (including AVstreams, CodecContext) had been
using in other decoding threads.


any  suggestions i will appreciate it .

thanks.
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to