| 184 | } |
| 185 | |
| 186 | static int decode_bsfs_init(AVCodecContext *avctx) |
| 187 | { |
| 188 | AVCodecInternal *avci = avctx->internal; |
| 189 | const FFCodec *const codec = ffcodec(avctx->codec); |
| 190 | int ret; |
| 191 | |
| 192 | if (avci->bsf) |
| 193 | return 0; |
| 194 | |
| 195 | ret = av_bsf_list_parse_str(codec->bsfs, &avci->bsf); |
| 196 | if (ret < 0) { |
| 197 | av_log(avctx, AV_LOG_ERROR, "Error parsing decoder bitstream filters '%s': %s\n", codec->bsfs, av_err2str(ret)); |
| 198 | if (ret != AVERROR(ENOMEM)) |
| 199 | ret = AVERROR_BUG; |
| 200 | goto fail; |
| 201 | } |
| 202 | |
| 203 | /* We do not currently have an API for passing the input timebase into decoders, |
| 204 | * but no filters used here should actually need it. |
| 205 | * So we make up some plausible-looking number (the MPEG 90kHz timebase) */ |
| 206 | avci->bsf->time_base_in = (AVRational){ 1, 90000 }; |
| 207 | ret = avcodec_parameters_from_context(avci->bsf->par_in, avctx); |
| 208 | if (ret < 0) |
| 209 | goto fail; |
| 210 | |
| 211 | ret = av_bsf_init(avci->bsf); |
| 212 | if (ret < 0) |
| 213 | goto fail; |
| 214 | |
| 215 | return 0; |
| 216 | fail: |
| 217 | av_bsf_free(&avci->bsf); |
| 218 | return ret; |
| 219 | } |
| 220 | |
| 221 | #if !HAVE_THREADS |
| 222 | #define ff_thread_get_packet(avctx, pkt) (AVERROR_BUG) |
no test coverage detected