diff --git a/src/zm_rtsp_server_fifo_audio_source.cpp b/src/zm_rtsp_server_fifo_audio_source.cpp index d0008600a..44cc618c3 100644 --- a/src/zm_rtsp_server_fifo_audio_source.cpp +++ b/src/zm_rtsp_server_fifo_audio_source.cpp @@ -40,12 +40,9 @@ int ZoneMinderFifoAudioSource::getFrequencyIndex() { } void ZoneMinderFifoAudioSource::PushFrame(const uint8_t *data, size_t size, int64_t pts) { - xop::AVFrame frame = {0}; + xop::AVFrame frame(data, size); frame.type = xop::AUDIO_FRAME; - frame.size = size; frame.timestamp = av_rescale_q(pts, AV_TIME_BASE_Q, m_timeBase); - frame.buffer.reset(new uint8_t[size]); - memcpy(frame.buffer.get(), data, size); m_rtspServer->PushFrame(m_sessionId, m_channelId, frame); } #endif // HAVE_RTSP_SERVER diff --git a/src/zm_rtsp_server_fifo_video_source.cpp b/src/zm_rtsp_server_fifo_video_source.cpp index 928cb4876..df8c32955 100644 --- a/src/zm_rtsp_server_fifo_video_source.cpp +++ b/src/zm_rtsp_server_fifo_video_source.cpp @@ -23,12 +23,8 @@ ZoneMinderFifoVideoSource::ZoneMinderFifoVideoSource( } void ZoneMinderFifoVideoSource::PushFrame(const uint8_t *data, size_t size, int64_t pts) { - xop::AVFrame frame = {0}; - frame.type = 0; - frame.size = size; + xop::AVFrame frame(data, size); frame.timestamp = av_rescale_q(pts, AV_TIME_BASE_Q, m_timeBase); - frame.buffer.reset(new uint8_t[size]); - memcpy(frame.buffer.get(), data, size); m_rtspServer->PushFrame(m_sessionId, m_channelId, frame); }