代码拉取完成,页面将自动刷新
同步操作将从 Gitee 极速下载/ffmpeg 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* Micronas SC-4 parser
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "parser.h"
#include "parser_internal.h"
typedef struct MISC4Context {
ParseContext pc;
} MISC4Context;
static int misc4_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
MISC4Context *ctx = s->priv_data;
uint32_t state = ctx->pc.state;
int next = END_NOT_FOUND, i = 0;
*poutbuf_size = 0;
*poutbuf = NULL;
if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
next = buf_size;
} else {
uint32_t marker = 0;
switch (avctx->sample_rate) {
case 8000:
case 11025:
marker = 0x11b;
break;
case 16000:
case 32000:
marker = 0x2b2;
break;
}
for (; i < buf_size; i++) {
state = (state << 8) | buf[i];
if (state == marker && i > 3) {
next = i - 3;
break;
}
}
ctx->pc.state = state;
if (ff_combine_frame(&ctx->pc, next, &buf, &buf_size) < 0) {
*poutbuf = NULL;
*poutbuf_size = 0;
return buf_size;
}
}
*poutbuf = buf;
*poutbuf_size = buf_size;
return next;
}
const FFCodecParser ff_misc4_parser = {
PARSER_CODEC_LIST(AV_CODEC_ID_MISC4),
.priv_data_size = sizeof(MISC4Context),
.parse = misc4_parse,
.close = ff_parse_close,
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。