mirror of
				https://github.com/nyanmisaka/ffmpeg-rockchip.git
				synced 2025-11-01 04:53:04 +08:00 
			
		
		
		
	fftools/ffmpeg: reduce access to OutputStream.enc_ctx
It will be made private to Encoder in the future.
This commit is contained in:
		| @@ -649,8 +649,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti | |||||||
|     av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC); |     av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC); | ||||||
|     av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC); |     av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC); | ||||||
|     for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { |     for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { | ||||||
|         const AVCodecContext * const enc = ost->enc_ctx; |         const float q = ost->enc ? ost->quality / (float) FF_QP2LAMBDA : -1; | ||||||
|         const float q = enc ? ost->quality / (float) FF_QP2LAMBDA : -1; |  | ||||||
|  |  | ||||||
|         if (vid && ost->type == AVMEDIA_TYPE_VIDEO) { |         if (vid && ost->type == AVMEDIA_TYPE_VIDEO) { | ||||||
|             av_bprintf(&buf, "q=%2.1f ", q); |             av_bprintf(&buf, "q=%2.1f ", q); | ||||||
| @@ -1155,7 +1154,7 @@ static int process_subtitle(InputStream *ist, AVSubtitle *subtitle, int *got_out | |||||||
|  |  | ||||||
|     for (int oidx = 0; oidx < ist->nb_outputs; oidx++) { |     for (int oidx = 0; oidx < ist->nb_outputs; oidx++) { | ||||||
|         OutputStream *ost = ist->outputs[oidx]; |         OutputStream *ost = ist->outputs[oidx]; | ||||||
|         if (!ost->enc_ctx || ost->enc_ctx->codec_type != AVMEDIA_TYPE_SUBTITLE) |         if (!ost->enc || ost->type != AVMEDIA_TYPE_SUBTITLE) | ||||||
|             continue; |             continue; | ||||||
|  |  | ||||||
|         enc_subtitle(output_files[ost->file_index], ost, subtitle); |         enc_subtitle(output_files[ost->file_index], ost, subtitle); | ||||||
| @@ -1527,7 +1526,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo | |||||||
|  |  | ||||||
|     for (int oidx = 0; oidx < ist->nb_outputs; oidx++) { |     for (int oidx = 0; oidx < ist->nb_outputs; oidx++) { | ||||||
|         OutputStream *ost = ist->outputs[oidx]; |         OutputStream *ost = ist->outputs[oidx]; | ||||||
|         if (ost->enc_ctx || (!pkt && no_eof)) |         if (ost->enc || (!pkt && no_eof)) | ||||||
|             continue; |             continue; | ||||||
|  |  | ||||||
|         if (duration_exceeded) { |         if (duration_exceeded) { | ||||||
|   | |||||||
| @@ -742,7 +742,7 @@ static void mux_final_stats(Muxer *mux) | |||||||
|  |  | ||||||
|         av_log(of, AV_LOG_VERBOSE, "  Output stream #%d:%d (%s): ", |         av_log(of, AV_LOG_VERBOSE, "  Output stream #%d:%d (%s): ", | ||||||
|                of->index, j, av_get_media_type_string(type)); |                of->index, j, av_get_media_type_string(type)); | ||||||
|         if (ost->enc_ctx) { |         if (ost->enc) { | ||||||
|             av_log(of, AV_LOG_VERBOSE, "%"PRIu64" frames encoded", |             av_log(of, AV_LOG_VERBOSE, "%"PRIu64" frames encoded", | ||||||
|                    ost->frames_encoded); |                    ost->frames_encoded); | ||||||
|             if (type == AVMEDIA_TYPE_AUDIO) |             if (type == AVMEDIA_TYPE_AUDIO) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Anton Khirnov
					Anton Khirnov