record/streamts: lower bsf libavcodec check to 57.48.100 (#10)

The bit stream filter change was done in ffmpeg 3.1 already.
This commit is contained in:
Hendi48
2021-05-08 23:00:29 +02:00
committed by GitHub
parent 0965bcdf2f
commit b8ffb1be0c
3 changed files with 8 additions and 8 deletions

View File

@@ -78,7 +78,7 @@ class CStreamRec : public CRecordInstance, OpenThreads::Thread
private:
AVFormatContext *ifcx;
AVFormatContext *ofcx;
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 ))
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 ))
AVBitStreamFilterContext *bsfc;
#else
AVBSFContext *bsfc;
@@ -1998,7 +1998,7 @@ void CStreamRec::Close()
avformat_free_context(ofcx);
}
if (bsfc){
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 ))
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 ))
av_bitstream_filter_close(bsfc);
#else
av_bsf_free(&bsfc);
@@ -2292,7 +2292,7 @@ bool CStreamRec::Open(CZapitChannel * channel)
av_dump_format(ofcx, 0, ofcx->url, 1);
#endif
av_log_set_level(AV_LOG_WARNING);
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 ))
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 ))
bsfc = av_bitstream_filter_init("h264_mp4toannexb");
if (!bsfc)
printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__);
@@ -2335,7 +2335,7 @@ void CStreamRec::run()
#endif
if (bsfc && codec->codec_id == AV_CODEC_ID_H264) {
AVPacket newpkt = pkt;
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,52,100 ))
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 57,48,100 ))
if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) {
av_packet_unref(&pkt);
newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0);