|
@@ -127,7 +127,7 @@ void ThreadEnc()
|
|
|
char * strbufnv12 = new char[30000000];
|
|
|
int ret;
|
|
|
|
|
|
-RESTART:
|
|
|
+
|
|
|
#ifndef USE_QSV
|
|
|
av_register_all();
|
|
|
|
|
@@ -144,7 +144,7 @@ RESTART:
|
|
|
#endif
|
|
|
|
|
|
|
|
|
-
|
|
|
+RESTART:
|
|
|
|
|
|
// AVCodecContext *decoder_ctx = NULL;
|
|
|
// AVBufferRef *device_ref = NULL;
|
|
@@ -272,8 +272,11 @@ RESTART:
|
|
|
static int ntest = 0; //test change framerate.
|
|
|
// ntest++;
|
|
|
int64_t new_bitrate = 4000000;
|
|
|
- if(ntest == 300)
|
|
|
+ if(ntest > 300)
|
|
|
{
|
|
|
+ av_frame_free(&frame);
|
|
|
+ avcodec_free_context(&c);
|
|
|
+ av_packet_free(&pkt);
|
|
|
// 关闭原编码器
|
|
|
avcodec_close(c);
|
|
|
gnframerate = new_bitrate;
|