Hi, Initial value of interrupt_callback can be cached internally somewhere inside avformat_find_stream_info. My code performs assignment just right after context allocation.
Regards, Yurii вт, 9 нояб. 2021 г. в 18:23, Simon Brown <[email protected]>: > Hi, > I'm trying to stop av_read_frame from blocking when the stream is stopped > (stream over TCP, and the sender pauses sending). Reading various forum > posts, it would appear that I need to use the AVIOInterruptCB structure and > assign it to my format context. So I do this: > > /* retrieve stream information */ > if (avformat_find_stream_info(fmt_ctx, NULL) < 0) { > fprintf(stderr, "Could not find stream information\n"); > exit(1); > } > static const AVIOInterruptCB int_cb = {interrupt_cb, &int_cb_ctx}; > fmt_ctx->interrupt_callback = int_cb; > > where interrupt_cb and int_cb_ctx are defined as: > > static int interrupt_cb(void *ctx) > { > int *p = (int *)ctx; > *p = 53; > return 1; > } > > int int_cb_ctx = 0; > > The only problem now is that av_read_frame still blocks, there's no > evidence that interrupt_cb is being called, and I cannot restart my stream > because my decoder gets stuck in av_read_frame. > > Is there anything I am doing wrong? Or is this a feature that has been > deprecated? Is there a better way of getting out of av_read_frame blocking? > > Cheers, > Simon > _______________________________________________ > Libav-user mailing list > [email protected] > https://ffmpeg.org/mailman/listinfo/libav-user > > To unsubscribe, visit link above, or email > [email protected] with subject "unsubscribe". >
_______________________________________________ Libav-user mailing list [email protected] https://ffmpeg.org/mailman/listinfo/libav-user To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
