diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index a71f98145cbf711406fa070eeb08d03f0ed6186e..3645fafece53928fc1d73b03334eba4f96f3146c 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -480,6 +480,7 @@ int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap);
 int av_write_header(AVFormatContext *s);
 int av_write_frame(AVFormatContext *s, AVPacket *pkt);
 int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
+int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush);
 
 int av_write_trailer(AVFormatContext *s);
 
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 5e00bb33dd4214962824428fb2161b7ba3c086e0..001c812bbfb19e437761194feb801ae656b71571 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2418,7 +2418,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt)
  * packets with pkt->destruct == av_destruct_packet will be freed inside this function.
  * so they cannot be used after it, note calling av_free_packet() on them is still safe
  */
-static int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){
+int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){
     AVPacketList *pktl, **next_point, *this_pktl;
     int stream_count=0;
     int streams[MAX_STREAMS];