| 2317 | } |
| 2318 | |
| 2319 | static int subtitle_thread(void *arg) |
| 2320 | { |
| 2321 | VideoState *is = arg; |
| 2322 | Frame *sp; |
| 2323 | int got_subtitle; |
| 2324 | double pts; |
| 2325 | |
| 2326 | for (;;) { |
| 2327 | if (!(sp = frame_queue_peek_writable(&is->subpq))) |
| 2328 | return 0; |
| 2329 | |
| 2330 | if ((got_subtitle = decoder_decode_frame(&is->subdec, NULL, &sp->sub)) < 0) |
| 2331 | break; |
| 2332 | |
| 2333 | pts = 0; |
| 2334 | |
| 2335 | if (got_subtitle && sp->sub.format == 0) { |
| 2336 | if (sp->sub.pts != AV_NOPTS_VALUE) |
| 2337 | pts = sp->sub.pts / (double)AV_TIME_BASE; |
| 2338 | sp->pts = pts; |
| 2339 | sp->serial = is->subdec.pkt_serial; |
| 2340 | sp->width = is->subdec.avctx->width; |
| 2341 | sp->height = is->subdec.avctx->height; |
| 2342 | sp->uploaded = 0; |
| 2343 | |
| 2344 | /* now we can update the picture count */ |
| 2345 | frame_queue_push(&is->subpq); |
| 2346 | } else if (got_subtitle) { |
| 2347 | avsubtitle_free(&sp->sub); |
| 2348 | } |
| 2349 | } |
| 2350 | return 0; |
| 2351 | } |
| 2352 | |
| 2353 | /* copy samples for viewing in editor window */ |
| 2354 | static void update_sample_display(VideoState *is, short *samples, int samples_size) |
nothing calls this directly
no test coverage detected