projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use dcp::file_to_string().
[dcpomatic.git]
/
src
/
lib
/
examine_ffmpeg_subtitles_job.cc
diff --git
a/src/lib/examine_ffmpeg_subtitles_job.cc
b/src/lib/examine_ffmpeg_subtitles_job.cc
index b9d5f54e5d09385f21406a52683dd4cfbe60abd7..8c762d893bb311e9c47a6545d7fa60ee1820dcd7 100644
(file)
--- a/
src/lib/examine_ffmpeg_subtitles_job.cc
+++ b/
src/lib/examine_ffmpeg_subtitles_job.cc
@@
-33,7
+33,7
@@
extern "C" {
using std::string;
using std::cout;
using std::string;
using std::cout;
-using
boost
::shared_ptr;
+using
std
::shared_ptr;
ExamineFFmpegSubtitlesJob::ExamineFFmpegSubtitlesJob (shared_ptr<const Film> film, shared_ptr<FFmpegContent> c)
: Job (film)
ExamineFFmpegSubtitlesJob::ExamineFFmpegSubtitlesJob (shared_ptr<const Film> film, shared_ptr<FFmpegContent> c)
: Job (film)
@@
-43,6
+43,11
@@
ExamineFFmpegSubtitlesJob::ExamineFFmpegSubtitlesJob (shared_ptr<const Film> fil
}
}
+ExamineFFmpegSubtitlesJob::~ExamineFFmpegSubtitlesJob ()
+{
+ stop_thread ();
+}
+
string
ExamineFFmpegSubtitlesJob::name () const
{
string
ExamineFFmpegSubtitlesJob::name () const
{
@@
-60,8
+65,11
@@
ExamineFFmpegSubtitlesJob::run ()
{
int64_t const len = _file_group.length ();
while (true) {
{
int64_t const len = _file_group.length ();
while (true) {
- int r = av_read_frame (_format_context, &_packet);
+ auto packet = av_packet_alloc ();
+ DCPOMATIC_ASSERT (packet);
+ int r = av_read_frame (_format_context, packet);
if (r < 0) {
if (r < 0) {
+ av_packet_free (&packet);
break;
}
break;
}
@@
-71,10
+79,10
@@
ExamineFFmpegSubtitlesJob::run ()
set_progress_unknown ();
}
set_progress_unknown ();
}
- if (_content->subtitle_stream() && _content->subtitle_stream()->uses_index(_format_context,
_packet.
stream_index) && _content->only_text()->use()) {
+ if (_content->subtitle_stream() && _content->subtitle_stream()->uses_index(_format_context,
packet->
stream_index) && _content->only_text()->use()) {
int got_subtitle;
AVSubtitle sub;
int got_subtitle;
AVSubtitle sub;
- if (avcodec_decode_subtitle2(subtitle_codec_context(), &sub, &got_subtitle,
&_
packet) >= 0 && got_subtitle) {
+ if (avcodec_decode_subtitle2(subtitle_codec_context(), &sub, &got_subtitle, packet) >= 0 && got_subtitle) {
for (unsigned int i = 0; i < sub.num_rects; ++i) {
AVSubtitleRect const * rect = sub.rects[i];
if (rect->type == SUBTITLE_BITMAP) {
for (unsigned int i = 0; i < sub.num_rects; ++i) {
AVSubtitleRect const * rect = sub.rects[i];
if (rect->type == SUBTITLE_BITMAP) {
@@
-99,7
+107,7
@@
ExamineFFmpegSubtitlesJob::run ()
}
}
}
}
- av_packet_
unref (&_
packet);
+ av_packet_
free (&
packet);
}
set_progress (1);
}
set_progress (1);