From 1c313e89e23eea2349830cb2fd89e583c0f05839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 10 Apr 2007 12:24:02 +0200 Subject: Replace the duplicated meFOURCC macro with ME_FOURCC that is declared in bswap.h already. (transplanted from a7820d16324dbc6fd6b35481a78ff532f59ebe71) --HG-- extra : transplant_source : %A7%82%0D%162M%BCo%D6%B3T%81%A7%8F%F52%F5%9E%BEq --- src/demuxers/demux_matroska.c | 11 +- src/xine-engine/buffer_types.c | 398 ++++++++++++++++++++--------------------- 2 files changed, 197 insertions(+), 212 deletions(-) diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 64ac83a03..b45db701e 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -68,13 +68,6 @@ #define MAX(a, b) ((a)>(b)?(a):(b)) #endif -/* FOURCC will be manipulated using machine endian */ -#ifdef WORDS_BIGENDIAN -#define meFOURCC BE_FOURCC -#else -#define meFOURCC LE_FOURCC -#endif - typedef struct { int track_num; off_t *pos; @@ -1319,7 +1312,7 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) { /* create a bitmap info header struct for MPEG 4 */ bih = malloc(sizeof(xine_bmiheader) + track->codec_private_len); bih->biSize = sizeof(xine_bmiheader) + track->codec_private_len; - bih->biCompression = meFOURCC('M', 'P', '4', 'S'); + bih->biCompression = ME_FOURCC('M', 'P', '4', 'S'); bih->biWidth = track->video_track->pixel_width; bih->biHeight = track->video_track->pixel_height; _x_bmiheader_le2me(bih); @@ -1340,7 +1333,7 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) { /* create a bitmap info header struct for h264 */ bih = malloc(sizeof(xine_bmiheader) + track->codec_private_len); bih->biSize = sizeof(xine_bmiheader) + track->codec_private_len; - bih->biCompression = meFOURCC('a', 'v', 'c', '1'); + bih->biCompression = ME_FOURCC('a', 'v', 'c', '1'); bih->biWidth = track->video_track->pixel_width; bih->biHeight = track->video_track->pixel_height; _x_bmiheader_le2me(bih); diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index 619a34c4c..c5e3294f3 100644 --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.c @@ -38,14 +38,6 @@ #include "buffer.h" #include "bswap.h" -/* FOURCC will be manipulated using machine endian */ -#ifdef WORDS_BIGENDIAN -#define meFOURCC BE_FOURCC -#else -#define meFOURCC LE_FOURCC -#endif - - typedef struct video_db_s { uint32_t fourcc[20]; uint32_t buf_type; @@ -62,11 +54,11 @@ typedef struct audio_db_s { static const video_db_t video_db[] = { { { - meFOURCC('m', 'p', 'e', 'g'), - meFOURCC('M', 'P', 'E', 'G'), - meFOURCC('P', 'I', 'M', '1'), - meFOURCC('m', 'p', 'g', '2'), - meFOURCC('m', 'p', 'g', '1'), + ME_FOURCC('m', 'p', 'e', 'g'), + ME_FOURCC('M', 'P', 'E', 'G'), + ME_FOURCC('P', 'I', 'M', '1'), + ME_FOURCC('m', 'p', 'g', '2'), + ME_FOURCC('m', 'p', 'g', '1'), 0 }, BUF_VIDEO_MPEG, @@ -74,15 +66,15 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('D', 'I', 'V', 'X'), - meFOURCC('d', 'i', 'v', 'x'), - meFOURCC('D', 'i', 'v', 'x'), - meFOURCC('D', 'i', 'v', 'X'), - meFOURCC('M', 'P', '4', 'S'), - meFOURCC('m', 'p', '4', 'v'), - meFOURCC('M', '4', 'S', '2'), - meFOURCC('m', '4', 's', '2'), - meFOURCC('F', 'M', 'P', '4'), + ME_FOURCC('D', 'I', 'V', 'X'), + ME_FOURCC('d', 'i', 'v', 'x'), + ME_FOURCC('D', 'i', 'v', 'x'), + ME_FOURCC('D', 'i', 'v', 'X'), + ME_FOURCC('M', 'P', '4', 'S'), + ME_FOURCC('m', 'p', '4', 'v'), + ME_FOURCC('M', '4', 'S', '2'), + ME_FOURCC('m', '4', 's', '2'), + ME_FOURCC('F', 'M', 'P', '4'), 0 }, BUF_VIDEO_MPEG4, @@ -90,8 +82,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('X', 'V', 'I', 'D'), - meFOURCC('x', 'v', 'i', 'd'), + ME_FOURCC('X', 'V', 'I', 'D'), + ME_FOURCC('x', 'v', 'i', 'd'), 0 }, BUF_VIDEO_XVID, @@ -99,7 +91,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('D', 'X', '5', '0'), + ME_FOURCC('D', 'X', '5', '0'), 0 }, BUF_VIDEO_DIVX5, @@ -107,7 +99,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('c', 'v', 'i', 'd'), + ME_FOURCC('c', 'v', 'i', 'd'), 0 }, BUF_VIDEO_CINEPAK, @@ -115,9 +107,9 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('S', 'V', 'Q', '1'), - meFOURCC('s', 'v', 'q', '1'), - meFOURCC('s', 'v', 'q', 'i'), + ME_FOURCC('S', 'V', 'Q', '1'), + ME_FOURCC('s', 'v', 'q', '1'), + ME_FOURCC('s', 'v', 'q', 'i'), 0 }, BUF_VIDEO_SORENSON_V1, @@ -125,8 +117,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('S', 'V', 'Q', '3'), - meFOURCC('s', 'v', 'q', '3'), + ME_FOURCC('S', 'V', 'Q', '3'), + ME_FOURCC('s', 'v', 'q', '3'), 0 }, BUF_VIDEO_SORENSON_V3, @@ -134,10 +126,10 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('M', 'P', '4', '1'), - meFOURCC('m', 'p', '4', '1'), - meFOURCC('M', 'P', 'G', '4'), - meFOURCC('m', 'p', 'g', '4'), + ME_FOURCC('M', 'P', '4', '1'), + ME_FOURCC('m', 'p', '4', '1'), + ME_FOURCC('M', 'P', 'G', '4'), + ME_FOURCC('m', 'p', 'g', '4'), 0 }, BUF_VIDEO_MSMPEG4_V1, @@ -145,12 +137,12 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('M', 'P', '4', '1'), - meFOURCC('m', 'p', '4', '1'), - meFOURCC('M', 'P', '4', '2'), - meFOURCC('m', 'p', '4', '2'), - meFOURCC('D', 'I', 'V', '2'), - meFOURCC('d', 'i', 'v', '2'), + ME_FOURCC('M', 'P', '4', '1'), + ME_FOURCC('m', 'p', '4', '1'), + ME_FOURCC('M', 'P', '4', '2'), + ME_FOURCC('m', 'p', '4', '2'), + ME_FOURCC('D', 'I', 'V', '2'), + ME_FOURCC('d', 'i', 'v', '2'), 0 }, BUF_VIDEO_MSMPEG4_V2, @@ -158,20 +150,20 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('M', 'P', '4', '3'), - meFOURCC('m', 'p', '4', '3'), - meFOURCC('D', 'I', 'V', '3'), - meFOURCC('d', 'i', 'v', '3'), - meFOURCC('D', 'I', 'V', '4'), - meFOURCC('d', 'i', 'v', '4'), - meFOURCC('D', 'I', 'V', '5'), - meFOURCC('d', 'i', 'v', '5'), - meFOURCC('D', 'I', 'V', '6'), - meFOURCC('d', 'i', 'v', '6'), - meFOURCC('A', 'P', '4', '1'), - meFOURCC('M', 'P', 'G', '3'), - meFOURCC('C', 'O', 'L', '1'), - meFOURCC('3', 'I', 'V', 'D'), + ME_FOURCC('M', 'P', '4', '3'), + ME_FOURCC('m', 'p', '4', '3'), + ME_FOURCC('D', 'I', 'V', '3'), + ME_FOURCC('d', 'i', 'v', '3'), + ME_FOURCC('D', 'I', 'V', '4'), + ME_FOURCC('d', 'i', 'v', '4'), + ME_FOURCC('D', 'I', 'V', '5'), + ME_FOURCC('d', 'i', 'v', '5'), + ME_FOURCC('D', 'I', 'V', '6'), + ME_FOURCC('d', 'i', 'v', '6'), + ME_FOURCC('A', 'P', '4', '1'), + ME_FOURCC('M', 'P', 'G', '3'), + ME_FOURCC('C', 'O', 'L', '1'), + ME_FOURCC('3', 'I', 'V', 'D'), 0 }, BUF_VIDEO_MSMPEG4_V3, @@ -179,8 +171,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('3', 'I', 'V', '1'), - meFOURCC('3', 'I', 'V', '2'), + ME_FOURCC('3', 'I', 'V', '1'), + ME_FOURCC('3', 'I', 'V', '2'), 0 }, BUF_VIDEO_3IVX, @@ -188,11 +180,11 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('d', 'm', 'b', '1'), - meFOURCC('M', 'J', 'P', 'G'), - meFOURCC('m', 'j', 'p', 'a'), - meFOURCC('A', 'V', 'R', 'n'), - meFOURCC('A', 'V', 'D', 'J'), + ME_FOURCC('d', 'm', 'b', '1'), + ME_FOURCC('M', 'J', 'P', 'G'), + ME_FOURCC('m', 'j', 'p', 'a'), + ME_FOURCC('A', 'V', 'R', 'n'), + ME_FOURCC('A', 'V', 'D', 'J'), 0 }, BUF_VIDEO_MJPEG, @@ -200,7 +192,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('m', 'j', 'p', 'b'), + ME_FOURCC('m', 'j', 'p', 'b'), 0 }, BUF_VIDEO_MJPEG_B, @@ -208,8 +200,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('I', 'V', '5', '0'), - meFOURCC('i', 'v', '5', '0'), + ME_FOURCC('I', 'V', '5', '0'), + ME_FOURCC('i', 'v', '5', '0'), 0 }, BUF_VIDEO_IV50, @@ -217,8 +209,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('I', 'V', '4', '1'), - meFOURCC('i', 'v', '4', '1'), + ME_FOURCC('I', 'V', '4', '1'), + ME_FOURCC('i', 'v', '4', '1'), 0 }, BUF_VIDEO_IV41, @@ -226,8 +218,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('I', 'V', '3', '2'), - meFOURCC('i', 'v', '3', '2'), + ME_FOURCC('I', 'V', '3', '2'), + ME_FOURCC('i', 'v', '3', '2'), 0 }, BUF_VIDEO_IV32, @@ -235,8 +227,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('I', 'V', '3', '1'), - meFOURCC('i', 'v', '3', '1'), + ME_FOURCC('I', 'V', '3', '1'), + ME_FOURCC('i', 'v', '3', '1'), 0 }, BUF_VIDEO_IV31, @@ -244,7 +236,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('V', 'C', 'R', '1'), + ME_FOURCC('V', 'C', 'R', '1'), 0 }, BUF_VIDEO_ATIVCR1, @@ -252,7 +244,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('V', 'C', 'R', '2'), + ME_FOURCC('V', 'C', 'R', '2'), 0 }, BUF_VIDEO_ATIVCR2, @@ -260,11 +252,11 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('I', '2', '6', '3'), - meFOURCC('i', '2', '6', '3'), - meFOURCC('V', 'I', 'V', 'O'), - meFOURCC('v', 'i', 'v', 'o'), - meFOURCC('v', 'i', 'v', '1'), + ME_FOURCC('I', '2', '6', '3'), + ME_FOURCC('i', '2', '6', '3'), + ME_FOURCC('V', 'I', 'V', 'O'), + ME_FOURCC('v', 'i', 'v', 'o'), + ME_FOURCC('v', 'i', 'v', '1'), 0 }, BUF_VIDEO_I263, @@ -272,8 +264,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('D','I','B',' '), /* device-independent bitmap */ - meFOURCC('r','a','w',' '), + ME_FOURCC('D','I','B',' '), /* device-independent bitmap */ + ME_FOURCC('r','a','w',' '), 0 }, BUF_VIDEO_RGB, @@ -285,8 +277,8 @@ static const video_db_t video_db[] = { else if (!strncasecmp (video, "yuv2", 4)) this->video_type = BUF_VIDEO_YUY2; */ - meFOURCC('y', 'u', 'v', '2'), - meFOURCC('Y', 'U', 'Y', '2'), + ME_FOURCC('y', 'u', 'v', '2'), + ME_FOURCC('Y', 'U', 'Y', '2'), 0 }, BUF_VIDEO_YUY2, @@ -294,8 +286,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('j','p','e','g'), - meFOURCC('J','F','I','F'), + ME_FOURCC('j','p','e','g'), + ME_FOURCC('J','F','I','F'), 0 }, BUF_VIDEO_JPEG, @@ -303,7 +295,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('W','M','V','1'), + ME_FOURCC('W','M','V','1'), 0 }, BUF_VIDEO_WMV7, @@ -311,7 +303,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('W','M','V','2'), + ME_FOURCC('W','M','V','2'), 0 }, BUF_VIDEO_WMV8, @@ -319,8 +311,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('W','M','V','3'), - meFOURCC('W','M','V','P'), + ME_FOURCC('W','M','V','3'), + ME_FOURCC('W','M','V','P'), 0 }, BUF_VIDEO_WMV9, @@ -328,12 +320,12 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('c','r','a','m'), - meFOURCC('C','R','A','M'), - meFOURCC('M','S','V','C'), - meFOURCC('m','s','v','c'), - meFOURCC('W','H','A','M'), - meFOURCC('w','h','a','m'), + ME_FOURCC('c','r','a','m'), + ME_FOURCC('C','R','A','M'), + ME_FOURCC('M','S','V','C'), + ME_FOURCC('m','s','v','c'), + ME_FOURCC('W','H','A','M'), + ME_FOURCC('w','h','a','m'), 0 }, BUF_VIDEO_MSVC, @@ -341,9 +333,9 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('D','V','S','D'), - meFOURCC('d','v','s','d'), - meFOURCC('d','v','c','p'), + ME_FOURCC('D','V','S','D'), + ME_FOURCC('d','v','s','d'), + ME_FOURCC('d','v','c','p'), 0 }, BUF_VIDEO_DV, @@ -351,11 +343,11 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('V','P','3',' '), - meFOURCC('V','P','3','0'), - meFOURCC('v','p','3','0'), - meFOURCC('V','P','3','1'), - meFOURCC('v','p','3','1'), + ME_FOURCC('V','P','3',' '), + ME_FOURCC('V','P','3','0'), + ME_FOURCC('v','p','3','0'), + ME_FOURCC('V','P','3','1'), + ME_FOURCC('v','p','3','1'), 0 }, BUF_VIDEO_VP31, @@ -363,7 +355,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('V','P','4','0'), + ME_FOURCC('V','P','4','0'), 0, }, BUF_VIDEO_VP4, @@ -371,10 +363,10 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('H', '2', '6', '3'), - meFOURCC('h', '2', '6', '3'), - meFOURCC('U', '2', '6', '3'), - meFOURCC('s', '2', '6', '3'), + ME_FOURCC('H', '2', '6', '3'), + ME_FOURCC('h', '2', '6', '3'), + ME_FOURCC('U', '2', '6', '3'), + ME_FOURCC('s', '2', '6', '3'), 0 }, BUF_VIDEO_H263, @@ -382,8 +374,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('c', 'y', 'u', 'v'), - meFOURCC('C', 'Y', 'U', 'V'), + ME_FOURCC('c', 'y', 'u', 'v'), + ME_FOURCC('C', 'Y', 'U', 'V'), 0 }, BUF_VIDEO_CYUV, @@ -391,7 +383,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('s', 'm', 'c', ' '), + ME_FOURCC('s', 'm', 'c', ' '), 0 }, BUF_VIDEO_SMC, @@ -399,8 +391,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('r', 'p', 'z', 'a'), - meFOURCC('a', 'z', 'p', 'r'), + ME_FOURCC('r', 'p', 'z', 'a'), + ME_FOURCC('a', 'z', 'p', 'r'), 0 }, BUF_VIDEO_RPZA, @@ -408,7 +400,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('r', 'l', 'e', ' '), + ME_FOURCC('r', 'l', 'e', ' '), 0 }, BUF_VIDEO_QTRLE, @@ -423,7 +415,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('D', 'U', 'C', 'K'), + ME_FOURCC('D', 'U', 'C', 'K'), 0 }, BUF_VIDEO_DUCKTM1, @@ -431,7 +423,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('M', 'S', 'S', '1'), + ME_FOURCC('M', 'S', 'S', '1'), 0 }, BUF_VIDEO_MSS1, @@ -439,7 +431,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('P', 'G', 'V', 'V'), + ME_FOURCC('P', 'G', 'V', 'V'), 0 }, BUF_VIDEO_PGVV, @@ -447,7 +439,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('Z', 'y', 'G', 'o'), + ME_FOURCC('Z', 'y', 'G', 'o'), 0 }, BUF_VIDEO_ZYGO, @@ -455,7 +447,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('t', 's', 'c', 'c'), + ME_FOURCC('t', 's', 'c', 'c'), 0 }, BUF_VIDEO_TSCC, @@ -463,7 +455,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('Y', 'V', 'U', '9'), + ME_FOURCC('Y', 'V', 'U', '9'), 0 }, BUF_VIDEO_YVU9, @@ -471,7 +463,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('G', 'R', 'E', 'Y'), + ME_FOURCC('G', 'R', 'E', 'Y'), 0 }, BUF_VIDEO_GREY, @@ -479,9 +471,9 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('X', 'x', 'a', 'n'), - meFOURCC('X', 'X', 'A', 'N'), - meFOURCC('x', 'x', 'a', 'n'), + ME_FOURCC('X', 'x', 'a', 'n'), + ME_FOURCC('X', 'X', 'A', 'N'), + ME_FOURCC('x', 'x', 'a', 'n'), 0 }, BUF_VIDEO_XXAN, @@ -489,8 +481,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('Y', 'V', '1', '2'), - meFOURCC('y', 'v', '1', '2'), + ME_FOURCC('Y', 'V', '1', '2'), + ME_FOURCC('y', 'v', '1', '2'), 0 }, BUF_VIDEO_YV12, @@ -498,8 +490,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('I', '4', '2', '0'), - meFOURCC('I', 'Y', 'U', 'V'), + ME_FOURCC('I', '4', '2', '0'), + ME_FOURCC('I', 'Y', 'U', 'V'), 0 }, BUF_VIDEO_I420, @@ -507,8 +499,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('S', 'E', 'G', 'A'), - meFOURCC('s', 'e', 'g', 'a'), + ME_FOURCC('S', 'E', 'G', 'A'), + ME_FOURCC('s', 'e', 'g', 'a'), 0 }, BUF_VIDEO_SEGA, @@ -516,8 +508,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('m', 'v', 'i', '2'), - meFOURCC('M', 'V', 'I', '2'), + ME_FOURCC('m', 'v', 'i', '2'), + ME_FOURCC('M', 'V', 'I', '2'), 0 }, BUF_VIDEO_MVI2, @@ -525,8 +517,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('u', 'c', 'o', 'd'), - meFOURCC('U', 'C', 'O', 'D'), + ME_FOURCC('u', 'c', 'o', 'd'), + ME_FOURCC('U', 'C', 'O', 'D'), 0 }, BUF_VIDEO_UCOD, @@ -534,7 +526,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('R', 'V', '1', '0'), + ME_FOURCC('R', 'V', '1', '0'), 0 }, BUF_VIDEO_RV10, @@ -542,7 +534,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('R', 'V', '2', '0'), + ME_FOURCC('R', 'V', '2', '0'), 0 }, BUF_VIDEO_RV20, @@ -550,7 +542,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('R', 'V', '3', '0'), + ME_FOURCC('R', 'V', '3', '0'), 0 }, BUF_VIDEO_RV30, @@ -558,7 +550,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('R', 'V', '4', '0'), + ME_FOURCC('R', 'V', '4', '0'), 0 }, BUF_VIDEO_RV40, @@ -566,7 +558,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('H', 'F', 'Y', 'U'), + ME_FOURCC('H', 'F', 'Y', 'U'), 0, }, BUF_VIDEO_HUFFYUV, @@ -574,8 +566,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('I', 'M', 'G', ' '), - meFOURCC('g', 'i', 'f', ' '), + ME_FOURCC('I', 'M', 'G', ' '), + ME_FOURCC('g', 'i', 'f', ' '), 0, }, BUF_VIDEO_IMAGE, @@ -590,7 +582,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('V','P','5','0'), + ME_FOURCC('V','P','5','0'), 0 }, BUF_VIDEO_VP5, @@ -598,9 +590,9 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('V','P','6','0'), - meFOURCC('V','P','6','1'), - meFOURCC('V','P','6','2'), + ME_FOURCC('V','P','6','0'), + ME_FOURCC('V','P','6','1'), + ME_FOURCC('V','P','6','2'), 0 }, BUF_VIDEO_VP6, @@ -608,7 +600,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('8','B', 'P','S'), + ME_FOURCC('8','B', 'P','S'), 0 }, BUF_VIDEO_8BPS, @@ -616,7 +608,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('Z','L','I','B'), + ME_FOURCC('Z','L','I','B'), 0 }, BUF_VIDEO_ZLIB, @@ -624,7 +616,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('M','S','Z','H'), + ME_FOURCC('M','S','Z','H'), 0 }, BUF_VIDEO_MSZH, @@ -632,7 +624,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('A','S','V','1'), + ME_FOURCC('A','S','V','1'), 0 }, BUF_VIDEO_ASV1, @@ -640,7 +632,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('A','S','V','2'), + ME_FOURCC('A','S','V','2'), 0 }, BUF_VIDEO_ASV2, @@ -648,9 +640,9 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('a','v','c','1'), - meFOURCC('h','2','6','4'), - meFOURCC('H','2','6','4'), + ME_FOURCC('a','v','c','1'), + ME_FOURCC('h','2','6','4'), + ME_FOURCC('H','2','6','4'), 0 }, BUF_VIDEO_H264, @@ -658,7 +650,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('A','A','S','C'), + ME_FOURCC('A','A','S','C'), 0 }, BUF_VIDEO_AASC, @@ -666,7 +658,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('q','d','r','w'), + ME_FOURCC('q','d','r','w'), 0 }, BUF_VIDEO_QDRW, @@ -674,7 +666,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('L','O','C','O'), + ME_FOURCC('L','O','C','O'), 0 }, BUF_VIDEO_LOCO, @@ -682,7 +674,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('U','L','T','I'), + ME_FOURCC('U','L','T','I'), 0 }, BUF_VIDEO_ULTI, @@ -690,7 +682,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('W','N','V','1'), + ME_FOURCC('W','N','V','1'), 0 }, BUF_VIDEO_WNV1, @@ -698,8 +690,8 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('P','I','X','L'), - meFOURCC('X','I','X','L'), + ME_FOURCC('P','I','X','L'), + ME_FOURCC('X','I','X','L'), 0 }, BUF_VIDEO_XL, @@ -707,9 +699,9 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('Q','P','E','G'), - meFOURCC('Q','1','.','0'), - meFOURCC('Q','1','.','1'), + ME_FOURCC('Q','P','E','G'), + ME_FOURCC('Q','1','.','0'), + ME_FOURCC('Q','1','.','1'), 0 }, BUF_VIDEO_QPEG, @@ -717,7 +709,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('R','T','2','1'), + ME_FOURCC('R','T','2','1'), 0 }, BUF_VIDEO_RT21, @@ -725,7 +717,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('F','P','S','1'), + ME_FOURCC('F','P','S','1'), 0 }, BUF_VIDEO_FPS1, @@ -733,7 +725,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('T','M','2','0'), + ME_FOURCC('T','M','2','0'), 0 }, BUF_VIDEO_DUCKTM2, @@ -741,7 +733,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('C','S','C','D'), + ME_FOURCC('C','S','C','D'), 0 }, BUF_VIDEO_CSCD, @@ -749,7 +741,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('Z','M','B','V'), + ME_FOURCC('Z','M','B','V'), 0 }, BUF_VIDEO_ZMBV, @@ -757,7 +749,7 @@ static const video_db_t video_db[] = { }, { { - meFOURCC('K','M','V','C'), + ME_FOURCC('K','M','V','C'), 0 }, BUF_VIDEO_KMVC, @@ -771,7 +763,7 @@ static const audio_db_t audio_db[] = { { { 0x2000, - meFOURCC('m', 's', 0x20, 0x00), + ME_FOURCC('m', 's', 0x20, 0x00), 0 }, BUF_AUDIO_A52, @@ -780,9 +772,9 @@ static const audio_db_t audio_db[] = { { { 0x50, 0x55, - meFOURCC('.','m','p','3'), - meFOURCC('m', 's', 0, 0x55), - meFOURCC('M','P','3',' '), + ME_FOURCC('.','m','p','3'), + ME_FOURCC('m', 's', 0, 0x55), + ME_FOURCC('M','P','3',' '), 0 }, BUF_AUDIO_MPEG, @@ -790,8 +782,8 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('t','w','o','s'), - meFOURCC('i','n','2','4'), + ME_FOURCC('t','w','o','s'), + ME_FOURCC('i','n','2','4'), 0 }, BUF_AUDIO_LPCM_BE, @@ -800,8 +792,8 @@ static const audio_db_t audio_db[] = { { { 0x01, - meFOURCC('r','a','w',' '), - meFOURCC('s','o','w','t'), + ME_FOURCC('r','a','w',' '), + ME_FOURCC('s','o','w','t'), 0 }, BUF_AUDIO_LPCM_LE, @@ -852,7 +844,7 @@ static const audio_db_t audio_db[] = { { { 0x02, - meFOURCC('m', 's', 0, 0x02), + ME_FOURCC('m', 's', 0, 0x02), 0 }, BUF_AUDIO_MSADPCM, @@ -861,7 +853,7 @@ static const audio_db_t audio_db[] = { { { 0x11, - meFOURCC('m', 's', 0, 0x11), + ME_FOURCC('m', 's', 0, 0x11), 0 }, BUF_AUDIO_MSIMAADPCM, @@ -879,8 +871,8 @@ static const audio_db_t audio_db[] = { /* these formattags are used by Vorbis ACM encoder and supported by NanDub, a variant of VirtualDub. */ 0x674f, 0x676f, 0x6750, 0x6770, 0x6751, 0x6771, - meFOURCC('O','g','g','S'), - meFOURCC('O','g','g','V'), + ME_FOURCC('O','g','g','S'), + ME_FOURCC('O','g','g','V'), 0 }, BUF_AUDIO_VORBIS, @@ -937,7 +929,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('i', 'm', 'a', '4'), + ME_FOURCC('i', 'm', 'a', '4'), 0 }, BUF_AUDIO_QTIMAADPCM, @@ -945,8 +937,8 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('m', 'a', 'c', '3'), - meFOURCC('M', 'A', 'C', '3'), + ME_FOURCC('m', 'a', 'c', '3'), + ME_FOURCC('M', 'A', 'C', '3'), 0 }, BUF_AUDIO_MAC3, @@ -954,8 +946,8 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('m', 'a', 'c', '6'), - meFOURCC('M', 'A', 'C', '6'), + ME_FOURCC('m', 'a', 'c', '6'), + ME_FOURCC('M', 'A', 'C', '6'), 0 }, BUF_AUDIO_MAC6, @@ -963,7 +955,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('Q', 'D', 'M', 'C'), + ME_FOURCC('Q', 'D', 'M', 'C'), 0 }, BUF_AUDIO_QDESIGN1, @@ -971,7 +963,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('Q', 'D', 'M', '2'), + ME_FOURCC('Q', 'D', 'M', '2'), 0 }, BUF_AUDIO_QDESIGN2, @@ -980,11 +972,11 @@ static const audio_db_t audio_db[] = { { { 0xFF, - meFOURCC('m', 'p', '4', 'a'), - meFOURCC('M', 'P', '4', 'A'), - meFOURCC('r', 'a', 'a', 'c'), - meFOURCC('r', 'a', 'c', 'p'), - meFOURCC('A', 'A', 'C', ' '), + ME_FOURCC('m', 'p', '4', 'a'), + ME_FOURCC('M', 'P', '4', 'A'), + ME_FOURCC('r', 'a', 'a', 'c'), + ME_FOURCC('r', 'a', 'c', 'p'), + ME_FOURCC('A', 'A', 'C', ' '), 0 }, BUF_AUDIO_AAC, @@ -992,7 +984,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('d', 'n', 'e', 't'), + ME_FOURCC('d', 'n', 'e', 't'), 0 }, BUF_AUDIO_DNET, @@ -1000,7 +992,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('s', 'i', 'p', 'r'), + ME_FOURCC('s', 'i', 'p', 'r'), 0 }, BUF_AUDIO_SIPRO, @@ -1008,7 +1000,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('c', 'o', 'o', 'k'), + ME_FOURCC('c', 'o', 'o', 'k'), 0 }, BUF_AUDIO_COOK, @@ -1016,7 +1008,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('a', 't', 'r', 'c'), + ME_FOURCC('a', 't', 'r', 'c'), 0 }, BUF_AUDIO_ATRK, @@ -1024,7 +1016,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('Q', 'c', 'l', 'p'), + ME_FOURCC('Q', 'c', 'l', 'p'), 0 }, BUF_AUDIO_QCLP, @@ -1033,7 +1025,7 @@ static const audio_db_t audio_db[] = { { { 0x7, - meFOURCC('u', 'l', 'a', 'w'), + ME_FOURCC('u', 'l', 'a', 'w'), 0 }, BUF_AUDIO_MULAW, @@ -1042,7 +1034,7 @@ static const audio_db_t audio_db[] = { { { 0x6, - meFOURCC('a', 'l', 'a', 'w'), + ME_FOURCC('a', 'l', 'a', 'w'), 0 }, BUF_AUDIO_ALAW, @@ -1050,7 +1042,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('a', 'g', 's', 'm'), + ME_FOURCC('a', 'g', 's', 'm'), 0 }, BUF_AUDIO_GSM610, @@ -1072,7 +1064,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('l', 'p', 'c', 'J'), + ME_FOURCC('l', 'p', 'c', 'J'), 0 }, BUF_AUDIO_14_4, @@ -1080,7 +1072,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('2', '8', '_', '8'), + ME_FOURCC('2', '8', '_', '8'), 0 }, BUF_AUDIO_28_8, @@ -1095,7 +1087,7 @@ static const audio_db_t audio_db[] = { }, { { - meFOURCC('a', 'l', 'a', 'c'), + ME_FOURCC('a', 'l', 'a', 'c'), }, BUF_AUDIO_ALAC, "Apple Lossless Audio Codec" -- cgit v1.2.3 From 6e8eab4d19635a07ff19be6fa494ab45b3861cbb Mon Sep 17 00:00:00 2001 From: Claudio Ciccani Date: Sun, 11 Nov 2007 13:16:49 +0100 Subject: Added FOURCC for VP6F. (transplanted from 3bea001775a81a2c784e000794ea5cc6d34dc40d) --HG-- extra : transplant_source : %3B%EA%00%17u%A8%1A%2CxN%00%07%94%EA%5C%C6%D3M%C4%0D --- src/xine-engine/buffer_types.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index c5e3294f3..a8c926821 100644 --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.c @@ -598,6 +598,14 @@ static const video_db_t video_db[] = { BUF_VIDEO_VP6, "On2 VP6" }, +{ + { + ME_FOURCC('V','P','6','F'), + 0 + }, + BUF_VIDEO_VP6F, + "On2 VP6" +}, { { ME_FOURCC('8','B', 'P','S'), -- cgit v1.2.3 From 6a5bcc15286d28e17c52783caf1d5d2b677479dd Mon Sep 17 00:00:00 2001 From: Claudio Ciccani Date: Sun, 11 Nov 2007 14:52:34 +0100 Subject: Reset the previous screen resolution after switching to fullscreen. This is because, while in shared mode the default resolution is taken from directfb config, in fullscreen mode the default resolution comes from fbdev configuration. (transplanted from 2ce76206b5c10b6f9cfc55a9edb0d883bfb446a2) --HG-- extra : transplant_source : %2C%E7b%06%B5%C1%0Bo%9C%FCU%A9%ED%B0%D8%83%BF%B4F%A2 --- src/video_out/video_out_directfb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c index efbb30f2d..ee52b7817 100644 --- a/src/video_out/video_out_directfb.c +++ b/src/video_out/video_out_directfb.c @@ -1663,13 +1663,13 @@ static DFBResult init_device (directfb_driver_t *this) { if (this->visual_type == XINE_VISUAL_TYPE_FB) { this->underlay->SetCooperativeLevel (this->underlay, DLSCL_EXCLUSIVE); - this->underlay->SetBackgroundMode( this->underlay, DLBM_DONTCARE); + this->underlay->SetConfiguration (this->underlay, &config); } } } else { /* playing to underlay, - * check if stretchblit is hardware accelerated. */ + * check whether stretchblit is hardware accelerated. */ IDirectFBSurface *temp; DFBSurfaceDescription dsc; DFBAccelerationMask mask = DFXL_NONE; -- cgit v1.2.3 From 12d4e44e91333056cf23174353bbc718f01248d5 Mon Sep 17 00:00:00 2001 From: Claudio Ciccani Date: Mon, 12 Nov 2007 11:18:17 +0100 Subject: Do not mind about ASX playlist version. Some servers don't set this information, thus the demuxer fails. --- src/demuxers/demux_asf.c | 146 +++++++++++++++++++++-------------------------- 1 file changed, 64 insertions(+), 82 deletions(-) diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 579e0af07..9c977f417 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -1536,108 +1536,90 @@ static int demux_asf_parse_asx_references( demux_asf_t *this) { ENTRYREF, MOREINFO, PARAM, REPEAT, TITLE */ - const char *version = xml_parser_get_property (xml_tree, "VERSION"); + const char *base_href = NULL; - if (version) { - int version_major, version_minor = 0; + for (asx_entry = xml_tree->child; asx_entry; asx_entry = asx_entry->next) + { + const char *ref_base_href = base_href; - if((sscanf (version, "%d.%d", &version_major, &version_minor) == 2 || - sscanf (version, "%d", &version_major) == 1) && - (version_major == 3 && version_minor == 0)) + if (!strcasecmp (asx_entry->name, "ENTRY")) { - const char *base_href = NULL; + /* Attributes: CLIENTSKIP, SKIPIFREF + * Child elements: ABSTRACT, AUTHOR, BASE, COPYRIGHT, DURATION, + ENDMARKER, MOREINFO, PARAM, REF, STARTMARKER, + STARTTIME, TITLE + */ + const char *href = NULL; + const char *title = NULL; + uint32_t start_time = (uint32_t)-1; + uint32_t duration = (uint32_t)-1; - for (asx_entry = xml_tree->child; asx_entry; asx_entry = asx_entry->next) + for (asx_ref = asx_entry->child; asx_ref; asx_ref = asx_ref->next) { - const char *ref_base_href = base_href; - - if (!strcasecmp (asx_entry->name, "ENTRY")) + if (!strcasecmp(asx_ref->name, "REF")) { - /* Attributes: CLIENTSKIP, SKIPIFREF - * Child elements: ABSTRACT, AUTHOR, BASE, COPYRIGHT, DURATION, - ENDMARKER, MOREINFO, PARAM, REF, STARTMARKER, - STARTTIME, TITLE + xml_node_t *asx_sub; + /* Attributes: HREF + * Child elements: DURATION, ENDMARKER, STARTMARKER, STARTTIME + */ + + /* FIXME: multiple REFs => alternative streams + * (and per-ref start times and durations?). + * Just the one title, though. */ - const char *href = NULL; - const char *title = NULL; - uint32_t start_time = (uint32_t)-1; - uint32_t duration = (uint32_t)-1; + href = xml_parser_get_property (asx_ref, "HREF"); - for (asx_ref = asx_entry->child; asx_ref; asx_ref = asx_ref->next) + for (asx_sub = asx_ref->child; asx_sub; asx_sub = asx_sub->next) { - if (!strcasecmp(asx_ref->name, "REF")) - { - xml_node_t *asx_sub; - /* Attributes: HREF - * Child elements: DURATION, ENDMARKER, STARTMARKER, STARTTIME - */ - - /* FIXME: multiple REFs => alternative streams - * (and per-ref start times and durations?). - * Just the one title, though. - */ - href = xml_parser_get_property (asx_ref, "HREF"); - - for (asx_sub = asx_ref->child; asx_sub; asx_sub = asx_sub->next) - { - if (!strcasecmp (asx_sub->name, "STARTTIME")) - start_time = asx_get_time_value (asx_sub); - else if (!strcasecmp (asx_sub->name, "DURATION")) - duration = asx_get_time_value (asx_sub); - } - } - - else if (!strcasecmp (asx_ref->name, "TITLE")) - { - if (!title) - title = asx_ref->data; - } - - else if (!strcasecmp (asx_ref->name, "STARTTIME")) - { - if (start_time == (uint32_t)-1) - start_time = asx_get_time_value (asx_ref); - } - - else if (!strcasecmp (asx_ref->name, "DURATION")) - { - if (duration == (uint32_t)-1) - duration = asx_get_time_value (asx_ref); - } - - else if (!strcasecmp (asx_ref->name, "BASE")) - /* Attributes: HREF */ - ref_base_href = xml_parser_get_property (asx_entry, "HREF"); + if (!strcasecmp (asx_sub->name, "STARTTIME")) + start_time = asx_get_time_value (asx_sub); + else if (!strcasecmp (asx_sub->name, "DURATION")) + duration = asx_get_time_value (asx_sub); } + } + + else if (!strcasecmp (asx_ref->name, "TITLE")) + { + if (!title) + title = asx_ref->data; + } - /* FIXME: prepend ref_base_href to href */ - if (href && *href) - _x_demux_send_mrl_reference (this->stream, 0, href, title, - start_time == (uint32_t)-1 ? 0 : start_time, - duration == (uint32_t)-1 ? -1 : duration); + else if (!strcasecmp (asx_ref->name, "STARTTIME")) + { + if (start_time == (uint32_t)-1) + start_time = asx_get_time_value (asx_ref); } - else if (!strcasecmp (asx_entry->name, "ENTRYREF")) + else if (!strcasecmp (asx_ref->name, "DURATION")) { - /* Attributes: HREF, CLIENTBIND */ - const char *href = xml_parser_get_property (asx_entry, "HREF"); - if (href && *href) - _x_demux_send_mrl_reference (this->stream, 0, href, NULL, 0, -1); + if (duration == (uint32_t)-1) + duration = asx_get_time_value (asx_ref); } - else if (!strcasecmp (asx_entry->name, "BASE")) + else if (!strcasecmp (asx_ref->name, "BASE")) /* Attributes: HREF */ - base_href = xml_parser_get_property (asx_entry, "HREF"); + ref_base_href = xml_parser_get_property (asx_entry, "HREF"); } + + /* FIXME: prepend ref_base_href to href */ + if (href && *href) + _x_demux_send_mrl_reference (this->stream, 0, href, title, + start_time == (uint32_t)-1 ? 0 : start_time, + duration == (uint32_t)-1 ? -1 : duration); } - else - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - _("demux_asf: Wrong ASX version: %s\n"), version); - + + else if (!strcasecmp (asx_entry->name, "ENTRYREF")) + { + /* Attributes: HREF, CLIENTBIND */ + const char *href = xml_parser_get_property (asx_entry, "HREF"); + if (href && *href) + _x_demux_send_mrl_reference (this->stream, 0, href, NULL, 0, -1); + } + + else if (!strcasecmp (asx_entry->name, "BASE")) + /* Attributes: HREF */ + base_href = xml_parser_get_property (asx_entry, "HREF"); } - else - xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, - "demux_asf: Unable to find VERSION tag from ASX.\n"); } else xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, -- cgit v1.2.3 From a9cbb5fe22069787eead020f15f06574a178d44f Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Tue, 13 Nov 2007 14:17:58 +0000 Subject: Improve the "no channels.conf" message; tidy up local variable initialisation. --- src/input/input_dvb.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index da3ef73eb..14d109734 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -3182,20 +3182,19 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen, dvb_input_class_t *class = (dvb_input_class_t *) this_gen; channel_t *channels=NULL; char foobuffer[BUFSIZE]; - int ch, apch, num_channels; + int ch, apch, num_channels = 0; int default_channel = -1; xine_cfg_entry_t lastchannel_enable = {0}; xine_cfg_entry_t lastchannel; - num_channels = 0; - if (!(channels = load_channels(class->xine, NULL, &num_channels, 0))) { /* channels.conf not found in .xine */ - class->mrls[0]="Sorry, No channels.conf found"; - class->mrls[1]="Please run the dvbscan utility"; - class->mrls[2]="from the dvb drivers apps package"; - class->mrls[3]="and place the file in ~/.xine/"; - *num_files=4; + class->mrls[0]="Sorry, No valid channels.conf found"; + class->mrls[1]="for the selected DVB device."; + class->mrls[2]="Please run the dvbscan utility"; + class->mrls[3]="from the dvb drivers apps package"; + class->mrls[4]="and place the file in ~/.xine/"; + *num_files=5; return class->mrls; } -- cgit v1.2.3 From 45cd8a599c5ab8f7207317e3366cb0a73e985c16 Mon Sep 17 00:00:00 2001 From: Tom Shield Date: Tue, 13 Nov 2007 14:28:16 +0000 Subject: Missing channels.conf (ATSC) load_channels was being called without checking the tuner fontend type, so channels.conf could not be decoded. Tested for ATSC only. --- src/input/input_dvb.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 14d109734..795b843c5 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -3187,7 +3187,20 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen, xine_cfg_entry_t lastchannel_enable = {0}; xine_cfg_entry_t lastchannel; - if (!(channels = load_channels(class->xine, NULL, &num_channels, 0))) { + /* need to probe card here to get fe_type to read in channels.conf */ + tuner_t *tuner; + xine_cfg_entry_t adapter; + + xine_config_lookup_entry(class->xine, "media.dvb.adapter", &adapter); + + if (!(tuner = tuner_init(class->xine,adapter.num_value))) { + xprintf(class->xine, XINE_VERBOSITY_LOG, _("input_dvb: cannot open dvb device\n")); + class->mrls[0]="Sorry, No DVB input device found."; + *num_files=1; + return class->mrls; + } + + if (!(channels = load_channels(class->xine, NULL, &num_channels, tuner->feinfo.type))) { /* channels.conf not found in .xine */ class->mrls[0]="Sorry, No valid channels.conf found"; class->mrls[1]="for the selected DVB device."; @@ -3195,9 +3208,12 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen, class->mrls[3]="from the dvb drivers apps package"; class->mrls[4]="and place the file in ~/.xine/"; *num_files=5; + tuner_dispose(tuner); return class->mrls; } + tuner_dispose(tuner); + if (xine_config_lookup_entry(class->xine, "media.dvb.remember_channel", &lastchannel_enable) && lastchannel_enable.num_value && xine_config_lookup_entry(class->xine, "media.dvb.last_channel", &lastchannel)) -- cgit v1.2.3 From eb6de332a415907a8c1a5ae5783fc5d6b13ffabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 13 Nov 2007 22:48:30 +0100 Subject: Replace xine_private_strsep() implementation with OpenBSD version. As the source file for xine_private_strsep() does not provide a licence header, replace it with a safe copy (licence wise) taken from OpenBSD CVS. The implementation is licensed under 3-clause BSD licence, that is compatible with GPL-2 or later. --- lib/strsep.c | 98 +++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 67 insertions(+), 31 deletions(-) diff --git a/lib/strsep.c b/lib/strsep.c index d63a12f56..3170e4867 100644 --- a/lib/strsep.c +++ b/lib/strsep.c @@ -1,36 +1,72 @@ -#include "config.h" -#include - -char *xine_private_strsep(char **stringp, const char *delim) { - char *begin, *end; +/* $OpenBSD: strsep.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */ - begin = *stringp; - if(begin == NULL) - return NULL; +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ - if(delim[0] == '\0' || delim[1] == '\0') { - char ch = delim[0]; - - if(ch == '\0') - end = NULL; - else { - if(*begin == ch) - end = begin; - else if(*begin == '\0') - end = NULL; - else - end = strchr(begin + 1, ch); - } - } - else - end = strpbrk(begin, delim); +#include "config.h" +#include +#include - if(end) { - *end++ = '\0'; - *stringp = end; - } - else - *stringp = NULL; +/* + * Get next token from string *stringp, where tokens are possibly-empty + * strings separated by characters from delim. + * + * Writes NULs into the string at *stringp to end tokens. + * delim need not remain constant from call to call. + * On return, *stringp points past the last NUL written (if there might + * be further tokens), or is NULL (if there are definitely no more tokens). + * + * If *stringp is NULL, strsep returns NULL. + */ +char * +xine_private_strsep(char **stringp, const char *delim) +{ + char *s; + const char *spanp; + int c, sc; + char *tok; - return begin; + if ((s = *stringp) == NULL) + return (NULL); + for (tok = s;;) { + c = *s++; + spanp = delim; + do { + if ((sc = *spanp++) == c) { + if (c == 0) + s = NULL; + else + s[-1] = 0; + *stringp = s; + return (tok); + } + } while (sc != 0); + } + /* NOTREACHED */ } -- cgit v1.2.3 From 024704b60f04c4eada240315983424969530a9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 14 Nov 2007 00:20:36 +0100 Subject: Replace xine_private_strndup() implementation with NetBSD version. As the source file for xine_private_strndup() does not provide a licence header, replace it with a safe copy (licence wise) taken from NetBSD CVS. The implementation is licensed under 3-clause BSD licence, that is compatible with GPL-2 or later. --- lib/strndup.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 10 deletions(-) diff --git a/lib/strndup.c b/lib/strndup.c index 9f347db87..1e01aa018 100644 --- a/lib/strndup.c +++ b/lib/strndup.c @@ -1,16 +1,56 @@ +/* $NetBSD: strndup.c,v 1.4 2007/07/03 12:11:09 nakayama Exp $ */ + +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * Modified for xine project. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + #include "config.h" -#ifdef HAVE_STDLIB_H +#include #include -#endif - #include -char *xine_private_strndup(const char *s, size_t n) { - char *ret; - - ret = malloc (n + 1); - strncpy(ret, s, n); - ret[n] = '\0'; - return ret; +char * +xine_private_strndup(const char *str, size_t n) +{ + size_t len; + char *copy; + + if (!str) + return (NULL); + + for (len = 0; len < n && str[len]; len++) + continue; + + if (!(copy = malloc(len + 1))) + return (NULL); + memcpy(copy, str, len); + copy[len] = '\0'; + return (copy); } -- cgit v1.2.3 From 658dd8c0474b381003f514ea6438ad70b6d22578 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Tue, 13 Nov 2007 19:08:57 +0000 Subject: Changelog entry for the ATSC fix. --HG-- extra : transplant_source : W%8EW%A2%C9%D0%06%1BU%94N%FF%98%2C%7C%08%E5G/%CD --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 1b0ea7d61..ae091a7f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ xine-lib (1.1.9) (unreleased) * Build fix for when using Linux 2.6.23 headers. [Bug 1820958] * Implemented decoding of XML character entities with codes >= 256. This requires conversion to UTF-8 of entities with codes >= 128. + * Fixed ATSC support. [Bug 1749508] xine-lib (1.1.8) * Send a channel-changed event to the frontend when receiving the SYNC -- cgit v1.2.3 From 1bdf861e88e7fa78c0f8e7789c4417321b0fb05b Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Tue, 13 Nov 2007 19:25:13 +0000 Subject: Fix a possible DVB plugin crash when switching channels. section_length is sometimes 0; this leads to the CRC32 calculation being performed with a data length of -1 bytes, a.k.a. 4294967295 bytes. (Reported by Johannes Zellner.) --HG-- extra : transplant_source : %B6m%D0%0C%84%DA%40%C3%0B%06%11%B1%11%9El%A8%1F%95%27%E5 --- ChangeLog | 1 + src/demuxers/demux_ts.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ae091a7f0..23ca358e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ xine-lib (1.1.9) (unreleased) * Implemented decoding of XML character entities with codes >= 256. This requires conversion to UTF-8 of entities with codes >= 128. * Fixed ATSC support. [Bug 1749508] + * Fixed a possible DVB plugin crash when switching channels. xine-lib (1.1.8) * Send a channel-changed event to the frontend when receiving the SYNC diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 3ed6bcecd..86a14f019 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -369,8 +369,8 @@ static void demux_ts_build_crc32_table(demux_ts_t*this) { } static uint32_t demux_ts_compute_crc32(demux_ts_t*this, uint8_t *data, - uint32_t length, uint32_t crc32) { - uint32_t i; + int32_t length, uint32_t crc32) { + int32_t i; for(i = 0; i < length; i++) { crc32 = (crc32 << 8) ^ this->crc32_table[(crc32 >> 24) ^ data[i]]; @@ -521,7 +521,7 @@ static void demux_ts_parse_pat (demux_ts_t*this, unsigned char *original_pkt, unsigned char *pkt, unsigned int pusi) { uint32_t table_id; uint32_t section_syntax_indicator; - uint32_t section_length; + int32_t section_length; uint32_t transport_stream_id; uint32_t version_number; uint32_t current_next_indicator; -- cgit v1.2.3