namespace {
void DecodedPacketDeleter(esplusplayer_decoded_video_packet* packet) {
- if (packet == nullptr || packet->surface_data == nullptr) return;
+ if (packet == nullptr) return;
// LOG_DEBUG("packet[%p] deleted", packet);
if(packet->private_data) { // hw dec
gst_buffer_unref((GstBuffer *)packet->private_data);
packet->private_data = nullptr;
- } else {
+ }
+ if(packet->surface_data) {
tbm_surface_destroy(static_cast<tbm_surface_h>(packet->surface_data));
- packet->surface_data = NULL;
+ packet->surface_data = nullptr;
}
}
} // namespace