summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-08-23 17:29:27 -0300
committerJames Almer <jamrial@gmail.com>2018-08-23 17:34:25 -0300
commit35c84ae834de91a9c15fe63fe430274dcff2f9ba (patch)
tree40fd85613db07765da48f5ed6739f4deb4230b2d
parentb8da7ba5ac99e434fe99e12c105cc52cab147059 (diff)
Revert "avcodec/opus_parser: Handle complete frames flag."
This reverts commit 7e0df5910ec0f107cd0700d6b9359d29177f1933. "complete frames" containers, even if they don't need to assemble packets, still depended on this code for proper packet duration and timestamp generation.
-rw-r--r--libavcodec/opus_parser.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/libavcodec/opus_parser.c b/libavcodec/opus_parser.c
index a145fe7793..28b0933900 100644
--- a/libavcodec/opus_parser.c
+++ b/libavcodec/opus_parser.c
@@ -170,24 +170,19 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx,
ParseContext *pc = &s->pc;
int next, header_len;
- if (ctx->flags & PARSER_FLAG_COMPLETE_FRAMES) {
- next = buf_size;
- header_len = 0;
- } else {
- next = opus_find_frame_end(ctx, avctx, buf, buf_size, &header_len);
-
- if (s->ts_framing && next != AVERROR_INVALIDDATA &&
- ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
- }
+ next = opus_find_frame_end(ctx, avctx, buf, buf_size, &header_len);
- if (next == AVERROR_INVALIDDATA){
- *poutbuf = NULL;
- *poutbuf_size = 0;
- return buf_size;
- }
+ if (s->ts_framing && next != AVERROR_INVALIDDATA &&
+ ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
+ *poutbuf = NULL;
+ *poutbuf_size = 0;
+ return buf_size;
+ }
+
+ if (next == AVERROR_INVALIDDATA){
+ *poutbuf = NULL;
+ *poutbuf_size = 0;
+ return buf_size;
}
*poutbuf = buf + header_len;