mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-03 00:47:34 +08:00
修复test_player没声音和windows控制台日志不输出bug (#4484)
(cherry picked from commit 73d348ea96)
This commit is contained in:
@@ -247,6 +247,15 @@ void FFmpegFrame::fillPicture(AVPixelFormat target_format, int target_width, int
|
||||
av_image_fill_arrays(_frame->data, _frame->linesize, (uint8_t *) _data, target_format, target_width, target_height, 32);
|
||||
}
|
||||
|
||||
int FFmpegFrame::getChannels() const {
|
||||
if (!_frame) return 0;
|
||||
#if LIBAVCODEC_VERSION_INT >= FF_CODEC_VER_7_1
|
||||
return _frame->ch_layout.nb_channels;
|
||||
#else
|
||||
return _frame->channels;
|
||||
#endif
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<bool decoder = true>
|
||||
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
|
||||
AVFrame *get() const;
|
||||
void fillPicture(AVPixelFormat target_format, int target_width, int target_height);
|
||||
int getChannels() const;
|
||||
|
||||
private:
|
||||
char *_data = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user