* Close *********************************************************************** * **********************************************************************/
| 1164 | * |
| 1165 | **********************************************************************/ |
| 1166 | void encavcodecClose( hb_work_object_t * w ) |
| 1167 | { |
| 1168 | hb_work_private_t * pv = w->private_data; |
| 1169 | |
| 1170 | if (pv == NULL) |
| 1171 | { |
| 1172 | return; |
| 1173 | } |
| 1174 | av_packet_free(&pv->pkt); |
| 1175 | hb_chapter_queue_close(&pv->chapter_queue); |
| 1176 | if( pv->context ) |
| 1177 | { |
| 1178 | hb_deep_log( 2, "encavcodec: closing libavcodec" ); |
| 1179 | if( pv->context->codec ) { |
| 1180 | avcodec_flush_buffers( pv->context ); |
| 1181 | } |
| 1182 | if (pv->context->stats_in) |
| 1183 | { |
| 1184 | free(pv->context->stats_in); |
| 1185 | pv->context->stats_in = NULL; |
| 1186 | } |
| 1187 | hb_avcodec_free_context(&pv->context); |
| 1188 | } |
| 1189 | if( pv->file ) |
| 1190 | { |
| 1191 | fclose( pv->file ); |
| 1192 | } |
| 1193 | free( pv ); |
| 1194 | w->private_data = NULL; |
| 1195 | } |
| 1196 | |
| 1197 | /* |
| 1198 | * see comments in definition of 'frame_info' in pv struct for description |
nothing calls this directly
no test coverage detected