Skip to content

Commit

Permalink
lavf: export flush_packet_queue() as mythtv_flush_packet_queue()
Browse files Browse the repository at this point in the history
FFmpeg 5.0 renames and exports this as ff_flush_packet_queue().

This change is intended to make transitioning to FFmpeg 5.0 easier.

Technically, this should be in libavformat/internal.h, but, since it is currently
unmodified, libavformat/avformat.h will work for now.  (MythTV does not directly use
this function.)
  • Loading branch information
ulmus-scott committed Feb 10, 2022
1 parent 620b91a commit 12f1aa3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mythtv/external/FFmpeg/libavformat/avformat.h
Expand Up @@ -3022,7 +3022,7 @@ AVRational av_stream_get_codec_timebase(const AVStream *st);
/* MythTV changes */
void av_estimate_timings(AVFormatContext *ic, int64_t old_offset);
void av_remove_stream(AVFormatContext *s, int id, int remove_ts);
void flush_packet_queue(AVFormatContext *s);
void mythtv_flush_packet_queue(AVFormatContext *s);
/* End MythTV changes */

/**
Expand Down
2 changes: 1 addition & 1 deletion mythtv/external/FFmpeg/libavformat/mpegts-mythtv.c
Expand Up @@ -151,7 +151,7 @@ static void av_mpegts_remove_stream(AVFormatContext *s, int id) {
if (changes)
{
// flush queued packets after a stream change (might need to make smarter)
flush_packet_queue(s);
mythtv_flush_packet_queue(s);

/* renumber the streams */
av_log(NULL, AV_LOG_DEBUG, "av_mpegts_remove_stream: renumbering streams\n");
Expand Down
8 changes: 7 additions & 1 deletion mythtv/external/FFmpeg/libavformat/utils.c
Expand Up @@ -1853,7 +1853,7 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt)
}

/* XXX: suppress the packet queue */
void flush_packet_queue(AVFormatContext *s)
static void flush_packet_queue(AVFormatContext *s)
{
if (!s->internal)
return;
Expand Down Expand Up @@ -6002,3 +6002,9 @@ void av_remove_stream(AVFormatContext *s, int id, int /* remove_ts */) {
s->streams[i]->index=i;
}
}

// temporary export for mpegts-mythtv.c; FFmpeg 5.0 exports it as ff_flush_packet_queue
void mythtv_flush_packet_queue(AVFormatContext *s)
{
flush_packet_queue(s);
}

0 comments on commit 12f1aa3

Please sign in to comment.