| 20 |
20 |
#define CPU_COUNT(i) 1 // very crude ;)
|
| 21 |
21 |
#endif
|
| 22 |
22 |
|
|
23 |
#ifndef AVMEDIA_TYPE_AUDIO
|
|
24 |
#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
|
|
25 |
#endif
|
|
26 |
#ifndef AVMEDIA_TYPE_VIDEO
|
|
27 |
#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
|
|
28 |
#endif
|
|
29 |
#ifndef AVMEDIA_TYPE_UNKNOWN
|
|
30 |
#define AVMEDIA_TYPE_UNKNOWN CODEC_TYPE_UNKNOWN
|
|
31 |
#endif
|
|
32 |
|
| 23 |
33 |
#include "decoder.h"
|
| 24 |
34 |
|
| 25 |
35 |
#if LIBAVCODEC_VERSION_INT < ((52<<16)+(65<<8)+0)
|
| ... | ... | |
| 163 |
173 |
if (mp2_context)
|
| 164 |
174 |
{
|
| 165 |
175 |
mp2_context->codec_id = mp2_codecid;
|
| 166 |
|
mp2_context->codec_type = CODEC_TYPE_AUDIO;
|
|
176 |
mp2_context->codec_type = AVMEDIA_TYPE_AUDIO;
|
| 167 |
177 |
if (avcodec_open(mp2_context, mp2_codec) < 0)
|
| 168 |
178 |
{
|
| 169 |
179 |
esyslog("could not open codec for MP2");
|
| ... | ... | |
| 198 |
208 |
if (ac3_context)
|
| 199 |
209 |
{
|
| 200 |
210 |
ac3_context->codec_id = ac3_codecid;
|
| 201 |
|
ac3_context->codec_type = CODEC_TYPE_AUDIO;
|
|
211 |
ac3_context->codec_type = AVMEDIA_TYPE_AUDIO;
|
| 202 |
212 |
if (avcodec_open(ac3_context, ac3_codec) < 0)
|
| 203 |
213 |
{
|
| 204 |
214 |
esyslog("could not open codec for AC3");
|
| ... | ... | |
| 265 |
275 |
video_context->skip_frame=AVDISCARD_NONKEY; // just I-frames
|
| 266 |
276 |
}
|
| 267 |
277 |
video_context->codec_id = video_codecid;
|
| 268 |
|
video_context->codec_type = CODEC_TYPE_VIDEO;
|
|
278 |
video_context->codec_type = AVMEDIA_TYPE_VIDEO;
|
| 269 |
279 |
int ret=avcodec_open(video_context, video_codec);
|
| 270 |
280 |
if ((ret < 0) && (video_codecid==CODEC_ID_MPEG2VIDEO_XVMC))
|
| 271 |
281 |
{
|
| ... | ... | |
| 274 |
284 |
video_codec=avcodec_find_decoder(video_codecid);
|
| 275 |
285 |
if (video_codec)
|
| 276 |
286 |
{
|
| 277 |
|
video_context->codec_type=CODEC_TYPE_UNKNOWN;
|
|
287 |
video_context->codec_type=AVMEDIA_TYPE_UNKNOWN;
|
| 278 |
288 |
video_context->codec_id=CODEC_ID_NONE;
|
| 279 |
289 |
video_context->codec_tag=0;
|
| 280 |
290 |
memset(video_context->codec_name,0,sizeof(video_context->codec_name));
|