projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix problems with FFmpeg files that have all-zero stream IDs.
[dcpomatic.git]
/
src
/
lib
/
ffmpeg_decoder.cc
diff --git
a/src/lib/ffmpeg_decoder.cc
b/src/lib/ffmpeg_decoder.cc
index 19b99df90748c071bdc43db06ad4b19e23fb2e6d..5a1b78762d92e6e30d55108dfae637f8b348e676 100644
(file)
--- a/
src/lib/ffmpeg_decoder.cc
+++ b/
src/lib/ffmpeg_decoder.cc
@@
-171,12
+171,14
@@
FFmpegDecoder::pass ()
shared_ptr<const Film> film = _film.lock ();
assert (film);
shared_ptr<const Film> film = _film.lock ();
assert (film);
+
+ int const si = _packet.stream_index;
- if (
_packet.stream_index
== _video_stream && _decode_video) {
+ if (
si
== _video_stream && _decode_video) {
decode_video_packet ();
decode_video_packet ();
- } else if (_ffmpeg_content->audio_stream() &&
_packet.stream_index == _ffmpeg_content->audio_stream()->id
&& _decode_audio) {
+ } else if (_ffmpeg_content->audio_stream() &&
si == _ffmpeg_content->audio_stream()->index (_format_context)
&& _decode_audio) {
decode_audio_packet ();
decode_audio_packet ();
- } else if (_ffmpeg_content->subtitle_stream() &&
_packet.stream_index == _ffmpeg_content->subtitle_stream()->id
&& film->with_subtitles ()) {
+ } else if (_ffmpeg_content->subtitle_stream() &&
si == _ffmpeg_content->subtitle_stream()->index (_format_context)
&& film->with_subtitles ()) {
decode_subtitle_packet ();
}
decode_subtitle_packet ();
}
@@
-511,11
+513,11
@@
FFmpegDecoder::setup_subtitle ()
{
boost::mutex::scoped_lock lm (_mutex);
{
boost::mutex::scoped_lock lm (_mutex);
- if (!_ffmpeg_content->subtitle_stream() || _ffmpeg_content->subtitle_stream()->i
d
>= int (_format_context->nb_streams)) {
+ if (!_ffmpeg_content->subtitle_stream() || _ffmpeg_content->subtitle_stream()->i
ndex (_format_context)
>= int (_format_context->nb_streams)) {
return;
}
return;
}
- _subtitle_codec_context = _f
ormat_context->streams[_ffmpeg_content->subtitle_stream()->id]
->codec;
+ _subtitle_codec_context = _f
fmpeg_content->subtitle_stream()->stream(_format_context)
->codec;
_subtitle_codec = avcodec_find_decoder (_subtitle_codec_context->codec_id);
if (_subtitle_codec == 0) {
_subtitle_codec = avcodec_find_decoder (_subtitle_codec_context->codec_id);
if (_subtitle_codec == 0) {