summaryrefslogtreecommitdiff
path: root/dxr3ffmpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'dxr3ffmpeg.c')
-rw-r--r--dxr3ffmpeg.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/dxr3ffmpeg.c b/dxr3ffmpeg.c
index 67ab99e..ea4e81d 100644
--- a/dxr3ffmpeg.c
+++ b/dxr3ffmpeg.c
@@ -27,64 +27,64 @@
//! constructor
cDxr3Ffmepg::cDxr3Ffmepg()
{
- avcodec_init();
- avcodec_register_all();
+ avcodec_init();
+ avcodec_register_all();
}
// ==================================
//! look if Codec is supported by ffmpeg
bool cDxr3Ffmepg::FindCodec(struct Dxr3Codec& Codec)
{
- // find codec
- Codec.codec = avcodec_find_decoder(Codec.id);
+ // find codec
+ Codec.codec = avcodec_find_decoder(Codec.id);
- if (!Codec.codec)
+ if (!Codec.codec)
+ {
+ // codec is't supported by ffmpeg
+ if (cDxr3ConfigData::Instance().GetDebug())
{
- // codec is't supported by ffmpeg
- if (cDxr3ConfigData::Instance().GetDebug())
- {
- cLog::Instance() << "cDxr3Ffmepg::OpenCodec(struct Dxr3Codec& Codec) codec not found (" << Codec.id << ")\n";
- }
- return false;
+ cLog::Instance() << "cDxr3Ffmepg::OpenCodec(struct Dxr3Codec& Codec) codec not found (" << Codec.id << ")\n";
}
+ return false;
+ }
- // init codec_context
- memset(&Codec.codec_context, 0, sizeof(Codec.codec_context));
+ // init codec_context
+ memset(&Codec.codec_context, 0, sizeof(Codec.codec_context));
- return true;
+ return true;
}
// ==================================
//! try to open Codec
bool cDxr3Ffmepg::OpenCodec(struct Dxr3Codec& Codec)
{
- // try to open codec
- int result = avcodec_open(&Codec.codec_context, Codec.codec);
+ // try to open codec
+ int result = avcodec_open(&Codec.codec_context, Codec.codec);
- if (result < 0)
- {
- // we could not open codec
- if (cDxr3ConfigData::Instance().GetDebug())
- {
- cLog::Instance() << "cDxr3Ffmepg::OpenCodec(struct Dxr3Codec& Codec) coudnt open codec (" << Codec.id << ")\n";
- }
- return false;
- }
- else
+ if (result < 0)
+ {
+ // we could not open codec
+ if (cDxr3ConfigData::Instance().GetDebug())
{
- Codec.Open = true;
+ cLog::Instance() << "cDxr3Ffmepg::OpenCodec(struct Dxr3Codec& Codec) coudnt open codec (" << Codec.id << ")\n";
}
+ return false;
+ }
+ else
+ {
+ Codec.Open = true;
+ }
- return true;
+ return true;
}
// ==================================
//! close codec
void cDxr3Ffmepg::CloseCodec(struct Dxr3Codec& Codec)
{
- if (Codec.Open)
- {
- avcodec_close(&Codec.codec_context);
- Codec.Open = false;
+ if (Codec.Open)
+ {
+ avcodec_close(&Codec.codec_context);
+ Codec.Open = false;
}
}