Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
muxer libav: review again the h264 filter payload free code
  • Loading branch information
perexg committed Oct 22, 2014
1 parent 2e15888 commit e7e6754
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/muxer/muxer_libav.c
Expand Up @@ -393,8 +393,6 @@ lav_muxer_write_pkt(muxer_t *m, streaming_message_type_t smt, void *data)

if(lm->lm_h264_filter && st->codec->codec_id == AV_CODEC_ID_H264) {
free_data = 1;
packet.data = NULL;
packet.size = 0;
if(av_bitstream_filter_filter(lm->lm_h264_filter,
st->codec,
NULL,
Expand All @@ -404,6 +402,8 @@ lav_muxer_write_pkt(muxer_t *m, streaming_message_type_t smt, void *data)
pktbuf_len(pkt->pkt_payload),
pkt->pkt_frametype < PKT_P_FRAME) < 0) {
tvhlog(LOG_WARNING, "libav", "Failed to filter bitstream");
if (packet.data != pktbuf_ptr(pkt->pkt_payload))
av_free(packet.data);
break;
}
} else if (st->codec->codec_id == AV_CODEC_ID_AAC) {
Expand All @@ -427,7 +427,7 @@ lav_muxer_write_pkt(muxer_t *m, streaming_message_type_t smt, void *data)
if((rc = av_interleaved_write_frame(oc, &packet)))
tvhlog(LOG_WARNING, "libav", "Failed to write frame");

if(free_data)
if(free_data && packet.data != pktbuf_ptr(pkt->pkt_payload))
av_free(packet.data);

break;
Expand Down

0 comments on commit e7e6754

Please sign in to comment.