hlsenc: check append_entry return value

This commit is contained in:
Luca Barbato 2012-12-25 08:59:38 +01:00
parent 66f7b4862f
commit 6dd93ee6f1
1 changed files with 6 additions and 3 deletions

View File

@ -259,9 +259,12 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
av_compare_ts(pkt->pts, st->time_base, end_pts, AV_TIME_BASE_Q) >= 0 && av_compare_ts(pkt->pts, st->time_base, end_pts, AV_TIME_BASE_Q) >= 0 &&
pkt->flags & AV_PKT_FLAG_KEY) { pkt->flags & AV_PKT_FLAG_KEY) {
append_entry(hls, av_rescale(pkt->pts - hls->end_pts, ret = append_entry(hls, av_rescale(pkt->pts - hls->end_pts,
st->time_base.num, st->time_base.num,
st->time_base.den)); st->time_base.den));
if (ret)
return ret;
hls->end_pts = pkt->pts; hls->end_pts = pkt->pts;
av_write_frame(oc, NULL); /* Flush any buffered data */ av_write_frame(oc, NULL); /* Flush any buffered data */