MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / subtitle_thread

Function subtitle_thread

fftools/ffplay.c:2319–2351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2317}
2318
2319static 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 */
2354static void update_sample_display(VideoState *is, short *samples, int samples_size)

Callers

nothing calls this directly

Calls 4

decoder_decode_frameFunction · 0.85
frame_queue_pushFunction · 0.85
avsubtitle_freeFunction · 0.85

Tested by

no test coverage detected