summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-12-15 08:28:27 -0800
committerJohn Stebbins <[email protected]>2016-12-17 07:28:51 -0800
commit48bdca29c21ad7137a45003767bd40764feb89b1 (patch)
treee4db5cc59c63f3a3af36dd00420dc74e93741b7a /libhb
parent480d018ee0012a5adb9609195a951496f7d3c62a (diff)
unref AVPackets, fix merge issues
Diffstat (limited to 'libhb')
-rw-r--r--libhb/decavcodec.c7
-rw-r--r--libhb/stream.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c
index cbc03cf6a..ae5544158 100644
--- a/libhb/decavcodec.c
+++ b/libhb/decavcodec.c
@@ -678,6 +678,7 @@ static int decavcodecaBSInfo( hb_work_object_t *w, const hb_buffer_t *buf,
if (ret < 0 && ret != AVERROR_EOF)
{
parse_pos += parse_len;
+ av_packet_unref(&avp);
continue;
}
@@ -775,6 +776,7 @@ static int decavcodecaBSInfo( hb_work_object_t *w, const hb_buffer_t *buf,
break;
}
} while (ret >= 0);
+ av_packet_unref(&avp);
av_frame_free(&frame);
parse_pos += parse_len;
}
@@ -1110,11 +1112,11 @@ static int decodeFrame( hb_work_object_t *w, packet_info_t * packet_info )
}
ret = avcodec_send_packet(pv->context, &avp);
+ av_packet_unref(&avp);
if (ret < 0 && ret != AVERROR_EOF)
{
return 0;
}
- av_free_packet(&avp);
#ifdef USE_QSV
if (pv->qsv.decode &&
@@ -1954,6 +1956,7 @@ static void decodeAudio(hb_work_private_t *pv, packet_info_t * packet_info)
ret = avcodec_send_packet(context, &avp);
if (ret < 0 && ret != AVERROR_EOF)
{
+ av_packet_unref(&avp);
return;
}
@@ -2026,6 +2029,7 @@ static void decodeAudio(hb_work_private_t *pv, packet_info_t * packet_info)
{
hb_log("decavcodec: hb_audio_resample_update() failed");
av_frame_unref(pv->frame);
+ av_packet_unref(&avp);
return;
}
out = hb_audio_resample(pv->resample, pv->frame->extended_data,
@@ -2055,4 +2059,5 @@ static void decodeAudio(hb_work_private_t *pv, packet_info_t * packet_info)
av_frame_unref(pv->frame);
++pv->nframes;
} while (ret >= 0);
+ av_packet_unref(&avp);
}
diff --git a/libhb/stream.c b/libhb/stream.c
index 9f6a44d98..0fd98a6c2 100644
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -5086,8 +5086,6 @@ static int ffmpeg_open( hb_stream_t *stream, hb_title_t *title, int scan )
fail:
if ( info_ic ) avformat_close_input( &info_ic );
- free(stream->ffmpeg_pkt);
- stream->ffmpeg_pkt = NULL;
return 0;
}