summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Reufer <thomas@reufer.ch>2015-04-25 18:36:55 +0200
committerThomas Reufer <thomas@reufer.ch>2015-04-25 18:36:55 +0200
commit355487443214ebe74ea49def9ac4749030f34660 (patch)
tree388ed3ca254e8c7aaf40f701518ef24161d0680c
parent19c214381b9c006a218e31c6c3e4aaa695e6c98f (diff)
downloadvdr-plugin-rpihddevice-355487443214ebe74ea49def9ac4749030f34660.tar.gz
vdr-plugin-rpihddevice-355487443214ebe74ea49def9ac4749030f34660.tar.bz2
simplified video stream start
-rw-r--r--omxdevice.c37
1 files changed, 12 insertions, 25 deletions
diff --git a/omxdevice.c b/omxdevice.c
index f800c11..61bde50 100644
--- a/omxdevice.c
+++ b/omxdevice.c
@@ -306,39 +306,26 @@ int cOmxDevice::PlayVideo(const uchar *Data, int Length, bool EndOfFrame)
m_mutex->Lock();
int ret = Length;
- cVideoCodec::eCodec codec = PesHasPts(Data) ? ParseVideoCodec(
- Data + PesPayloadOffset(Data), Length - PesPayloadOffset(Data)) :
- cVideoCodec::eInvalid;
-
- // video restart after Clear() with same codec
- bool videoRestart = (!m_hasVideo && codec == m_videoCodec &&
- cRpiSetup::IsVideoCodecSupported(codec));
-
- // video restart after SetPlayMode() or codec changed
- if (codec != cVideoCodec::eInvalid && codec != m_videoCodec)
+ if (!m_hasVideo && m_videoCodec == cVideoCodec::eInvalid)
{
- m_videoCodec = codec;
-
- if (m_hasVideo)
- {
- m_omx->StopVideo();
- m_hasVideo = false;
- }
+ m_videoCodec = ParseVideoCodec(Data + PesPayloadOffset(Data),
+ Length - PesPayloadOffset(Data));
- if (cRpiSetup::IsVideoCodecSupported(codec))
+ if (m_videoCodec != cVideoCodec::eInvalid)
{
- videoRestart = true;
- m_omx->SetVideoCodec(codec);
- DLOG("set video codec to %s", cVideoCodec::Str(codec));
+ if (cRpiSetup::IsVideoCodecSupported(m_videoCodec))
+ {
+ m_omx->SetVideoCodec(m_videoCodec);
+ DLOG("set video codec to %s", cVideoCodec::Str(m_videoCodec));
+ }
+ else
+ Skins.QueueMessage(mtError, tr("video format not supported!"));
}
- else
- Skins.QueueMessage(mtError, tr("video format not supported!"));
}
- if (videoRestart)
+ if (!m_hasVideo && cRpiSetup::IsVideoCodecSupported(m_videoCodec))
{
m_hasVideo = true;
-
if (!m_hasAudio)
{
DBG("video first");