Skip to content

Commit

Permalink
subtitles: Don't manage the buffer assigned to a packet.
Browse files Browse the repository at this point in the history
Remove code that attempted to have FFmpeg reuse the same buffer each
time it read a subtitle.  The FFmpeg code changes out the packet
buffer each time av_read_frame is called.

Refs #767.
  • Loading branch information
linuxdude42 committed Jul 6, 2023
1 parent c909c36 commit d2cd226
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions mythtv/libs/libmythtv/captions/textsubtitleparser.cpp
Expand Up @@ -175,7 +175,6 @@ TextSubtitleParser::TextSubtitleParser(SubtitleReader *parent, QString fileName,
: m_parent(parent), m_target(target), m_fileName(std::move(fileName))
{
m_pkt = av_packet_alloc();
av_new_packet(m_pkt, 4096);
}

TextSubtitleParser::~TextSubtitleParser()
Expand Down Expand Up @@ -240,9 +239,6 @@ int64_t TextSubtitleParser::seek_packet(void *opaque, int64_t offset, int whence
/// rely on pkt->dts if you do not decompress the payload.
int TextSubtitleParser::ReadNextSubtitle(void)
{
// reset buffer
m_pkt->data = m_pkt->buf->data;
m_pkt->size = m_pkt->buf->size;

int ret = av_read_frame(m_fmtCtx, m_pkt);
if (ret < 0)
Expand Down

0 comments on commit d2cd226

Please sign in to comment.