Permalink
Browse files

More HLS encoder fixes.

- Offset starting timecode to 1 instead of 0 so libavformat sees it as valid.
- Set extended_data field in audio AVFrame to squelch libavcodec warning.
  • Loading branch information...
cpinkham committed Jul 21, 2012
1 parent 3d4467d commit 2e9333db603fede6c73c4501b52f20d8a1610489
Showing with 3 additions and 2 deletions.
  1. +3 −2 mythtv/libs/libmythtv/avformatwriter.cpp
@@ -314,7 +314,7 @@ int AVFormatWriter::WriteVideoFrame(VideoFrame *frame)
}
if (m_startingTimecodeOffset == -1)
m_startingTimecodeOffset = tc;
m_startingTimecodeOffset = tc - 1;
tc -= m_startingTimecodeOffset;
m_pkt->pts = tc * m_videoStream->time_base.den / m_videoStream->time_base.num / 1000;
@@ -372,6 +372,7 @@ int AVFormatWriter::WriteAudioFrame(unsigned char *buf, int fnum, long long &tim
m_audPicture->linesize[0] = m_audioFrameSize;
m_audPicture->nb_samples = m_audioFrameSize;
m_audPicture->format = m_audioStream->codec->sample_fmt;
m_audPicture->extended_data = m_audPicture->data;
m_bufferedAudioFrameTimes.push_back(timecode);
@@ -399,7 +400,7 @@ int AVFormatWriter::WriteAudioFrame(unsigned char *buf, int fnum, long long &tim
tc = m_bufferedAudioFrameTimes.takeFirst();
if (m_startingTimecodeOffset == -1)
m_startingTimecodeOffset = tc;
m_startingTimecodeOffset = tc - 1;
tc -= m_startingTimecodeOffset;
if (m_avVideoCodec)

0 comments on commit 2e9333d

Please sign in to comment.