mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
libeplayer3/input: stream duration fix
Origin commit data
------------------
Branch: master
Commit: 18d7a15b88
Author: martii <m4rtii@gmx.de>
Date: 2014-04-30 (Wed, 30 Apr 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -44,14 +44,13 @@ struct Track
|
||||
{
|
||||
std::string title;
|
||||
int pid;
|
||||
int64_t duration;
|
||||
AVFormatContext *avfc;
|
||||
AVStream *stream;
|
||||
bool inactive;
|
||||
bool is_static;
|
||||
int ac3flags;
|
||||
int type, mag, page; // for teletext
|
||||
Track() : pid(-1), duration(-1), avfc(NULL), stream(NULL), inactive(0), is_static(0), ac3flags(0) {}
|
||||
Track() : pid(-1), avfc(NULL), stream(NULL), inactive(0), is_static(0), ac3flags(0) {}
|
||||
};
|
||||
|
||||
class Manager
|
||||
|
@@ -446,10 +446,6 @@ bool Input::UpdateTracks()
|
||||
AVDictionaryEntry *lang = av_dict_get(stream->metadata, "language", NULL, 0);
|
||||
track.title = lang ? lang->value : "";
|
||||
track.pid = stream->id;
|
||||
if (stream->duration == AV_NOPTS_VALUE)
|
||||
track.duration = avfc->duration;
|
||||
else
|
||||
track.duration = av_rescale(stream->time_base.num * AV_TIME_BASE, stream->duration, stream->time_base.den);
|
||||
|
||||
switch (stream->codec->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO: {
|
||||
@@ -550,23 +546,11 @@ bool Input::Seek(int64_t avts, bool absolute)
|
||||
|
||||
bool Input::GetDuration(int64_t &duration)
|
||||
{
|
||||
if (avfc) {
|
||||
duration = avfc->duration;
|
||||
return true;
|
||||
}
|
||||
duration = 0;
|
||||
|
||||
Track *track = videoTrack;
|
||||
if (track && track->duration) {
|
||||
duration = track->duration;
|
||||
return true;
|
||||
}
|
||||
track = audioTrack;
|
||||
if (track && track->duration) {
|
||||
duration = track->duration;
|
||||
return true;
|
||||
}
|
||||
track = subtitleTrack;
|
||||
if (track && track->duration) {
|
||||
duration = track->duration;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user