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.
Unified · Split
| @@ -170,24 +170,19 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, · 169 unmodified lines | ||
| 170 | 170 | ParseContext *pc = &s->pc; |
| 171 | 171 | int next, header_len; |
| 172 | 172 | |
| 173 | − if (ctx->flags & PARSER_FLAG_COMPLETE_FRAMES) { | |
| 174 | − next = buf_size; | |
| 175 | − header_len = 0; | |
| 176 | − } else { | |
| 177 | − next = opus_find_frame_end(ctx, avctx, buf, buf_size, &header_len); | |
| 178 | − | |
| 179 | − if (s->ts_framing && next != AVERROR_INVALIDDATA && | |
| 180 | − ff_combine_frame(pc, next, &buf, &buf_size) < 0) { | |
| 181 | − *poutbuf = NULL; | |
| 182 | − *poutbuf_size = 0; | |
| 183 | − return buf_size; | |
| 184 | − } | |
| 173 | + next = opus_find_frame_end(ctx, avctx, buf, buf_size, &header_len); | |
| 185 | 174 | |
| 186 | − if (next == AVERROR_INVALIDDATA){ | |
| 187 | − *poutbuf = NULL; | |
| 188 | − *poutbuf_size = 0; | |
| 189 | − return buf_size; | |
| 190 | − } | |
| 175 | + if (s->ts_framing && next != AVERROR_INVALIDDATA && | |
| 176 | + ff_combine_frame(pc, next, &buf, &buf_size) < 0) { | |
| 177 | + *poutbuf = NULL; | |
| 178 | + *poutbuf_size = 0; | |
| 179 | + return buf_size; | |
| 180 | + } | |
| 181 | + | |
| 182 | + if (next == AVERROR_INVALIDDATA){ | |
| 183 | + *poutbuf = NULL; | |
| 184 | + *poutbuf_size = 0; | |
| 185 | + return buf_size; | |
| 191 | 186 | } |
| 192 | 187 | |
| 193 | 188 | *poutbuf = buf + header_len; |