[DEV] stupid patch for android ==> TODO: understand why
This commit is contained in:
parent
9913b58998
commit
bf346d2f26
@ -194,7 +194,7 @@ int appl::MediaDecoder::decode_packet(int *_gotFrame, int _cached) {
|
|||||||
// decode video frame
|
// decode video frame
|
||||||
ret = avcodec_decode_video2(m_videoDecoderContext, m_frame, _gotFrame, &m_packet);
|
ret = avcodec_decode_video2(m_videoDecoderContext, m_frame, _gotFrame, &m_packet);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
APPL_ERROR("Error decoding video frame (" << av_err2str(ret) << ")");
|
//APPL_ERROR("Error decoding video frame (" << av_err2str(ret) << ")");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
if (*_gotFrame) {
|
if (*_gotFrame) {
|
||||||
@ -214,10 +214,12 @@ int appl::MediaDecoder::decode_packet(int *_gotFrame, int _cached) {
|
|||||||
APPL_DEBUG("Update seek time: " << m_seekApply);
|
APPL_DEBUG("Update seek time: " << m_seekApply);
|
||||||
}
|
}
|
||||||
echrono::Duration packetTime(double(m_frame->pkt_pts) * double(m_videoDecoderContext->time_base.num) / double(m_videoDecoderContext->time_base.den));
|
echrono::Duration packetTime(double(m_frame->pkt_pts) * double(m_videoDecoderContext->time_base.num) / double(m_videoDecoderContext->time_base.den));
|
||||||
|
/*
|
||||||
APPL_VERBOSE("video_frame " << (_cached?"(cached)":"")
|
APPL_VERBOSE("video_frame " << (_cached?"(cached)":"")
|
||||||
<< " n=" << m_videoFrameCount
|
<< " n=" << m_videoFrameCount
|
||||||
<< " coded_n=" << m_frame->coded_picture_number
|
<< " coded_n=" << m_frame->coded_picture_number
|
||||||
<< " pts=" << av_ts2timestr(m_frame->pkt_pts, &m_videoDecoderContext->time_base) << " " << packetTime);
|
<< " pts=" << av_ts2timestr(m_frame->pkt_pts, &m_videoDecoderContext->time_base) << " " << packetTime);
|
||||||
|
*/
|
||||||
m_videoFrameCount++;
|
m_videoFrameCount++;
|
||||||
int32_t slotId = videoGetEmptySlot();
|
int32_t slotId = videoGetEmptySlot();
|
||||||
if (slotId == -1) {
|
if (slotId == -1) {
|
||||||
@ -247,7 +249,7 @@ int appl::MediaDecoder::decode_packet(int *_gotFrame, int _cached) {
|
|||||||
// decode audio frame
|
// decode audio frame
|
||||||
ret = avcodec_decode_audio4(m_audioDecoderContext, m_frame, _gotFrame, &m_packet);
|
ret = avcodec_decode_audio4(m_audioDecoderContext, m_frame, _gotFrame, &m_packet);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
APPL_ERROR("Error decoding audio frame (" << av_err2str(ret) << ")");
|
//APPL_ERROR("Error decoding audio frame (" << av_err2str(ret) << ")");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
// Some audio decoders decode only part of the packet, and have to be called again with the remainder of the packet data.
|
// Some audio decoders decode only part of the packet, and have to be called again with the remainder of the packet data.
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
* @license GPL v3 (see license file)
|
* @license GPL v3 (see license file)
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#define __STDC_FORMAT_MACROS
|
||||||
|
|
||||||
#include <elog/log.hpp>
|
#include <elog/log.hpp>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user