| 64 | } |
| 65 | |
| 66 | static int decssaInit( hb_work_object_t * w, hb_job_t * job ) |
| 67 | { |
| 68 | hb_work_private_t * pv = NULL; |
| 69 | int ii; |
| 70 | |
| 71 | if (w->subtitle->config.src_filename == NULL) |
| 72 | { |
| 73 | hb_error("No SSA subtitle file specified"); |
| 74 | goto fail; |
| 75 | } |
| 76 | |
| 77 | pv = calloc( 1, sizeof( hb_work_private_t ) ); |
| 78 | if (pv == NULL) |
| 79 | { |
| 80 | goto fail; |
| 81 | } |
| 82 | w->private_data = pv; |
| 83 | pv->job = job; |
| 84 | pv->subtitle = w->subtitle; |
| 85 | |
| 86 | pv->pkt = av_packet_alloc(); |
| 87 | if (pv->pkt == NULL) |
| 88 | { |
| 89 | hb_error("decssaInit: av_packet_alloc failed"); |
| 90 | goto fail; |
| 91 | } |
| 92 | |
| 93 | if (avformat_open_input(&pv->ic, pv->subtitle->config.src_filename, |
| 94 | NULL, NULL ) < 0 ) |
| 95 | { |
| 96 | hb_error("Could not open the SSA subtitle file '%s'\n", |
| 97 | pv->subtitle->config.src_filename); |
| 98 | goto fail; |
| 99 | } |
| 100 | pv->ctx = decavsubInit(w, job); |
| 101 | if (pv->ctx == NULL) |
| 102 | { |
| 103 | goto fail; |
| 104 | } |
| 105 | |
| 106 | if (extradataInit(pv)) |
| 107 | { |
| 108 | goto fail; |
| 109 | } |
| 110 | |
| 111 | pv->ctx = decavsubInit(w, job); |
| 112 | if (pv->ctx == NULL) |
| 113 | { |
| 114 | goto fail; |
| 115 | } |
| 116 | |
| 117 | /* |
| 118 | * Figure out the start and stop times from the chapters being |
| 119 | * encoded - drop subtitle not in this range. |
| 120 | */ |
| 121 | pv->start_time = 0; |
| 122 | for (ii = 1; ii < job->chapter_start; ++ii) |
| 123 | { |
nothing calls this directly
no test coverage detected