#include <stdint.h>
#include <boost/lexical_cast.hpp>
extern "C" {
-#include <tiffio.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
boost::mutex FFmpegDecoder::_mutex;
-FFmpegDecoder::FFmpegDecoder (shared_ptr<const Film> f, shared_ptr<const FFmpegContent> c, bool video, bool audio, bool subtitles)
+FFmpegDecoder::FFmpegDecoder (shared_ptr<const Film> f, shared_ptr<const FFmpegContent> c, bool video, bool audio)
: Decoder (f)
, VideoDecoder (f, c)
, AudioDecoder (f, c)
, _subtitle_codec (0)
, _decode_video (video)
, _decode_audio (audio)
- , _decode_subtitles (subtitles)
{
setup_general ();
setup_video ();
if (_ffmpeg_content->audio_stream() && _decode_audio) {
decode_audio_packet ();
}
-
+
+ /* Stop us being asked for any more data */
+ _next_video = _next_audio = _ffmpeg_content->length ();
return;
}
decode_video_packet ();
} else if (_ffmpeg_content->audio_stream() && _packet.stream_index == _ffmpeg_content->audio_stream()->id && _decode_audio) {
decode_audio_packet ();
- } else if (_ffmpeg_content->subtitle_stream() && _packet.stream_index == _ffmpeg_content->subtitle_stream()->id && _decode_subtitles) {
+ } else if (_ffmpeg_content->subtitle_stream() && _packet.stream_index == _ffmpeg_content->subtitle_stream()->id) {
int got_subtitle;
AVSubtitle sub;
}
avsubtitle_free (&sub);
}
+ } else {
+ cout << "[ffmpeg] other packet.\n";
}
av_free_packet (&_packet);
FFmpegDecoder::seek (Time t)
{
do_seek (t, false, false);
+ VideoDecoder::seek (t);
}
void
}
do_seek (next() - 2.5 * TIME_HZ / video_frame_rate(), true, true);
+ VideoDecoder::seek_back ();
}
void
}
do_seek (next() - 0.5 * TIME_HZ / video_frame_rate(), true, true);
+ VideoDecoder::seek_forward ();
}
void