From subversion at mplayerhq.hu Sat Jan 2 21:40:47 2021 From: subversion at mplayerhq.hu (ib) Date: Sat, 2 Jan 2021 21:40:47 +0200 (EET) Subject: [MPlayer-cvslog] r38214 - in trunk: DOCS/man/cs/mplayer.1 DOCS/man/de/mplayer.1 DOCS/man/en/mplayer.1 DOCS/man/es/mplayer.1 DOCS/man/fr/mplayer.1 DOCS/man/hu/mplayer.1 DOCS/man/it/mplayer.1 DOCS/man/pl/mplayer.1 DO... Message-ID: <20210102194047.75C736882DB@ffbox0-bg.mplayerhq.hu> Author: ib Date: Sat Jan 2 21:40:46 2021 New Revision: 38214 Log: Update year. Modified: trunk/osdep/mplayer.rc trunk/version.sh Changes in other areas also in this revision: Modified: trunk/DOCS/man/cs/mplayer.1 trunk/DOCS/man/de/mplayer.1 trunk/DOCS/man/en/mplayer.1 trunk/DOCS/man/es/mplayer.1 trunk/DOCS/man/fr/mplayer.1 trunk/DOCS/man/hu/mplayer.1 trunk/DOCS/man/it/mplayer.1 trunk/DOCS/man/pl/mplayer.1 trunk/DOCS/man/ru/mplayer.1 trunk/DOCS/man/zh_CN/mplayer.1 trunk/DOCS/xml/cs/documentation.xml trunk/DOCS/xml/de/documentation.xml trunk/DOCS/xml/en/documentation.xml trunk/DOCS/xml/es/documentation.xml trunk/DOCS/xml/fr/documentation.xml trunk/DOCS/xml/hu/documentation.xml trunk/DOCS/xml/it/documentation.xml trunk/DOCS/xml/pl/documentation.xml trunk/DOCS/xml/ru/documentation.xml trunk/DOCS/xml/zh_CN/documentation.xml Modified: trunk/osdep/mplayer.rc ============================================================================== --- trunk/osdep/mplayer.rc Thu Dec 31 21:46:32 2020 (r38213) +++ trunk/osdep/mplayer.rc Sat Jan 2 21:40:46 2021 (r38214) @@ -36,7 +36,7 @@ FILETYPE VFT_APP VALUE "FileDescription", "MPlayer - Movie Player\000" VALUE "FileVersion",VERSION VALUE "InternalName", "Counter Counter\000" - VALUE "LegalCopyright", " (C) 2000-2020 MPlayer Team\000" + VALUE "LegalCopyright", " (C) 2000-2021 MPlayer Team\000" //VALUE "LegalTrademarks"," \000"; VALUE "OriginalFilename", "mplayer.exe\000" VALUE "ProductName", "MPlayer - The Movie Player\000" Modified: trunk/version.sh ============================================================================== --- trunk/version.sh Thu Dec 31 21:46:32 2020 (r38213) +++ trunk/version.sh Sat Jan 2 21:40:46 2021 (r38214) @@ -19,7 +19,7 @@ fi NEW_REVISION="#define VERSION \"${version}${extra}\"" OLD_REVISION=$(head -n 1 version.h 2> /dev/null) -TITLE='#define MP_TITLE "%s "VERSION" (C) 2000-2020 MPlayer Team\n"' +TITLE='#define MP_TITLE "%s "VERSION" (C) 2000-2021 MPlayer Team\n"' # Update version.h only on revision changes to avoid spurious rebuilds if test "$NEW_REVISION" != "$OLD_REVISION"; then From subversion at mplayerhq.hu Wed Jan 20 20:03:24 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:24 +0200 (EET) Subject: [MPlayer-cvslog] r38215 - trunk/av_helpers.c Message-ID: <20210120180324.6F5D26882F5@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:23 2021 New Revision: 38215 Log: av_helpers: switch to new lavc audio encode API. Modified: trunk/av_helpers.c Modified: trunk/av_helpers.c ============================================================================== --- trunk/av_helpers.c Sat Jan 2 21:40:46 2021 (r38214) +++ trunk/av_helpers.c Wed Jan 20 20:03:23 2021 (r38215) @@ -98,7 +98,6 @@ void init_avcodec(void) if (!avcodec_initialized) { show_av_version(MSGT_DECVIDEO, "libavcodec", LIBAVCODEC_VERSION_INT, avcodec_version(), avcodec_configuration()); - avcodec_register_all(); avcodec_initialized = 1; av_log_set_callback(mp_msp_av_log_callback); } @@ -109,7 +108,6 @@ void init_avformat(void) if (!avformat_initialized) { show_av_version(MSGT_DEMUX, "libavformat", LIBAVFORMAT_VERSION_INT, avformat_version(), avformat_configuration()); - av_register_all(); avformat_initialized = 1; av_log_set_callback(mp_msp_av_log_callback); } @@ -132,8 +130,6 @@ int lavc_encode_audio(AVCodecContext *ct ctx->channels, src_len / bps, bps); } - pkt.data = dst; - pkt.size = dst_len; frame->nb_samples = src_len / ctx->channels / bps; if (planar) { // TODO: this is horribly inefficient. @@ -150,11 +146,22 @@ int lavc_encode_audio(AVCodecContext *ct } } } + frame->format = ctx->sample_fmt; + frame->channels = ctx->channels; n = avcodec_fill_audio_frame(frame, ctx->channels, ctx->sample_fmt, src, src_len, 1); if (n < 0) return 0; - n = avcodec_encode_audio2(ctx, &pkt, frame, &got); + n = avcodec_send_frame(ctx, frame); + av_init_packet(&pkt); + got = avcodec_receive_packet(ctx, &pkt); av_frame_free(&frame); if (planar) av_free(src); if (n < 0) return n; - return got ? pkt.size : 0; + if (got >= 0) { + int size = pkt.size; + if (size > dst_len) return -1; + memcpy(dst, pkt.data, size); + av_packet_unref(&pkt); + return size; + } + return 0; } From subversion at mplayerhq.hu Wed Jan 20 20:03:25 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:25 +0200 (EET) Subject: [MPlayer-cvslog] r38216 - trunk/libmpcodecs/ad_ffmpeg.c Message-ID: <20210120180325.70A69688288@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:25 2021 New Revision: 38216 Log: ad_ffmpeg: switch to new lavc API. Modified: trunk/libmpcodecs/ad_ffmpeg.c Modified: trunk/libmpcodecs/ad_ffmpeg.c ============================================================================== --- trunk/libmpcodecs/ad_ffmpeg.c Wed Jan 20 20:03:23 2021 (r38215) +++ trunk/libmpcodecs/ad_ffmpeg.c Wed Jan 20 20:03:25 2021 (r38216) @@ -310,34 +310,41 @@ static int copy_samples(AVCodecContext * static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen) { + int draining_started = 0; unsigned char *start=NULL; - int y,len=-1, got_frame; + int y,len=-1; AVFrame *frame = av_frame_alloc(); if (!frame) return AVERROR(ENOMEM); while(lencontext, frame); + if (y == AVERROR(EAGAIN) || y == AVERROR_EOF) { + AVPacket pkt; double pts; int x=ds_get_packet_pts(sh_audio->ds,&start, &pts); if(x<=0) { start = NULL; x = 0; ds_parse(sh_audio->ds, &start, &x, MP_NOPTS_VALUE, 0); - if (x <= 0) - break; // error } else { int in_size = x; int consumed = ds_parse(sh_audio->ds, &start, &x, pts, 0); sh_audio->ds->buffer_pos -= in_size - consumed; - // Note: hopefully below is correct, it was only + // Note: hopefully the following x <= 0 handling is correct, it was only // added because FFmpeg broke the API and 0-sized // packets started to break e.g. AC3 decode. - if (x <= 0) - break; // error or not enough data } + if (x <= 0) { + if (sh_audio->ds->eof && !draining_started) { + avcodec_send_packet(sh_audio->context, NULL); + draining_started = 1; + continue; + } + break; // error or not enough data + } av_init_packet(&pkt); pkt.data = start; @@ -346,16 +353,18 @@ static int decode_audio(sh_audio_t *sh_a sh_audio->pts = pts; sh_audio->pts_bytes = 0; } - y=avcodec_decode_audio4(sh_audio->context, frame, &got_frame, &pkt); -//printf("return:%d samples_out:%d bitstream_in:%d sample_sum:%d\n", y, len2, x, len); fflush(stdout); - // LATM may need many packets to find mux info - if (y == AVERROR(EAGAIN)) - continue; + y=avcodec_send_packet(sh_audio->context, &pkt); + if(y<0){ mp_msg(MSGT_DECAUDIO,MSGL_V,"lavc_audio: error\n");break; } + continue; + } if(y<0){ mp_msg(MSGT_DECAUDIO,MSGL_V,"lavc_audio: error\n");break; } +//printf("return:%d samples_out:%d bitstream_in:%d sample_sum:%d\n", y, len2, x, len); fflush(stdout); +#if 0 + // this should be obsolete since the new API does no support it + // and we support inserting parsers as necessary instead. if(!sh_audio->parser && yds->buffer_pos+=y-x; // put back data (HACK!) - if (!got_frame) - continue; +#endif len2 = copy_samples(sh_audio->context, frame, buf, maxlen); if (len2 < 0) return len2; From subversion at mplayerhq.hu Wed Jan 20 20:03:26 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:26 +0200 (EET) Subject: [MPlayer-cvslog] r38217 - trunk/libmpcodecs/vd_ffmpeg.c Message-ID: <20210120180326.66EFD68838E@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:26 2021 New Revision: 38217 Log: vd_ffmpeg: Switch to newer lavc decode API. Modified: trunk/libmpcodecs/vd_ffmpeg.c Modified: trunk/libmpcodecs/vd_ffmpeg.c ============================================================================== --- trunk/libmpcodecs/vd_ffmpeg.c Wed Jan 20 20:03:25 2021 (r38216) +++ trunk/libmpcodecs/vd_ffmpeg.c Wed Jan 20 20:03:26 2021 (r38217) @@ -484,7 +484,7 @@ static int init(sh_video_t *sh){ set_dr_slice_settings(avctx, lavc_codec); avctx->thread_count = lavc_param_threads; avctx->thread_type = FF_THREAD_FRAME | FF_THREAD_SLICE; - avctx->refcounted_frames = 1; + av_dict_set(&opts, "refcounted_frames", "1", 0); /* open it */ if (avcodec_open2(avctx, lavc_codec, &opts) < 0) { @@ -925,7 +925,16 @@ static mp_image_t *decode(sh_video_t *sh } ctx->palette_sent = 1; } - ret = avcodec_decode_video2(avctx, pic, &got_picture, &pkt); + ret = avcodec_send_packet(avctx, !pkt.data && !pkt.size ? NULL : &pkt); + if (ret == AVERROR(EAGAIN)) { + mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Too many frames buffered in decode, MPlayer cannot handle that yet!\n"); + ret = 0; + } + if (ret >= 0 || ret == AVERROR_EOF) { + ret = avcodec_receive_frame(avctx, pic); + got_picture = ret >= 0; + if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) ret = 0; + } ctx->refcount_frame = pic; pkt.data = NULL; pkt.size = 0; @@ -935,7 +944,7 @@ static mp_image_t *decode(sh_video_t *sh // FFmpeg allocate - this mostly happens with nonref_dr. // Ensure we treat it correctly. dr1= ctx->do_dr1 && pic->opaque != NULL; - if(ret<0) mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Error while decoding frame!\n"); + if(ret<0) mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Error while decoding frame! (%i)\n", ret); //printf("repeat: %d\n", pic->repeat_pict); //-- vstats generation while(lavc_param_vstats){ // always one time loop From subversion at mplayerhq.hu Wed Jan 20 20:03:27 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:27 +0200 (EET) Subject: [MPlayer-cvslog] r38218 - trunk/libmpcodecs/vd_ffmpeg.c Message-ID: <20210120180327.6E05168836F@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:27 2021 New Revision: 38218 Log: vd_ffmpeg: support receiving multiple frames in a row. Modified: trunk/libmpcodecs/vd_ffmpeg.c Modified: trunk/libmpcodecs/vd_ffmpeg.c ============================================================================== --- trunk/libmpcodecs/vd_ffmpeg.c Wed Jan 20 20:03:26 2021 (r38217) +++ trunk/libmpcodecs/vd_ffmpeg.c Wed Jan 20 20:03:27 2021 (r38218) @@ -925,9 +925,11 @@ static mp_image_t *decode(sh_video_t *sh } ctx->palette_sent = 1; } + if (sh->ds->buffer_pos < len) + mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Bad stream state, please report as bug!\n"); ret = avcodec_send_packet(avctx, !pkt.data && !pkt.size ? NULL : &pkt); if (ret == AVERROR(EAGAIN)) { - mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Too many frames buffered in decode, MPlayer cannot handle that yet!\n"); + if (sh->ds->buffer_pos >= len) sh->ds->buffer_pos -= len; ret = 0; } if (ret >= 0 || ret == AVERROR_EOF) { From subversion at mplayerhq.hu Wed Jan 20 20:03:28 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:28 +0200 (EET) Subject: [MPlayer-cvslog] r38219 - trunk/libmpdemux/demux_lavf.c Message-ID: <20210120180328.722B668836F@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:28 2021 New Revision: 38219 Log: demux_lavf: avoid several deprecated lavf features. Modified: trunk/libmpdemux/demux_lavf.c Modified: trunk/libmpdemux/demux_lavf.c ============================================================================== --- trunk/libmpdemux/demux_lavf.c Wed Jan 20 20:03:27 2021 (r38218) +++ trunk/libmpdemux/demux_lavf.c Wed Jan 20 20:03:28 2021 (r38219) @@ -146,9 +146,10 @@ static int64_t mp_read_seek(void *opaque } static void list_formats(void) { - AVInputFormat *fmt; + void *i = 0; + const AVInputFormat *fmt; mp_msg(MSGT_DEMUX, MSGL_INFO, "Available lavf input formats:\n"); - for (fmt = av_iformat_next(NULL); fmt; fmt = av_iformat_next(fmt)) + while ((fmt = av_demuxer_iterate(&i))) mp_msg(MSGT_DEMUX, MSGL_INFO, "%15s : %s\n", fmt->name, fmt->long_name); } @@ -288,7 +289,7 @@ static void parse_cryptokey(AVFormatCont static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) { lavf_priv_t *priv= demuxer->priv; AVStream *st= avfc->streams[i]; - AVCodecContext *codec= st->codec; + AVCodecParameters *codec= st->codecpar; char *stream_type = NULL; int stream_id; AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); @@ -396,7 +397,7 @@ static void handle_stream(demuxer_t *dem if (codec->bits_per_coded_sample && codec->bits_per_coded_sample > 0 && codec->codec_tag == MKTAG('r', 'a', 'w', 32)) codec->codec_tag = 0; - switch (codec->pix_fmt) { + switch (codec->format) { case AV_PIX_FMT_RGB24: codec->codec_tag= MKTAG(24, 'B', 'G', 'R'); break; @@ -420,8 +421,8 @@ static void handle_stream(demuxer_t *dem sh_video->video.dwRate= st->time_base.den; sh_video->video.dwScale= st->time_base.num; } else { - sh_video->video.dwRate= codec->time_base.den; - sh_video->video.dwScale= codec->time_base.num; + sh_video->video.dwRate= st->codec->time_base.den; + sh_video->video.dwScale= st->codec->time_base.num; } sh_video->fps=av_q2d(st->r_frame_rate); sh_video->frametime=1/av_q2d(st->r_frame_rate); @@ -513,7 +514,7 @@ static void handle_stream(demuxer_t *dem break; } case AVMEDIA_TYPE_ATTACHMENT:{ - if (st->codec->codec_id == AV_CODEC_ID_TTF || st->codec->codec_id == AV_CODEC_ID_OTF) { + if (st->codecpar->codec_id == AV_CODEC_ID_TTF || st->codecpar->codec_id == AV_CODEC_ID_OTF) { AVDictionaryEntry *fnametag = av_dict_get(st->metadata, "filename", NULL, 0); AVDictionaryEntry *mimetype = av_dict_get(st->metadata, "mimetype", NULL, 0); demuxer_add_attachment(demuxer, fnametag ? fnametag->value : NULL, @@ -716,23 +717,19 @@ static int demux_lavf_fill_buffer(demuxe ds=demux->sub; sub_utf8=1; } else { - av_free_packet(&pkt); + av_packet_unref(&pkt); return 1; } av_packet_merge_side_data(&pkt); dp=new_demux_packet(pkt.size); memcpy(dp->buffer, pkt.data, pkt.size); - av_free_packet(&pkt); if(pkt.pts != AV_NOPTS_VALUE){ dp->pts=pkt.pts * av_q2d(priv->avfc->streams[id]->time_base); priv->last_pts= dp->pts * AV_TIME_BASE; if(pkt.duration > 0) dp->endpts = dp->pts + pkt.duration * av_q2d(priv->avfc->streams[id]->time_base); - /* subtitle durations are sometimes stored in convergence_duration */ - if(ds == demux->sub && pkt.convergence_duration > 0) - dp->endpts = dp->pts + pkt.convergence_duration * av_q2d(priv->avfc->streams[id]->time_base); } dp->pos=demux->filepos; dp->flags= !!(pkt.flags&AV_PKT_FLAG_KEY); @@ -741,6 +738,7 @@ static int demux_lavf_fill_buffer(demuxe dp->stream_pts = stream_pts; // append packet to DS stream: ds_add_packet(ds,dp); + av_packet_unref(&pkt); return 1; } @@ -879,7 +877,7 @@ redo: program = priv->avfc->programs[p]; for(i=0; inb_stream_indexes; i++) { - switch(priv->avfc->streams[program->stream_index[i]]->codec->codec_type) + switch(priv->avfc->streams[program->stream_index[i]]->codecpar->codec_type) { case AVMEDIA_TYPE_VIDEO: if(prog->vid == -2) From subversion at mplayerhq.hu Wed Jan 20 20:03:29 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:29 +0200 (EET) Subject: [MPlayer-cvslog] r38220 - trunk/libmpdemux/ebml.c Message-ID: <20210120180329.6BBFF68838E@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:29 2021 New Revision: 38220 Log: ebml.c: fix bad length check. Fixes trac issue #2361. Modified: trunk/libmpdemux/ebml.c Modified: trunk/libmpdemux/ebml.c ============================================================================== --- trunk/libmpdemux/ebml.c Wed Jan 20 20:03:28 2021 (r38219) +++ trunk/libmpdemux/ebml.c Wed Jan 20 20:03:29 2021 (r38220) @@ -31,10 +31,6 @@ #include "libavutil/intfloat.h" -#ifndef SIZE_MAX -#define SIZE_MAX ((size_t)-1) -#endif - /* * Read: the element content data ID. * Return: the ID. @@ -214,7 +210,7 @@ char *ebml_read_ascii(stream_t *s, uint6 len = ebml_read_length(s, &l); if (len == EBML_UINT_INVALID) return NULL; - if (len > SIZE_MAX - 1) + if (len >= INT_MAX) return NULL; if (length) *length = len + l; From subversion at mplayerhq.hu Wed Jan 20 20:03:31 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:31 +0200 (EET) Subject: [MPlayer-cvslog] r38221 - trunk/libmpdemux/demux_realaud.c Message-ID: <20210120180331.44A5068980E@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:31 2021 New Revision: 38221 Log: demux_realaud.c: check stream_read_char for EOF. Also remove some code duplication while at it. Fixes trac #2360. Modified: trunk/libmpdemux/demux_realaud.c Modified: trunk/libmpdemux/demux_realaud.c ============================================================================== --- trunk/libmpdemux/demux_realaud.c Wed Jan 20 20:03:29 2021 (r38220) +++ trunk/libmpdemux/demux_realaud.c Wed Jan 20 20:03:31 2021 (r38221) @@ -157,13 +157,25 @@ static int demux_ra_fill_buffer(demuxer_ } +static void read_demux_info(demuxer_t *demuxer, const char *name) +{ + char *buf = NULL; + int len = stream_read_char(demuxer->stream); + if (len <= 0) return; + buf = malloc(len+1); + if (!buf) return; + if (stream_read(demuxer->stream, buf, len) != len) goto out; + buf[len] = 0; + demux_info_add(demuxer, name, buf); +out: + free(buf); +} static demuxer_t* demux_open_ra(demuxer_t* demuxer) { ra_priv_t* ra_priv = demuxer->priv; sh_audio_t *sh; int i; - char *buf; if ((ra_priv = malloc(sizeof(ra_priv_t))) == NULL) { mp_msg(MSGT_DEMUX, MSGL_ERR, "[RealAudio] Can't allocate memory for private data.\n"); @@ -229,35 +241,10 @@ static demuxer_t* demux_open_ra(demuxer_ stream_skip(demuxer->stream, 3); } - if ((i = stream_read_char(demuxer->stream)) != 0) { - buf = malloc(i+1); - stream_read(demuxer->stream, buf, i); - buf[i] = 0; - demux_info_add(demuxer, "Title", buf); - free(buf); - } - if ((i = stream_read_char(demuxer->stream)) != 0) { - buf = malloc(i+1); - stream_read(demuxer->stream, buf, i); - buf[i] = 0; - demux_info_add(demuxer, "Author", buf); - free(buf); - } - if ((i = stream_read_char(demuxer->stream)) != 0) { - buf = malloc(i+1); - stream_read(demuxer->stream, buf, i); - buf[i] = 0; - demux_info_add(demuxer, "Copyright", buf); - free(buf); - } - - if ((i = stream_read_char(demuxer->stream)) != 0) { - buf = malloc(i+1); - stream_read(demuxer->stream, buf, i); - buf[i] = 0; - demux_info_add(demuxer, "Comment", buf); - free(buf); - } + read_demux_info(demuxer, "Title"); + read_demux_info(demuxer, "Author"); + read_demux_info(demuxer, "Copyright"); + read_demux_info(demuxer, "Comment"); if (ra_priv->version == 3) { if(ra_priv->hdr_size + 8 > stream_tell(demuxer->stream)) { From subversion at mplayerhq.hu Wed Jan 20 20:03:32 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:32 +0200 (EET) Subject: [MPlayer-cvslog] r38222 - trunk/libmpdemux/demux_pva.c Message-ID: <20210120180332.B79EB68921B@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:32 2021 New Revision: 38222 Log: demux_pva.c: fix data types and use calloc. Improves behaviour for trac issue #2359. Modified: trunk/libmpdemux/demux_pva.c Modified: trunk/libmpdemux/demux_pva.c ============================================================================== --- trunk/libmpdemux/demux_pva.c Wed Jan 20 20:03:31 2021 (r38221) +++ trunk/libmpdemux/demux_pva.c Wed Jan 20 20:03:32 2021 (r38222) @@ -51,7 +51,7 @@ typedef struct { off_t offset; - int size; + uint16_t size; uint8_t type; uint8_t is_packet_start; float pts; @@ -62,7 +62,7 @@ typedef struct { float last_audio_pts; float last_video_pts; float video_pts_after_prebytes; - int video_size_after_prebytes; + uint16_t video_size_after_prebytes; uint8_t prebytes_delivered; uint8_t just_synced; uint8_t synced_stream_id; @@ -140,13 +140,12 @@ static demuxer_t * demux_open_pva (demux - priv=malloc(sizeof(pva_priv_t)); + priv=calloc(1, sizeof(pva_priv_t)); if(demuxer->stream->type!=STREAMTYPE_FILE) demuxer->seekable=0; else demuxer->seekable=1; demuxer->priv=priv; - memset(demuxer->priv,0,sizeof(pva_priv_t)); if(!pva_sync(demuxer)) { From subversion at mplayerhq.hu Wed Jan 20 20:03:33 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:33 +0200 (EET) Subject: [MPlayer-cvslog] r38223 - trunk/libmpdemux/asfheader.c Message-ID: <20210120180333.E1F70689AA2@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:33 2021 New Revision: 38223 Log: asfheader.c: add sanity check of type_size. Fixes trac issue #2358. Modified: trunk/libmpdemux/asfheader.c Modified: trunk/libmpdemux/asfheader.c ============================================================================== --- trunk/libmpdemux/asfheader.c Wed Jan 20 20:03:32 2021 (r38222) +++ trunk/libmpdemux/asfheader.c Wed Jan 20 20:03:33 2021 (r38223) @@ -437,7 +437,9 @@ int read_asf_header(demuxer_t *demuxer,s audio_pos = pos - 16 - 8; streamh = (ASF_stream_header_t *)&hdr[sh_pos]; le2me_ASF_stream_header_t(streamh); + if (streamh->type_size > hdr_len) goto len_err_out; audio_pos += 64; //16+16+4+4+4+16+4; + if (audio_pos + streamh->type_size > hdr_len) goto len_err_out; buffer = &hdr[audio_pos]; sh_audio=new_sh_audio(demuxer,streamh->stream_no & 0x7F, NULL); sh_audio->needs_parsing = 1; @@ -461,6 +463,7 @@ int read_asf_header(demuxer_t *demuxer,s pos += sizeof(ASF_stream_header_t); if (pos > hdr_len) goto len_err_out; le2me_ASF_stream_header_t(streamh); + if (streamh->type_size > hdr_len) goto len_err_out; mp_msg(MSGT_HEADER, MSGL_V, "stream type: %s\n", asf_chunk_type(streamh->type)); mp_msg(MSGT_HEADER, MSGL_V, "stream concealment: %s\n", @@ -491,6 +494,7 @@ int read_asf_header(demuxer_t *demuxer,s sh_video_t* sh_video=new_sh_video(demuxer,streamh->stream_no & 0x7F); mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_VideoID, "asfheader", streamh->stream_no & 0x7F); len=streamh->type_size-(4+4+1+2); + if (len > streamh->type_size) goto len_err_out; ++video_streams; // sh_video->bih=malloc(chunksize); memset(sh_video->bih,0,chunksize); sh_video->bih=calloc((lenbih))?sizeof(*sh_video->bih):len,1); From subversion at mplayerhq.hu Wed Jan 20 20:03:34 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:34 +0200 (EET) Subject: [MPlayer-cvslog] r38224 - trunk/libmpcodecs/ad_hwmpa.c Message-ID: <20210120180334.DFF63689AA2@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:34 2021 New Revision: 38224 Log: ad_hwmpa.c: avoid potential out of bounds. This happens when the frame size is larger than the size of the decoded audio - obviously this should not happen in real audio files as it doesn't make sense to select a compression mode that increases size. Note that unless all other MPEG audio codecs are disabled this codec will never be auto-selected. Fixes trac issue #2357. Modified: trunk/libmpcodecs/ad_hwmpa.c Modified: trunk/libmpcodecs/ad_hwmpa.c ============================================================================== --- trunk/libmpcodecs/ad_hwmpa.c Wed Jan 20 20:03:33 2021 (r38223) +++ trunk/libmpcodecs/ad_hwmpa.c Wed Jan 20 20:03:34 2021 (r38224) @@ -133,7 +133,8 @@ static int decode_audio(sh_audio_t *sh,u break; } - memset(&buf[tot], 0, tot2-tot); + if (tot > tot2) mp_msg(MSGT_DECAUDIO,MSGL_ERR,"MPEG audio frame is larger than decoded data (%i > %i)!\n", tot, tot2); + else memset(&buf[tot], 0, tot2-tot); return tot2; } From subversion at mplayerhq.hu Wed Jan 20 20:03:35 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:03:35 +0200 (EET) Subject: [MPlayer-cvslog] r38225 - trunk/mplayer.c Message-ID: <20210120180335.D654F68980E@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:03:35 2021 New Revision: 38225 Log: mplayer.c: fix crashes for reinit_video_chain failures. The error path should undo the reset, it should not set things that the demuxer owns to NULL. In particular, the rawdv demuxer would crash if opening the vo failed. Fixes trac issue #2326. Modified: trunk/mplayer.c Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Wed Jan 20 20:03:34 2021 (r38224) +++ trunk/mplayer.c Wed Jan 20 20:03:35 2021 (r38225) @@ -2434,7 +2434,7 @@ int reinit_video_chain(void) return 1; err_out: - mpctx->sh_video = mpctx->d_video->sh = NULL; + mpctx->sh_video = mpctx->sh_video->ds = NULL; return 0; } From subversion at mplayerhq.hu Wed Jan 20 20:35:02 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 20:35:02 +0200 (EET) Subject: [MPlayer-cvslog] r38226 - trunk/configure Message-ID: <20210120183502.541A8680053@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 20:35:02 2021 New Revision: 38226 Log: configure: properly enable FFmpeg CodedBitstream parsers. Fixes the warning described in trac #2370 though it did not seem to affect playback for me. Modified: trunk/configure Modified: trunk/configure ============================================================================== --- trunk/configure Wed Jan 20 20:03:35 2021 (r38225) +++ trunk/configure Wed Jan 20 20:35:02 2021 (r38226) @@ -1561,6 +1561,13 @@ list_subparts_extern() { return 0 } +list_cbs_extern() { + test ! -e ffmpeg/libav${3} && return 1 + pattern="s/^[^#]*extern.*${1} *ff_cbs_type_\([^ ]*\);/${2}_\1/p" + sed -n "$pattern" ffmpeg/libav${3} | toupper + return 0 +} + list_subparts_filters() { test ! -e ffmpeg/libav${1} && return 1 pattern="s/^extern AVFilter ff_([avfsinkrc]{2,5})_([a-zA-Z0-9_]+);/\1_\2_filter/p" @@ -1592,6 +1599,11 @@ libavbsfs_all=$(list_subparts_extern AVB test $? -eq 0 && _list_subparts_extern=found || _list_subparts_extern="not found" echores "$_list_subparts_extern" +echocheck "ffmpeg/libavcodec/cbs_internal.h" +libavcbs_all=$(list_cbs_extern CodedBitstreamType cbs codec/cbs_internal.h) +test $? -eq 0 && _list_subparts_extern=found || _list_subparts_extern="not found" +echores "$_list_subparts_extern" + echocheck "ffmpeg/libavformat/protocols.c" libavprotocols_all=$(list_subparts_extern URLProtocol protocol format/protocols.c) test $? -eq 0 && _list_subparts_extern=found || _list_subparts_extern="not found" @@ -1624,6 +1636,7 @@ libavdecoders=$(echo $libavdecoders_all) libavencoders=$(echo $libavencoders_all) libavparsers=$(echo $libavparsers_all) libavbsfs=$(echo $libavbsfs_all) +libavcbs=$(echo $libavcbs_all) # Disable all hardware accelerators for now. libavhwaccels= libavdemuxers=$(echo $libavdemuxers_all) @@ -8782,12 +8795,6 @@ CONFIG_BLOCKDSP= yes CONFIG_BSWAPDSP= yes CONFIG_CABAC = yes CONFIG_CBS = yes -CONFIG_CBS_AV1 = yes -CONFIG_CBS_H264 = yes -CONFIG_CBS_H265 = yes -CONFIG_CBS_JPEG = yes -CONFIG_CBS_MPEG2 = yes -CONFIG_CBS_VP9 = yes CONFIG_CHROMAPRINT = no CONFIG_DCT = yes CONFIG_DWT = yes @@ -8898,6 +8905,7 @@ $(mak_enable "$libavdemuxers_all" "$lib $(mak_enable "$libavmuxers_all" "$libavmuxers" CONFIG) $(mak_enable "$libavprotocols_all" "$libavprotocols" CONFIG) $(mak_enable "$libavbsfs_all" "$libavbsfs" CONFIG) +$(mak_enable "$libavcbs_all" "$libavcbs" CONFIG) $(mak_enable "$libavhwaccels_all" "$libavhwaccels" CONFIG) $(mak_enable "$libavfilters_all" "$libavfilters" CONFIG) EOF @@ -9545,6 +9553,7 @@ $(ff_config_enable "$libavdemuxers_all" $(ff_config_enable "$libavmuxers_all" "$libavmuxers" "#") $(ff_config_enable "$libavprotocols_all" "$libavprotocols" "#") $(ff_config_enable "$libavbsfs_all" "$libavbsfs" "#") +$(ff_config_enable "$libavcbs_all" "$libavcbs" "#") $(ff_config_enable "$libavhwaccels_all" "$libavhwaccels" "#") $(ff_config_enable "$libavfilters_all" "$libavfilters" "#") From subversion at mplayerhq.hu Wed Jan 20 21:45:32 2021 From: subversion at mplayerhq.hu (reimar) Date: Wed, 20 Jan 2021 21:45:32 +0200 (EET) Subject: [MPlayer-cvslog] r38227 - trunk/sub/spudec.c Message-ID: <20210120194532.D4B1B680B67@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Wed Jan 20 21:45:32 2021 New Revision: 38227 Log: sub/spudec.c: support swapped interlacing. The code assumed that the data for the top field would be first, however it is also possible that the data for the bottom field is encoded first. Fixes trac issue #2365. Modified: trunk/sub/spudec.c Modified: trunk/sub/spudec.c ============================================================================== --- trunk/sub/spudec.c Wed Jan 20 20:35:02 2021 (r38226) +++ trunk/sub/spudec.c Wed Jan 20 21:45:32 2021 (r38227) @@ -354,7 +354,7 @@ int spudec_apply_palette_crop(void *this static void spudec_process_data(spudec_handle_t *this, packet_t *packet) { - unsigned int i, x, y; + unsigned int limit0, limit1, x, y; uint8_t *dst; if (!spudec_alloc_image(this, packet->stride, packet->height)) @@ -368,12 +368,17 @@ static void spudec_process_data(spudec_h memcpy(this->palette, packet->palette, sizeof(this->palette)); memcpy(this->alpha, packet->alpha, sizeof(this->alpha)); - i = packet->current_nibble[1]; + limit0 = packet->current_nibble[1]; + limit1 = 2*packet->control_start; + if (packet->current_nibble[0] > packet->current_nibble[1]) { + limit0 = limit1; + limit1 = packet->current_nibble[0]; + } x = 0; y = 0; dst = this->pal_image; - while (packet->current_nibble[0] < i - && packet->current_nibble[1] / 2 < packet->control_start + while (packet->current_nibble[0] < limit0 + && packet->current_nibble[1] < limit1 && y < this->pal_height) { unsigned int len, color; unsigned int rle = 0; From subversion at mplayerhq.hu Fri Jan 22 00:41:44 2021 From: subversion at mplayerhq.hu (reimar) Date: Fri, 22 Jan 2021 00:41:44 +0200 (EET) Subject: [MPlayer-cvslog] r38228 - trunk/Makefile Message-ID: <20210121224144.8F6CB689E01@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Fri Jan 22 00:41:44 2021 New Revision: 38228 Log: Makefile: Make use of the CC_C CC_O etc variables. We defined them already for FFmpeg anyway, so might as well make use of it. Modified: trunk/Makefile Modified: trunk/Makefile ============================================================================== --- trunk/Makefile Wed Jan 20 21:45:32 2021 (r38227) +++ trunk/Makefile Fri Jan 22 00:41:44 2021 (r38228) @@ -719,16 +719,16 @@ GUI_ICONSIZES = 16x16 22x22 24x24 32x32 all: $(ALL_PRG-yes) %.o: %.S - $(CC) $(CC_DEPFLAGS) $(CFLAGS) -c -o $@ $< + $(CC) $(CC_DEPFLAGS) $(CFLAGS) $(AS_C) $(AS_O) $< %.o: %.c - $(CC) $(CC_DEPFLAGS) $(CFLAGS) -c -o $@ $< + $(CC) $(CC_DEPFLAGS) $(CFLAGS) $(CC_C) $(CC_O) $< %.o: %.cpp - $(CC) $(CC_DEPFLAGS) $(CXXFLAGS) -c -o $@ $< + $(CC) $(CC_DEPFLAGS) $(CXXFLAGS) $(CXX_C) $(CXX_O) $< %.o: %.m - $(CC) $(CC_DEPFLAGS) $(CFLAGS) -c -o $@ $< + $(CC) $(CC_DEPFLAGS) $(CFLAGS) $(CC_C) $(CC_O) $< %-rc.o: %.rc $(WINDRES) -I. $< -o $@ From subversion at mplayerhq.hu Fri Jan 22 00:48:36 2021 From: subversion at mplayerhq.hu (reimar) Date: Fri, 22 Jan 2021 00:48:36 +0200 (EET) Subject: [MPlayer-cvslog] r38229 - trunk/libao2/ao_null.c Message-ID: <20210121224836.54FEF689E50@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Fri Jan 22 00:48:36 2021 New Revision: 38229 Log: ao_null.c: simplify by using GetTimerMS(). It is also slightly more portable than using gettimeofday directly. Modified: trunk/libao2/ao_null.c Modified: trunk/libao2/ao_null.c ============================================================================== --- trunk/libao2/ao_null.c Fri Jan 22 00:41:44 2021 (r38228) +++ trunk/libao2/ao_null.c Fri Jan 22 00:48:36 2021 (r38229) @@ -20,7 +20,6 @@ #include #include -#include #include "config.h" #include "libaf/af_format.h" @@ -37,28 +36,19 @@ static const ao_info_t info = LIBAO_EXTERN(null) -static struct timeval last_tv; +static unsigned last; static int buffer; static void drain(void){ - - struct timeval now_tv; - int temp, temp2; - - gettimeofday(&now_tv, 0); - temp = now_tv.tv_sec - last_tv.tv_sec; + unsigned now = GetTimerMS(); + unsigned long long temp = now - last; temp *= ao_data.bps; + temp /= 1000; - temp2 = now_tv.tv_usec - last_tv.tv_usec; - temp2 /= 1000; - temp2 *= ao_data.bps; - temp2 /= 1000; - temp += temp2; - - buffer-=temp; - if (buffer<0) buffer=0; + if (temp > buffer) buffer=0; + else buffer-=temp; - if(temp>0) last_tv = now_tv;//mplayer is fast + last = now; } // to set/get/query special features/parameters @@ -79,7 +69,7 @@ static int init(int rate,int channels,in ao_data.format=format; ao_data.bps=channels*rate*samplesize; buffer=0; - gettimeofday(&last_tv, 0); + last = GetTimerMS(); return 1; } From subversion at mplayerhq.hu Fri Jan 22 00:54:42 2021 From: subversion at mplayerhq.hu (reimar) Date: Fri, 22 Jan 2021 00:54:42 +0200 (EET) Subject: [MPlayer-cvslog] r38230 - trunk/libao2/ao_dsound.c Message-ID: <20210121225442.127CD689CFF@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Fri Jan 22 00:54:41 2021 New Revision: 38230 Log: ao_dsound.c: Avoid pointer arithmetic on void * type. Modified: trunk/libao2/ao_dsound.c Modified: trunk/libao2/ao_dsound.c ============================================================================== --- trunk/libao2/ao_dsound.c Fri Jan 22 00:48:36 2021 (r38229) +++ trunk/libao2/ao_dsound.c Fri Jan 22 00:54:41 2021 (r38230) @@ -330,14 +330,14 @@ static int write_buffer(unsigned char *d numsamp = dwBytes1 / (ao_data.channels * sampsize); // number of samples for each channel in this buffer for( i = 0; i < numsamp; i++ ) for( j = 0; j < ao_data.channels; j++ ) { - memcpy(lpvPtr1+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize); + memcpy((char *)lpvPtr1+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize); } if (NULL != lpvPtr2 ) { numsamp = dwBytes2 / (ao_data.channels * sampsize); for( i = 0; i < numsamp; i++ ) for( j = 0; j < ao_data.channels; j++ ) { - memcpy(lpvPtr2+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+dwBytes1+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize); + memcpy((char *)lpvPtr2+(i*ao_data.channels*sampsize)+(chantable[j]*sampsize),data+dwBytes1+(i*ao_data.channels*sampsize)+(j*sampsize),sampsize); } } From subversion at mplayerhq.hu Fri Jan 22 12:59:03 2021 From: subversion at mplayerhq.hu (reimar) Date: Fri, 22 Jan 2021 12:59:03 +0200 (EET) Subject: [MPlayer-cvslog] r38231 - trunk/libao2/ao_null.c Message-ID: <20210122105903.EAE9368A27E@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Fri Jan 22 12:59:03 2021 New Revision: 38231 Log: ao_null.c: Fix compile issue by adding missing include. Modified: trunk/libao2/ao_null.c Modified: trunk/libao2/ao_null.c ============================================================================== --- trunk/libao2/ao_null.c Fri Jan 22 00:54:41 2021 (r38230) +++ trunk/libao2/ao_null.c Fri Jan 22 12:59:03 2021 (r38231) @@ -22,6 +22,7 @@ #include #include "config.h" +#include "osdep/timer.h" #include "libaf/af_format.h" #include "audio_out.h" #include "audio_out_internal.h" From subversion at mplayerhq.hu Fri Jan 22 14:08:21 2021 From: subversion at mplayerhq.hu (ib) Date: Fri, 22 Jan 2021 14:08:21 +0200 (EET) Subject: [MPlayer-cvslog] r38232 - trunk/gui/dialog/menu.c Message-ID: <20210122120821.23B2C68A2B9@ffbox0-bg.mplayerhq.hu> Author: ib Date: Fri Jan 22 14:08:20 2021 New Revision: 38232 Log: Fix language names. Modified: trunk/gui/dialog/menu.c Modified: trunk/gui/dialog/menu.c ============================================================================== --- trunk/gui/dialog/menu.c Fri Jan 22 12:59:03 2021 (r38231) +++ trunk/gui/dialog/menu.c Fri Jan 22 14:08:20 2021 (r38232) @@ -306,8 +306,8 @@ static const Languages_t Languages[] = { lng( 'q','u' ), "que", "Runa Simi" }, { lng( 'r','m' ), "roh", "Rätoromanisch" }, { lng( 'r','n' ), "run", "íkiRǔndi" }, - { lng( 'r','o' ), "ron", "Română)" }, - { lng( 'r','o' ), "rum", "Română)" }, + { lng( 'r','o' ), "ron", "Română" }, + { lng( 'r','o' ), "rum", "Română" }, { lng( 'r','u' ), "rus", "Русский" }, { lng( 'r','w' ), "kin", "Ikinyarwanda" }, { lng( 's','c' ), "srd", "Sardu" }, @@ -319,7 +319,7 @@ static const Languages_t Languages[] = { lng( 's','l' ), "slv", "Slovenščina" }, { lng( 's','m' ), "smo", "Gagana Sāmoa" }, { lng( 's','n' ), "sna", "chiShona" }, - { lng( 's','o' ), "som", "Af-ka Soomaali-ga" }, + { lng( 's','o' ), "som", "Afka Soomaaliga" }, { lng( 's','q' ), "sqi", "Shqip" }, { lng( 's','q' ), "alb", "Shqip" }, { lng( 's','r' ), "srp", "Српски" }, From subversion at mplayerhq.hu Sat Jan 23 20:22:09 2021 From: subversion at mplayerhq.hu (reimar) Date: Sat, 23 Jan 2021 20:22:09 +0200 (EET) Subject: [MPlayer-cvslog] r38233 - in trunk: asxparser.c bstr.c command.c gui/dialog/fileselect.c gui/dialog/menu.c gui/dialog/preferences.c gui/win32/skinload.c input/input.c libaf/format.c libao2/ao_oss.c libass/ass.c lib... Message-ID: <20210123182210.9EF9D687FA4@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Sat Jan 23 20:22:09 2021 New Revision: 38233 Log: Remove use of strings.h header, use avutil/avstring.h instead. The functions in strings.h are locale-dependent which we do not want them to be. In addition the header is only part of POSIX and not the C standard so it is annoying for porting. The main reason to look into it was testing the option of compiling with MSVC to allow a Windows-on-Arm port. However for that a compatibility wrapper would work as well. Modified: trunk/asxparser.c trunk/bstr.c trunk/command.c trunk/gui/dialog/fileselect.c trunk/gui/dialog/menu.c trunk/gui/dialog/preferences.c trunk/gui/win32/skinload.c trunk/input/input.c trunk/libaf/format.c trunk/libao2/ao_oss.c trunk/libass/ass.c trunk/libass/ass_font.c trunk/libass/ass_fontconfig.c trunk/libass/ass_utils.c trunk/libmenu/menu.c trunk/libmenu/menu_filesel.c trunk/libmenu/menu_param.c trunk/libmpcodecs/ad_libvorbis.c trunk/libmpcodecs/ae_toolame.c trunk/libmpcodecs/ae_twolame.c trunk/libmpcodecs/vd_ffmpeg.c trunk/libmpcodecs/vd_zrmjpeg.c trunk/libmpcodecs/ve_lavc.c trunk/libmpcodecs/ve_x264.c trunk/libmpcodecs/ve_xvid4.c trunk/libmpcodecs/vf_palette.c trunk/libmpcodecs/vf_zrmjpeg.c trunk/libmpdemux/demux_audio.c trunk/libmpdemux/demux_mf.c trunk/libmpdemux/demux_ogg.c trunk/libmpdemux/demux_viv.c trunk/libmpdemux/demuxer.c trunk/libmpdemux/extension.c trunk/libmpdemux/muxer_mpeg.c trunk/libvo/vo_aa.c trunk/libvo/vo_dfbmga.c trunk/libvo/vo_dxr2.c trunk/libvo/vo_dxr3.c trunk/libvo/vo_matrixview.c trunk/libvo/vo_vdpau.c trunk/libvo/vo_xvr100.c trunk/libvo/vo_zr.c trunk/libvo/vosub_vidix.c trunk/libvo/x11_common.c trunk/loader/dshow/DS_VideoDecoder.c trunk/loader/ext.c trunk/loader/win32.c trunk/loader/wine/winestring.h trunk/m_config.c trunk/m_option.c trunk/m_struct.c trunk/mencoder.c trunk/mp_msg.c trunk/mplayer.c trunk/osdep/priority.c trunk/parser-mpcmd.c trunk/playtree.c trunk/playtreeparser.c trunk/stream/asf_streaming.c trunk/stream/http.c trunk/stream/librtsp/rtsp.c trunk/stream/network.c trunk/stream/stream.c trunk/stream/stream_bd.c trunk/stream/stream_dvd.c trunk/stream/stream_pvr.c trunk/stream/tv.c trunk/stream/tvi_dshow.c trunk/stream/tvi_v4l.c trunk/stream/tvi_v4l2.c trunk/stream/url.c trunk/sub/font_load.c trunk/sub/font_load_ft.c trunk/sub/spudec.c trunk/sub/subassconvert.c trunk/sub/subreader.c trunk/sub/vobsub.c trunk/subopt-helper.c trunk/udp_sync.c Modified: trunk/asxparser.c ============================================================================== --- trunk/asxparser.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/asxparser.c Sat Jan 23 20:22:09 2021 (r38233) @@ -22,9 +22,9 @@ #include #include #include -#include #include +#include "libavutil/avstring.h" #include "playtree.h" #include "playtreeparser.h" #include "stream/stream.h" @@ -56,7 +56,7 @@ asx_get_attrib(const char* attrib,char** if(attrib == NULL || attribs == NULL) return NULL; for(ptr = attribs; ptr[0] != NULL; ptr += 2){ - if(strcasecmp(ptr[0],attrib) == 0) + if(av_strcasecmp(ptr[0],attrib) == 0) return strdup(ptr[1]); } return NULL; @@ -69,7 +69,7 @@ asx_attrib_to_enum(const char* val,char* if(valid_vals == NULL || val == NULL) return -2; for(ptr = valid_vals ; ptr[0] != NULL ; ptr++) { - if(strcasecmp(val,ptr[0]) == 0) return r; + if(av_strcasecmp(val,ptr[0]) == 0) return r; r++; } @@ -323,11 +323,11 @@ asx_get_element(ASX_Parser_t* parser,cha free(attribs); return -1; } - if(ptr4[1] != '/' && strncasecmp(element,ptr4+1,strlen(element)) == 0) { + if(ptr4[1] != '/' && av_strncasecmp(element,ptr4+1,strlen(element)) == 0) { in++; ptr4+=2; continue; - } else if(strncasecmp(element,ptr4+2,strlen(element)) == 0) { // Extract body + } else if(av_strncasecmp(element,ptr4+2,strlen(element)) == 0) { // Extract body if(in > 0) { in--; ptr4 += 2+strlen(element); @@ -498,7 +498,7 @@ asx_parse_entry(ASX_Parser_t* parser,cha } else if (r == 0) { // No more element break; } - if(strcasecmp(element,"REF") == 0) { + if(av_strcasecmp(element,"REF") == 0) { asx_parse_ref(parser,attribs,ref); mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to entry\n",element); nref++; @@ -547,28 +547,28 @@ asx_parse_repeat(ASX_Parser_t* parser,ch } else if (r == 0) { // No more element break; } - if(strcasecmp(element,"ENTRY") == 0) { + if(av_strcasecmp(element,"ENTRY") == 0) { entry = asx_parse_entry(parser,body,attribs); if(entry) { if(!list) list = entry; else play_tree_append_entry(list,entry); mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to repeat\n",element); } - } else if(strcasecmp(element,"ENTRYREF") == 0) { + } else if(av_strcasecmp(element,"ENTRYREF") == 0) { entry = asx_parse_entryref(parser,body,attribs); if(entry) { if(!list) list = entry; else play_tree_append_entry(list,entry); mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to repeat\n",element); } - } else if(strcasecmp(element,"REPEAT") == 0) { + } else if(av_strcasecmp(element,"REPEAT") == 0) { entry = asx_parse_repeat(parser,body,attribs); if(entry) { if(!list) list = entry; else play_tree_append_entry(list,entry); mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to repeat\n",element); } - } else if(strcasecmp(element,"PARAM") == 0) { + } else if(av_strcasecmp(element,"PARAM") == 0) { asx_parse_param(parser,attribs,repeat); } else mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Ignoring element %s\n",element); @@ -610,7 +610,7 @@ asx_parser_build_tree(char* buffer,int d return NULL; } - if(strcasecmp(element,"ASX") != 0) { + if(av_strcasecmp(element,"ASX") != 0) { mp_msg(MSGT_PLAYTREE,MSGL_ERR,"first element isn't ASX, it's %s\n",element); free(element); free(asx_body); @@ -645,21 +645,21 @@ asx_parser_build_tree(char* buffer,int d } else if (r == 0) { // No more element break; } - if(strcasecmp(element,"ENTRY") == 0) { + if(av_strcasecmp(element,"ENTRY") == 0) { entry = asx_parse_entry(parser,body,attribs); if(entry) { if(!list) list = entry; else play_tree_append_entry(list,entry); mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to asx\n",element); } - } else if(strcasecmp(element,"ENTRYREF") == 0) { + } else if(av_strcasecmp(element,"ENTRYREF") == 0) { entry = asx_parse_entryref(parser,body,attribs); if(entry) { if(!list) list = entry; else play_tree_append_entry(list,entry); mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to asx\n",element); } - } else if(strcasecmp(element,"REPEAT") == 0) { + } else if(av_strcasecmp(element,"REPEAT") == 0) { entry = asx_parse_repeat(parser,body,attribs); if(entry) { if(!list) list = entry; Modified: trunk/bstr.c ============================================================================== --- trunk/bstr.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/bstr.c Sat Jan 23 20:22:09 2021 (r38233) @@ -17,8 +17,8 @@ */ #include -#include #include +#include "libavutil/avstring.h" #include #include "bstr.h" @@ -40,7 +40,7 @@ int bstrcmp(struct bstr str1, struct bst int bstrcasecmp(struct bstr str1, struct bstr str2) { - int ret = strncasecmp(str1.start, str2.start, FFMIN(str1.len, str2.len)); + int ret = av_strncasecmp(str1.start, str2.start, FFMIN(str1.len, str2.len)); if (!ret) { if (str1.len == str2.len) Modified: trunk/command.c ============================================================================== --- trunk/command.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/command.c Sat Jan 23 20:22:09 2021 (r38233) @@ -22,7 +22,6 @@ #include #include #include -#include #include "config.h" #include "command.h" @@ -3423,7 +3422,7 @@ int run_command(MPContext *mpctx, mp_cmd for (i = 0; mp_dvdnav_bindings[i].name; i++) if (cmd->args[0].v.s && - !strcasecmp (cmd->args[0].v.s, + !av_strcasecmp (cmd->args[0].v.s, mp_dvdnav_bindings[i].name)) command = mp_dvdnav_bindings[i].cmd; Modified: trunk/gui/dialog/fileselect.c ============================================================================== --- trunk/gui/dialog/fileselect.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/gui/dialog/fileselect.c Sat Jan 23 20:22:09 2021 (r38233) @@ -19,7 +19,6 @@ #include #include #include -#include #include #include @@ -54,6 +53,7 @@ #include "mpcommon.h" #include "mplayer.h" #include "libavutil/common.h" +#include "libavutil/avstring.h" #include "stream/stream.h" #ifdef __linux__ @@ -413,7 +413,7 @@ static void CheckDir(GtkWidget *list) if (ext || !fext[0]) { for (j = 0; j < fn; j++) { - if (fext[j] == NULL || strcasecmp(fext[j], ext) == 0) { + if (fext[j] == NULL || av_strcasecmp(fext[j], ext) == 0) { fs_get_pixmap(ext, &fpixmap, &fmask); clist_append_fname(list, gg.gl_pathv[i], fpixmap, fmask); break; Modified: trunk/gui/dialog/menu.c ============================================================================== --- trunk/gui/dialog/menu.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/gui/dialog/menu.c Sat Jan 23 20:22:09 2021 (r38233) @@ -19,7 +19,6 @@ #include #include #include -#include #include "config.h" #include "help_mp.h" @@ -396,7 +395,7 @@ static const char * GetLanguage( void *l else if ( p[3] != 0) return language; } for ( i=0;i #include #include -#include #include #include #include "config.h" +#include "libavutil/avstring.h" #include "help_mp.h" #include "mixer.h" #include "mpcommon.h" @@ -856,7 +856,7 @@ static GtkWidget * CreatePreferences( vo CBSubEncoding_items=g_list_append( CBSubEncoding_items,lEncoding[i].comment ); if ( !listed ) - if ( strcasecmp ( lEncoding[i].name, sub_cp ) == 0 ) listed=True; + if ( av_strcasecmp ( lEncoding[i].name, sub_cp ) == 0 ) listed=True; } } if ( !listed ) CBSubEncoding_items=g_list_insert( CBSubEncoding_items,sub_cp,1 ); @@ -945,7 +945,7 @@ static GtkWidget * CreatePreferences( vo int i, append, listed=(subtitle_font_encoding == NULL); for ( i=0;lEncoding[i].name;i++ ) { - append=(strcasecmp( lEncoding[i].name,ENC_UNICODE ) == 0); + append=(av_strcasecmp( lEncoding[i].name,ENC_UNICODE ) == 0); #ifdef CONFIG_ICONV cd=iconv_open( "ucs-4",lEncoding[i].name ); @@ -960,7 +960,7 @@ static GtkWidget * CreatePreferences( vo CBFontEncoding_items=g_list_append( CBFontEncoding_items,lEncoding[i].comment ); if ( !listed ) - if ( strcasecmp ( lEncoding[i].name, subtitle_font_encoding ) == 0 ) listed=True; + if ( av_strcasecmp ( lEncoding[i].name, subtitle_font_encoding ) == 0 ) listed=True; } } if ( !listed ) CBFontEncoding_items=g_list_insert( CBFontEncoding_items,subtitle_font_encoding,1 ); @@ -1326,7 +1326,7 @@ void ShowPreferences( void ) { int i; for ( i=0;lEncoding[i].name;i++ ) - if ( !strcasecmp( sub_cp,lEncoding[i].name ) ) break; + if ( !av_strcasecmp( sub_cp,lEncoding[i].name ) ) break; if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),lEncoding[i].comment ); else gtk_entry_set_text( GTK_ENTRY( ESubEncoding ),sub_cp ); gtk_widget_set_sensitive( CBSubUtf8,FALSE ); @@ -1347,7 +1347,7 @@ void ShowPreferences( void ) int i; const char *s = (subtitle_font_encoding ? subtitle_font_encoding : ENC_UNICODE); for ( i=0;lEncoding[i].name;i++ ) - if ( !strcasecmp( s,lEncoding[i].name ) ) break; + if ( !av_strcasecmp( s,lEncoding[i].name ) ) break; if ( lEncoding[i].name ) gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),lEncoding[i].comment ); else gtk_entry_set_text( GTK_ENTRY( EFontEncoding ),s ); } Modified: trunk/gui/win32/skinload.c ============================================================================== --- trunk/gui/win32/skinload.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/gui/win32/skinload.c Sat Jan 23 20:22:09 2021 (r38233) @@ -21,7 +21,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include #include #include @@ -32,6 +31,7 @@ #include "help_mp.h" #include "cpudetect.h" #include "libswscale/swscale.h" +#include "libavutil/avstring.h" #include "libavutil/attributes.h" #include "libavutil/common.h" #include "libavutil/imgutils.h" @@ -147,7 +147,7 @@ static image *pngRead(skin_t *skin, cons char *filename = NULL; FILE *fp; - if(!strcasecmp(fname, "NULL")) return 0; + if(!av_strcasecmp(fname, "NULL")) return 0; /* find filename in order file file.png */ if(!(fp = fopen(fname, "rb"))) Modified: trunk/input/input.c ============================================================================== --- trunk/input/input.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/input/input.c Sat Jan 23 20:22:09 2021 (r38233) @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -820,7 +819,7 @@ mp_input_parse_cmd(char* str) { return NULL; for(i=0; mp_cmds[i].name[0]; i++) { - if(strncasecmp(mp_cmds[i].name,str,l) == 0) + if(av_strncasecmp(mp_cmds[i].name,str,l) == 0) break; } @@ -1488,11 +1487,11 @@ mp_input_get_key_from_name(const char *n if(len == 1) { // Direct key code ret = (unsigned char)name[0]; return ret; - } else if(len > 2 && strncasecmp("0x",name,2) == 0) + } else if(len > 2 && av_strncasecmp("0x",name,2) == 0) return strtol(name,NULL,16); for(i = 0; key_names[i].name[0]; i++) { - if(strcasecmp(key_names[i].name,name) == 0) + if(av_strcasecmp(key_names[i].name,name) == 0) return key_names[i].key; } Modified: trunk/libaf/format.c ============================================================================== --- trunk/libaf/format.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libaf/format.c Sat Jan 23 20:22:09 2021 (r38233) @@ -21,11 +21,11 @@ #include #include #include -#include #include #include #include "af.h" +#include "libavutil/avstring.h" #include "help_mp.h" // Convert from string to format @@ -215,7 +215,7 @@ int af_str2fmt_short(const char* str) int i; for (i = 0; af_fmtstr_table[i].name; i++) - if (!strcasecmp(str, af_fmtstr_table[i].name)) + if (!av_strcasecmp(str, af_fmtstr_table[i].name)) return af_fmtstr_table[i].format; return -1; Modified: trunk/libao2/ao_oss.c ============================================================================== --- trunk/libao2/ao_oss.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libao2/ao_oss.c Sat Jan 23 20:22:09 2021 (r38233) @@ -29,9 +29,9 @@ #include #include #include -#include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "mixer.h" #include "help_mp.h" @@ -259,7 +259,7 @@ static int init(int rate,int channels,in close(fd); for (i=0; i #include #include -#include #include #include #include @@ -34,6 +33,7 @@ #include #endif +#include "libavutil/avstring.h" #include "ass.h" #include "ass_utils.h" #include "ass_library.h" @@ -230,35 +230,35 @@ static int numpad2align(int val) if (!token) break; #define ANYVAL(name,func) \ - } else if (strcasecmp(tname, #name) == 0) { \ + } else if (av_strcasecmp(tname, #name) == 0) { \ target->name = func(token); \ ass_msg(track->library, MSGL_DBG2, "%s = %s", #name, token); #define STRVAL(name) \ - } else if (strcasecmp(tname, #name) == 0) { \ + } else if (av_strcasecmp(tname, #name) == 0) { \ if (target->name != NULL) free(target->name); \ target->name = strdup(token); \ ass_msg(track->library, MSGL_DBG2, "%s = %s", #name, token); #define COLORVAL(name) \ - } else if (strcasecmp(tname, #name) == 0) { \ + } else if (av_strcasecmp(tname, #name) == 0) { \ target->name = string2color(track->library, token); \ ass_msg(track->library, MSGL_DBG2, "%s = %s", #name, token); #define INTVAL(name) ANYVAL(name,atoi) #define FPVAL(name) ANYVAL(name,ass_atof) #define TIMEVAL(name) \ - } else if (strcasecmp(tname, #name) == 0) { \ + } else if (av_strcasecmp(tname, #name) == 0) { \ target->name = string2timecode(track->library, token); \ ass_msg(track->library, MSGL_DBG2, "%s = %s", #name, token); #define STYLEVAL(name) \ - } else if (strcasecmp(tname, #name) == 0) { \ + } else if (av_strcasecmp(tname, #name) == 0) { \ target->name = lookup_style(track, token); \ ass_msg(track->library, MSGL_DBG2, "%s = %s", #name, token); #define ALIAS(alias,name) \ - if (strcasecmp(tname, #alias) == 0) {tname = #name;} + if (av_strcasecmp(tname, #alias) == 0) {tname = #name;} static char *next_token(char **str) { @@ -321,7 +321,7 @@ static int process_event_tail(ASS_Track while (1) { NEXT(q, tname); - if (strcasecmp(tname, "Text") == 0) { + if (av_strcasecmp(tname, "Text") == 0) { char *last; event->Text = strdup(p); if (*event->Text != 0) { @@ -375,19 +375,19 @@ void ass_process_force_style(ASS_Track * *eq = '\0'; token = eq + 1; - if (!strcasecmp(*fs, "PlayResX")) + if (!av_strcasecmp(*fs, "PlayResX")) track->PlayResX = atoi(token); - else if (!strcasecmp(*fs, "PlayResY")) + else if (!av_strcasecmp(*fs, "PlayResY")) track->PlayResY = atoi(token); - else if (!strcasecmp(*fs, "Timer")) + else if (!av_strcasecmp(*fs, "Timer")) track->Timer = ass_atof(token); - else if (!strcasecmp(*fs, "WrapStyle")) + else if (!av_strcasecmp(*fs, "WrapStyle")) track->WrapStyle = atoi(token); - else if (!strcasecmp(*fs, "ScaledBorderAndShadow")) + else if (!av_strcasecmp(*fs, "ScaledBorderAndShadow")) track->ScaledBorderAndShadow = parse_bool(token); - else if (!strcasecmp(*fs, "Kerning")) + else if (!av_strcasecmp(*fs, "Kerning")) track->Kerning = parse_bool(token); - else if (!strcasecmp(*fs, "YCbCr Matrix")) + else if (!av_strcasecmp(*fs, "YCbCr Matrix")) track->YCbCrMatrix = parse_ycbcr_matrix(token); dt = strrchr(*fs, '.'); @@ -401,7 +401,7 @@ void ass_process_force_style(ASS_Track * } for (sid = 0; sid < track->n_styles; ++sid) { if (style == NULL - || strcasecmp(track->styles[sid].Name, style) == 0) { + || av_strcasecmp(track->styles[sid].Name, style) == 0) { target = track->styles + sid; if (0) { STRVAL(FontName) @@ -748,17 +748,17 @@ static int process_fonts_line(ASS_Track */ static int process_line(ASS_Track *track, char *str) { - if (!strncasecmp(str, "[Script Info]", 13)) { + if (!av_strncasecmp(str, "[Script Info]", 13)) { track->parser_priv->state = PST_INFO; - } else if (!strncasecmp(str, "[V4 Styles]", 11)) { + } else if (!av_strncasecmp(str, "[V4 Styles]", 11)) { track->parser_priv->state = PST_STYLES; track->track_type = TRACK_TYPE_SSA; - } else if (!strncasecmp(str, "[V4+ Styles]", 12)) { + } else if (!av_strncasecmp(str, "[V4+ Styles]", 12)) { track->parser_priv->state = PST_STYLES; track->track_type = TRACK_TYPE_ASS; - } else if (!strncasecmp(str, "[Events]", 8)) { + } else if (!av_strncasecmp(str, "[Events]", 8)) { track->parser_priv->state = PST_EVENTS; - } else if (!strncasecmp(str, "[Fonts]", 7)) { + } else if (!av_strncasecmp(str, "[Fonts]", 7)) { track->parser_priv->state = PST_FONTS; } else { switch (track->parser_priv->state) { Modified: trunk/libass/ass_font.c ============================================================================== --- trunk/libass/ass_font.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libass/ass_font.c Sat Jan 23 20:22:09 2021 (r38233) @@ -25,8 +25,8 @@ #include FT_GLYPH_H #include FT_TRUETYPE_TABLES_H #include FT_OUTLINE_H -#include +#include "libavutil/avstring.h" #include "ass.h" #include "ass_library.h" #include "ass_font.h" @@ -83,7 +83,7 @@ static int find_font(ASS_Library *librar { int i; for (i = 0; i < library->num_fontdata; ++i) - if (strcasecmp(name, library->fontdata[i].name) == 0) + if (av_strcasecmp(name, library->fontdata[i].name) == 0) return i; return -1; } Modified: trunk/libass/ass_fontconfig.c ============================================================================== --- trunk/libass/ass_fontconfig.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libass/ass_fontconfig.c Sat Jan 23 20:22:09 2021 (r38233) @@ -22,13 +22,13 @@ #include #include #include -#include #include #include #include #include #include FT_FREETYPE_H +#include "libavutil/avstring.h" #include "ass_utils.h" #include "ass.h" #include "ass_library.h" @@ -94,7 +94,7 @@ match_fullname(ASS_Library *lib, FCInsta if (FcPatternGetInteger(pat, FC_WEIGHT, 0, &at) != FcResultMatch || at < bold) continue; - if (strcasecmp(fullname, family) == 0) { + if (av_strcasecmp(fullname, family) == 0) { FcFontSetAdd(result, FcPatternDuplicate(pat)); break; } @@ -256,8 +256,8 @@ static char *select_font(ASS_Library *li r_fullname = NULL; if (!treat_family_as_pattern && - !(r_family && strcasecmp((const char *) r_family, family) == 0) && - !(r_fullname && strcasecmp((const char *) r_fullname, family) == 0)) + !(r_family && av_strcasecmp((const char *) r_family, family) == 0) && + !(r_fullname && av_strcasecmp((const char *) r_fullname, family) == 0)) ass_msg(library, MSGL_WARN, "fontconfig: Selected font is not the requested one: " "'%s' != '%s'", Modified: trunk/libass/ass_utils.c ============================================================================== --- trunk/libass/ass_utils.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libass/ass_utils.c Sat Jan 23 20:22:09 2021 (r38233) @@ -23,8 +23,8 @@ #include #include #include FT_GLYPH_H -#include +#include "libavutil/avstring.h" #include "ass_library.h" #include "ass.h" #include "ass_utils.h" @@ -115,7 +115,7 @@ char parse_bool(char *str) { while (*str == ' ' || *str == '\t') str++; - if (!strncasecmp(str, "yes", 3)) + if (!av_strncasecmp(str, "yes", 3)) return 1; else if (strtol(str, NULL, 10) > 0) return 1; @@ -141,23 +141,23 @@ int parse_ycbcr_matrix(char *str) strncpy(buffer, str, n); buffer[n] = '\0'; - if (!strcasecmp(buffer, "none")) + if (!av_strcasecmp(buffer, "none")) return YCBCR_NONE; - if (!strcasecmp(buffer, "tv.601")) + if (!av_strcasecmp(buffer, "tv.601")) return YCBCR_BT601_TV; - if (!strcasecmp(buffer, "pc.601")) + if (!av_strcasecmp(buffer, "pc.601")) return YCBCR_BT601_PC; - if (!strcasecmp(buffer, "tv.709")) + if (!av_strcasecmp(buffer, "tv.709")) return YCBCR_BT709_TV; - if (!strcasecmp(buffer, "pc.709")) + if (!av_strcasecmp(buffer, "pc.709")) return YCBCR_BT709_PC; - if (!strcasecmp(buffer, "tv.240m")) + if (!av_strcasecmp(buffer, "tv.240m")) return YCBCR_SMPTE240M_TV; - if (!strcasecmp(buffer, "pc.240m")) + if (!av_strcasecmp(buffer, "pc.240m")) return YCBCR_SMPTE240M_PC; - if (!strcasecmp(buffer, "tv.fcc")) + if (!av_strcasecmp(buffer, "tv.fcc")) return YCBCR_FCC_TV; - if (!strcasecmp(buffer, "pc.fcc")) + if (!av_strcasecmp(buffer, "pc.fcc")) return YCBCR_FCC_PC; return YCBCR_UNKNOWN; } @@ -245,7 +245,7 @@ void *ass_guess_buffer_cp(ASS_Library *l for (i = 0; i < langcnt; i++) { const char *tmp; - if (strcasecmp(languages[i], preferred_language) != 0) + if (av_strcasecmp(languages[i], preferred_language) != 0) continue; analyser = enca_analyser_alloc(languages[i]); encoding = enca_analyse_const(analyser, buffer, buflen); Modified: trunk/libmenu/menu.c ============================================================================== --- trunk/libmenu/menu.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmenu/menu.c Sat Jan 23 20:22:09 2021 (r38233) @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -37,6 +36,7 @@ #include "libmpcodecs/img_format.h" #include "libmpcodecs/mp_image.h" +#include "libavutil/avstring.h" #include "libavutil/mem.h" #include "m_option.h" #include "m_struct.h" @@ -100,7 +100,7 @@ static menu_cmd_bindings_t *get_cmd_bind { int i; for (i = 0; i < cmd_bindings_num; ++i) - if (!strcasecmp(cmd_bindings[i].name, name)) + if (!av_strcasecmp(cmd_bindings[i].name, name)) return &cmd_bindings[i]; return NULL; } @@ -131,7 +131,7 @@ static int menu_parse_config(char* buffe continue; } - if (!strcasecmp(element, "keybindings")) { + if (!av_strcasecmp(element, "keybindings")) { menu_cmd_bindings_t *bindings = cmd_bindings; char *parent_bindings; cmd_bindings = realloc(cmd_bindings, @@ -164,7 +164,7 @@ static int menu_parse_config(char* buffe } if(r == 0) break; - if (!strcasecmp(element, "binding")) { + if (!av_strcasecmp(element, "binding")) { key = asx_get_attrib("key",attribs); cmd = asx_get_attrib("cmd",attribs); if (key && (keycode = mp_input_get_key_from_name(key)) >= 0) { @@ -193,7 +193,7 @@ static int menu_parse_config(char* buffe } // Try to find this menu type in our list for(i = 0, minfo = NULL ; menu_info_list[i] ; i++) { - if(strcasecmp(element,menu_info_list[i]->name) == 0) { + if(av_strcasecmp(element,menu_info_list[i]->name) == 0) { minfo = menu_info_list[i]; break; } @@ -207,7 +207,7 @@ static int menu_parse_config(char* buffe menu_list[menu_count].args = body; // Setup the attribs for(i = 0 ; attribs[2*i] ; i++) { - if(strcasecmp(attribs[2*i],"name") == 0) continue; + if(av_strcasecmp(attribs[2*i],"name") == 0) continue; if(!m_struct_set(&minfo->priv_st,menu_list[menu_count].cfg,attribs[2*i], attribs[2*i+1])) mp_msg(MSGT_GLOBAL,MSGL_WARN,MSGTR_LIBMENU_BadAttrib,attribs[2*i],attribs[2*i+1], name,parser->line); Modified: trunk/libmenu/menu_filesel.c ============================================================================== --- trunk/libmenu/menu_filesel.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmenu/menu_filesel.c Sat Jan 23 20:22:09 2021 (r38233) @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -283,7 +282,7 @@ static int open_dir(menu_t* menu,char* a ext++; elem = extensions; do { - if (!strcasecmp(ext, *elem)) + if (!av_strcasecmp(ext, *elem)) break; } while (*++elem); if (*elem == NULL) Modified: trunk/libmenu/menu_param.c ============================================================================== --- trunk/libmenu/menu_param.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmenu/menu_param.c Sat Jan 23 20:22:09 2021 (r38233) @@ -23,11 +23,12 @@ #include #include #include -#include #include #include #include +#include "libavutil/avstring.h" + #include "mp_msg.h" #include "help_mp.h" @@ -168,9 +169,9 @@ static int parse_args(menu_t* menu,char* auto_update = asx_get_attrib("auto-update", attribs); if (auto_update) { if (!strcmp(auto_update, "1") || - !strcasecmp(auto_update, "on") || - !strcasecmp(auto_update, "yes") || - !strcasecmp(auto_update, "true")) + !av_strcasecmp(auto_update, "on") || + !av_strcasecmp(auto_update, "yes") || + !av_strcasecmp(auto_update, "true")) m->auto_update = 1; free(auto_update); } Modified: trunk/libmpcodecs/ad_libvorbis.c ============================================================================== --- trunk/libmpcodecs/ad_libvorbis.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpcodecs/ad_libvorbis.c Sat Jan 23 20:22:09 2021 (r38233) @@ -18,12 +18,12 @@ #include #include -#include #include #include #include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "ad_internal.h" #include "libaf/reorder_ch.h" @@ -68,7 +68,7 @@ static int read_vorbis_comment( char* pt va_start( va, format ); clen = strlen( comment ); - ret = strncasecmp( ptr, comment, clen) == 0 ? vsscanf( ptr+clen, format, va ) : 0; + ret = av_strncasecmp( ptr, comment, clen) == 0 ? vsscanf( ptr+clen, format, va ) : 0; va_end( va ); return ret; Modified: trunk/libmpcodecs/ae_toolame.c ============================================================================== --- trunk/libmpcodecs/ae_toolame.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpcodecs/ae_toolame.c Sat Jan 23 20:22:09 2021 (r38233) @@ -21,10 +21,10 @@ #include #include #include -#include #include #include +#include "libavutil/avstring.h" #include "m_option.h" #include "mp_msg.h" #include "libmpdemux/aviheader.h" @@ -161,11 +161,11 @@ int mpae_init_toolame(audio_encoder_t *e } else if(encoder->params.channels == 2) { - if(! strcasecmp(param_mode, "dual")) + if(! av_strcasecmp(param_mode, "dual")) mode = MPG_MD_DUAL_CHANNEL; - else if(! strcasecmp(param_mode, "jstereo")) + else if(! av_strcasecmp(param_mode, "jstereo")) mode = MPG_MD_JOINT_STEREO; - else if(! strcasecmp(param_mode, "stereo")) + else if(! av_strcasecmp(param_mode, "stereo")) mode = MPG_MD_STEREO; else { Modified: trunk/libmpcodecs/ae_twolame.c ============================================================================== --- trunk/libmpcodecs/ae_twolame.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpcodecs/ae_twolame.c Sat Jan 23 20:22:09 2021 (r38233) @@ -21,10 +21,10 @@ #include #include #include -#include #include #include +#include "libavutil/avstring.h" #include "m_option.h" #include "mp_msg.h" #include "libmpdemux/aviheader.h" @@ -154,11 +154,11 @@ int mpae_init_twolame(audio_encoder_t *e } else if(encoder->params.channels == 2) { - if(! strcasecmp(param_mode, "dual")) + if(! av_strcasecmp(param_mode, "dual")) mode = TWOLAME_DUAL_CHANNEL; - else if(! strcasecmp(param_mode, "jstereo")) + else if(! av_strcasecmp(param_mode, "jstereo")) mode = TWOLAME_JOINT_STEREO; - else if(! strcasecmp(param_mode, "stereo")) + else if(! av_strcasecmp(param_mode, "stereo")) mode = TWOLAME_STEREO; else { Modified: trunk/libmpcodecs/vd_ffmpeg.c ============================================================================== --- trunk/libmpcodecs/vd_ffmpeg.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpcodecs/vd_ffmpeg.c Sat Jan 23 20:22:09 2021 (r38233) @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -29,6 +28,7 @@ #include "av_helpers.h" #include "libavutil/common.h" +#include "libavutil/avstring.h" #include "libavutil/dict.h" #include "libavutil/intreadwrite.h" #include "libavutil/opt.h" @@ -163,12 +163,12 @@ const m_option_t lavc_decode_opts_conf[] static enum AVDiscard str2AVDiscard(char *str) { if (!str) return AVDISCARD_DEFAULT; - if (strcasecmp(str, "none" ) == 0) return AVDISCARD_NONE; - if (strcasecmp(str, "default") == 0) return AVDISCARD_DEFAULT; - if (strcasecmp(str, "nonref" ) == 0) return AVDISCARD_NONREF; - if (strcasecmp(str, "bidir" ) == 0) return AVDISCARD_BIDIR; - if (strcasecmp(str, "nonkey" ) == 0) return AVDISCARD_NONKEY; - if (strcasecmp(str, "all" ) == 0) return AVDISCARD_ALL; + if (av_strcasecmp(str, "none" ) == 0) return AVDISCARD_NONE; + if (av_strcasecmp(str, "default") == 0) return AVDISCARD_DEFAULT; + if (av_strcasecmp(str, "nonref" ) == 0) return AVDISCARD_NONREF; + if (av_strcasecmp(str, "bidir" ) == 0) return AVDISCARD_BIDIR; + if (av_strcasecmp(str, "nonkey" ) == 0) return AVDISCARD_NONKEY; + if (av_strcasecmp(str, "all" ) == 0) return AVDISCARD_ALL; mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Unknown discard value %s\n", str); return AVDISCARD_DEFAULT; } Modified: trunk/libmpcodecs/vd_zrmjpeg.c ============================================================================== --- trunk/libmpcodecs/vd_zrmjpeg.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpcodecs/vd_zrmjpeg.c Sat Jan 23 20:22:09 2021 (r38233) @@ -23,9 +23,9 @@ #include #include -#include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "vfcap.h" @@ -209,7 +209,7 @@ static unsigned int guess_mjpeg_type(uns if (app0 && get_int2(data + app0 + 2) >= 5 && - strncasecmp((char*)(data + app0 + 4), "AVI1", 4) == 0) { + av_strncasecmp((char*)(data + app0 + 4), "AVI1", 4) == 0) { if (data[app0+8] == 1) { VERBOSE("data is interlaced, APP0: top-first (1)\n"); return IMGFMT_ZRMJPEGIT; Modified: trunk/libmpcodecs/ve_lavc.c ============================================================================== --- trunk/libmpcodecs/ve_lavc.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpcodecs/ve_lavc.c Sat Jan 23 20:22:09 2021 (r38233) @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -32,6 +31,7 @@ #endif #include "config.h" +#include "libavutil/avstring.h" #include "mencoder.h" #include "mp_msg.h" #include "help_mp.h" @@ -865,29 +865,29 @@ static int vf_open(vf_instance_t *vf, ch /* XXX: hack: some of the MJPEG decoder DLL's needs exported huffman table, so we define a zero-table, also lavc mjpeg encoder is putting huffman tables into the stream, so no problem */ - if (lavc_param_vcodec && !strcasecmp(lavc_param_vcodec, "mjpeg")) + if (lavc_param_vcodec && !av_strcasecmp(lavc_param_vcodec, "mjpeg")) { mux_v->bih=calloc(1, sizeof(*mux_v->bih)+28); mux_v->bih->biSize=sizeof(*mux_v->bih)+28; } - else if (lavc_param_vcodec && (!strcasecmp(lavc_param_vcodec, "huffyuv") - || !strcasecmp(lavc_param_vcodec, "ffvhuff"))) + else if (lavc_param_vcodec && (!av_strcasecmp(lavc_param_vcodec, "huffyuv") + || !av_strcasecmp(lavc_param_vcodec, "ffvhuff"))) { /* XXX: hack: huffyuv needs to store huffman tables (allthough we dunno the size yet ...) */ mux_v->bih=calloc(1, sizeof(*mux_v->bih)+1000); mux_v->bih->biSize=sizeof(*mux_v->bih)+1000; } - else if (lavc_param_vcodec && !strcasecmp(lavc_param_vcodec, "asv1")) + else if (lavc_param_vcodec && !av_strcasecmp(lavc_param_vcodec, "asv1")) { mux_v->bih=calloc(1, sizeof(*mux_v->bih)+8); mux_v->bih->biSize=sizeof(*mux_v->bih)+8; } - else if (lavc_param_vcodec && !strcasecmp(lavc_param_vcodec, "asv2")) + else if (lavc_param_vcodec && !av_strcasecmp(lavc_param_vcodec, "asv2")) { mux_v->bih=calloc(1, sizeof(*mux_v->bih)+8); mux_v->bih->biSize=sizeof(*mux_v->bih)+8; } - else if (lavc_param_vcodec && !strcasecmp(lavc_param_vcodec, "wmv2")) + else if (lavc_param_vcodec && !av_strcasecmp(lavc_param_vcodec, "wmv2")) { mux_v->bih=calloc(1, sizeof(*mux_v->bih)+4); mux_v->bih->biSize=sizeof(*mux_v->bih)+4; @@ -907,51 +907,51 @@ static int vf_open(vf_instance_t *vf, ch return 0; } - if (!strcasecmp(lavc_param_vcodec, "mpeg1") || !strcasecmp(lavc_param_vcodec, "mpeg1video")) + if (!av_strcasecmp(lavc_param_vcodec, "mpeg1") || !av_strcasecmp(lavc_param_vcodec, "mpeg1video")) mux_v->bih->biCompression = mmioFOURCC('m', 'p', 'g', '1'); - else if (!strcasecmp(lavc_param_vcodec, "mpeg2") || !strcasecmp(lavc_param_vcodec, "mpeg2video")) + else if (!av_strcasecmp(lavc_param_vcodec, "mpeg2") || !av_strcasecmp(lavc_param_vcodec, "mpeg2video")) mux_v->bih->biCompression = mmioFOURCC('m', 'p', 'g', '2'); - else if (!strcasecmp(lavc_param_vcodec, "h263") || !strcasecmp(lavc_param_vcodec, "h263p")) + else if (!av_strcasecmp(lavc_param_vcodec, "h263") || !av_strcasecmp(lavc_param_vcodec, "h263p")) mux_v->bih->biCompression = mmioFOURCC('h', '2', '6', '3'); - else if (!strcasecmp(lavc_param_vcodec, "rv10")) + else if (!av_strcasecmp(lavc_param_vcodec, "rv10")) mux_v->bih->biCompression = mmioFOURCC('R', 'V', '1', '0'); - else if (!strcasecmp(lavc_param_vcodec, "mjpeg")) + else if (!av_strcasecmp(lavc_param_vcodec, "mjpeg")) mux_v->bih->biCompression = mmioFOURCC('M', 'J', 'P', 'G'); - else if (!strcasecmp(lavc_param_vcodec, "ljpeg")) + else if (!av_strcasecmp(lavc_param_vcodec, "ljpeg")) mux_v->bih->biCompression = mmioFOURCC('L', 'J', 'P', 'G'); - else if (!strcasecmp(lavc_param_vcodec, "mpeg4")) + else if (!av_strcasecmp(lavc_param_vcodec, "mpeg4")) mux_v->bih->biCompression = mmioFOURCC('F', 'M', 'P', '4'); - else if (!strcasecmp(lavc_param_vcodec, "msmpeg4")) + else if (!av_strcasecmp(lavc_param_vcodec, "msmpeg4")) mux_v->bih->biCompression = mmioFOURCC('d', 'i', 'v', '3'); - else if (!strcasecmp(lavc_param_vcodec, "msmpeg4v2")) + else if (!av_strcasecmp(lavc_param_vcodec, "msmpeg4v2")) mux_v->bih->biCompression = mmioFOURCC('M', 'P', '4', '2'); - else if (!strcasecmp(lavc_param_vcodec, "wmv1")) + else if (!av_strcasecmp(lavc_param_vcodec, "wmv1")) mux_v->bih->biCompression = mmioFOURCC('W', 'M', 'V', '1'); - else if (!strcasecmp(lavc_param_vcodec, "wmv2")) + else if (!av_strcasecmp(lavc_param_vcodec, "wmv2")) mux_v->bih->biCompression = mmioFOURCC('W', 'M', 'V', '2'); - else if (!strcasecmp(lavc_param_vcodec, "huffyuv")) + else if (!av_strcasecmp(lavc_param_vcodec, "huffyuv")) mux_v->bih->biCompression = mmioFOURCC('H', 'F', 'Y', 'U'); - else if (!strcasecmp(lavc_param_vcodec, "ffvhuff")) + else if (!av_strcasecmp(lavc_param_vcodec, "ffvhuff")) mux_v->bih->biCompression = mmioFOURCC('F', 'F', 'V', 'H'); - else if (!strcasecmp(lavc_param_vcodec, "asv1")) + else if (!av_strcasecmp(lavc_param_vcodec, "asv1")) mux_v->bih->biCompression = mmioFOURCC('A', 'S', 'V', '1'); - else if (!strcasecmp(lavc_param_vcodec, "asv2")) + else if (!av_strcasecmp(lavc_param_vcodec, "asv2")) mux_v->bih->biCompression = mmioFOURCC('A', 'S', 'V', '2'); - else if (!strcasecmp(lavc_param_vcodec, "ffv1")) + else if (!av_strcasecmp(lavc_param_vcodec, "ffv1")) mux_v->bih->biCompression = mmioFOURCC('F', 'F', 'V', '1'); - else if (!strcasecmp(lavc_param_vcodec, "snow")) + else if (!av_strcasecmp(lavc_param_vcodec, "snow")) mux_v->bih->biCompression = mmioFOURCC('S', 'N', 'O', 'W'); - else if (!strcasecmp(lavc_param_vcodec, "flv")) + else if (!av_strcasecmp(lavc_param_vcodec, "flv")) mux_v->bih->biCompression = mmioFOURCC('F', 'L', 'V', '1'); - else if (!strcasecmp(lavc_param_vcodec, "dvvideo")) + else if (!av_strcasecmp(lavc_param_vcodec, "dvvideo")) mux_v->bih->biCompression = mmioFOURCC('d', 'v', 's', 'd'); - else if (!strcasecmp(lavc_param_vcodec, "libx264")) + else if (!av_strcasecmp(lavc_param_vcodec, "libx264")) mux_v->bih->biCompression = mmioFOURCC('h', '2', '6', '4'); - else if (!strcasecmp(lavc_param_vcodec, "libschroedinger")) + else if (!av_strcasecmp(lavc_param_vcodec, "libschroedinger")) mux_v->bih->biCompression = mmioFOURCC('d', 'r', 'a', 'c'); - else if (!strcasecmp(lavc_param_vcodec, "libdirac")) + else if (!av_strcasecmp(lavc_param_vcodec, "libdirac")) mux_v->bih->biCompression = mmioFOURCC('d', 'r', 'a', 'c'); - else if (!strcasecmp(lavc_param_vcodec, "libvpx")) + else if (!av_strcasecmp(lavc_param_vcodec, "libvpx")) mux_v->bih->biCompression = mmioFOURCC('V', 'P', '8', '0'); else mux_v->bih->biCompression = mmioFOURCC(lavc_param_vcodec[0], Modified: trunk/libmpcodecs/ve_x264.c ============================================================================== --- trunk/libmpcodecs/ve_x264.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpcodecs/ve_x264.c Sat Jan 23 20:22:09 2021 (r38233) @@ -30,10 +30,10 @@ #include #include #include -#include #include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "mencoder.h" #include "m_option.h" @@ -91,9 +91,9 @@ void x264enc_set_param(const m_option_t* if (!value) continue; *value++ = 0; - if (!strcasecmp(name, "preset")) + if (!av_strcasecmp(name, "preset")) preset = value; - else if (!strcasecmp(name, "tune")) + else if (!av_strcasecmp(name, "tune")) tune = value; } if (x264_param_default_preset(¶m, preset, tune) < 0) { @@ -109,16 +109,16 @@ void x264enc_set_param(const m_option_t* if (value) *value++ = 0; - if (!strcasecmp(name, "profile")) + if (!av_strcasecmp(name, "profile")) profile = value; - else if (!strcasecmp(name, "turbo")) { + else if (!av_strcasecmp(name, "turbo")) { mp_msg(MSGT_CFGPARSER, MSGL_WARN, "Option x264encopts: turbo option is deprecated; " "use slow_firstpass to disable turbo\n"); if (value && *value == '0') slow_firstpass = 1; - } else if (!strcasecmp(name, "slow_firstpass")) + } else if (!av_strcasecmp(name, "slow_firstpass")) slow_firstpass = 1; - else if (strcasecmp(name, "preset") && strcasecmp(name, "tune")) { + else if (av_strcasecmp(name, "preset") && av_strcasecmp(name, "tune")) { ret = x264_param_parse(¶m, name, value); if (ret == X264_PARAM_BAD_NAME) mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option x264encopts: Unknown suboption %s\n", name); Modified: trunk/libmpcodecs/ve_xvid4.c ============================================================================== --- trunk/libmpcodecs/ve_xvid4.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpcodecs/ve_xvid4.c Sat Jan 23 20:22:09 2021 (r38233) @@ -28,13 +28,13 @@ #include #include #include -#include #include #include #include #include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "mencoder.h" #include "codec-cfg.h" @@ -150,7 +150,7 @@ static const profile_t profiles[] = static const profile_t *profileFromName(const char *str) { profile_t *cur = profiles; - while (cur->name && strcasecmp(cur->name, str)) cur++; + while (cur->name && av_strcasecmp(cur->name, str)) cur++; if(!cur->name) return NULL; return cur; } @@ -851,7 +851,7 @@ static int dispatch_settings(xvid_mplaye // MPEG quantisation is only supported in ASP and unrestricted profiles if((selected_profile->flags & PROFILE_MPEGQUANT) && (xvidenc_quant_method != NULL) && - !strcasecmp(xvidenc_quant_method, "mpeg")) + !av_strcasecmp(xvidenc_quant_method, "mpeg")) { frame->vol_flags |= XVID_VOL_MPEGQUANT; if(xvidenc_intra_matrix_file != NULL) { @@ -965,15 +965,15 @@ static int dispatch_settings(xvid_mplaye } } else if(xvidenc_par != NULL) { - if(strcasecmp(xvidenc_par, "pal43") == 0) + if(av_strcasecmp(xvidenc_par, "pal43") == 0) frame->par = XVID_PAR_43_PAL; - else if(strcasecmp(xvidenc_par, "pal169") == 0) + else if(av_strcasecmp(xvidenc_par, "pal169") == 0) frame->par = XVID_PAR_169_PAL; - else if(strcasecmp(xvidenc_par, "ntsc43") == 0) + else if(av_strcasecmp(xvidenc_par, "ntsc43") == 0) frame->par = XVID_PAR_43_NTSC; - else if(strcasecmp(xvidenc_par, "ntsc169") == 0) + else if(av_strcasecmp(xvidenc_par, "ntsc169") == 0) frame->par = XVID_PAR_169_NTSC; - else if(strcasecmp(xvidenc_par, "ext") == 0) + else if(av_strcasecmp(xvidenc_par, "ext") == 0) frame->par = XVID_PAR_EXT; if(frame->par == XVID_PAR_EXT) { Modified: trunk/libmpcodecs/vf_palette.c ============================================================================== --- trunk/libmpcodecs/vf_palette.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpcodecs/vf_palette.c Sat Jan 23 20:22:09 2021 (r38233) @@ -19,10 +19,10 @@ #include #include #include -#include #include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "help_mp.h" @@ -197,14 +197,14 @@ static int vf_open(vf_instance_t *vf, ch for(i=0;i<256;i++) gray_pal[i]=0x01010101*i; if (args) { - if (!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else - if (!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else - if (!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else - if (!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else - if (!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else - if (!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else - if (!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else - if (!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else + if (!av_strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else + if (!av_strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else + if (!av_strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else + if (!av_strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else + if (!av_strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else + if (!av_strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else + if (!av_strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else + if (!av_strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_UnknownFormatName, args); return 0; Modified: trunk/libmpcodecs/vf_zrmjpeg.c ============================================================================== --- trunk/libmpcodecs/vf_zrmjpeg.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpcodecs/vf_zrmjpeg.c Sat Jan 23 20:22:09 2021 (r38233) @@ -36,10 +36,10 @@ #include #include #include -#include #include #include "config.h" +#include "libavutil/avstring.h" #include "av_helpers.h" #include "mp_msg.h" #include "img_format.h" @@ -54,7 +54,7 @@ #undef malloc #undef free -#undef strcasecmp +#undef av_strcasecmp /* some convenient #define's, is this portable enough? */ /// Printout with vf_zrmjpeg: prefix at VERBOSE level @@ -993,35 +993,35 @@ static int vf_open(vf_instance_t *vf, ch VERBOSE( "setting vertical decimation to %d\n", priv->maxwidth); } - } else if (!strcasecmp("dc10+-PAL", ptr) || - !strcasecmp("dc10-PAL", ptr)) { + } else if (!av_strcasecmp("dc10+-PAL", ptr) || + !av_strcasecmp("dc10-PAL", ptr)) { priv->maxwidth = 768; priv->maxheight = 576; VERBOSE("setting DC10(+) PAL profile\n"); - } else if (!strcasecmp("fd", ptr)) { + } else if (!av_strcasecmp("fd", ptr)) { priv->fd = 1; VERBOSE("forcing decimation\n"); - } else if (!strcasecmp("nofd", ptr)) { + } else if (!av_strcasecmp("nofd", ptr)) { priv->fd = 0; VERBOSE("decimate only if beautiful\n"); - } else if (!strcasecmp("bw", ptr)) { + } else if (!av_strcasecmp("bw", ptr)) { priv->bw = 1; VERBOSE("setting black and white encoding\n"); - } else if (!strcasecmp("color", ptr)) { + } else if (!av_strcasecmp("color", ptr)) { priv->bw = 0; VERBOSE("setting color encoding\n"); - } else if (!strcasecmp("dc10+-NTSC", ptr) || - !strcasecmp("dc10-NTSC", ptr)) { + } else if (!av_strcasecmp("dc10+-NTSC", ptr) || + !av_strcasecmp("dc10-NTSC", ptr)) { priv->maxwidth = 640; priv->maxheight = 480; VERBOSE("setting DC10(+) NTSC profile\n"); - } else if (!strcasecmp("buz-PAL", ptr) || - !strcasecmp("lml33-PAL", ptr)) { + } else if (!av_strcasecmp("buz-PAL", ptr) || + !av_strcasecmp("lml33-PAL", ptr)) { priv->maxwidth = 720; priv->maxheight = 576; VERBOSE("setting buz/lml33 PAL profile\n"); - } else if (!strcasecmp("buz-NTSC", ptr) || - !strcasecmp("lml33-NTSC", ptr)) { + } else if (!av_strcasecmp("buz-NTSC", ptr) || + !av_strcasecmp("lml33-NTSC", ptr)) { priv->maxwidth = 720; priv->maxheight = 480; VERBOSE("setting buz/lml33 NTSC profile\n"); Modified: trunk/libmpdemux/demux_audio.c ============================================================================== --- trunk/libmpdemux/demux_audio.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpdemux/demux_audio.c Sat Jan 23 20:22:09 2021 (r38233) @@ -33,7 +33,6 @@ #include "libavutil/intreadwrite.h" #include -#include #define MP3 1 #define WAV 2 @@ -220,19 +219,19 @@ get_flac_metadata (demuxer_t* demuxer) c = comment[length]; comment[length] = 0; - if (!strncasecmp ("TITLE=", comment, 6) && (length - 6 > 0)) + if (!av_strncasecmp ("TITLE=", comment, 6) && (length - 6 > 0)) demux_info_add (demuxer, "Title", comment + 6); - else if (!strncasecmp ("ARTIST=", comment, 7) && (length - 7 > 0)) + else if (!av_strncasecmp ("ARTIST=", comment, 7) && (length - 7 > 0)) demux_info_add (demuxer, "Artist", comment + 7); - else if (!strncasecmp ("ALBUM=", comment, 6) && (length - 6 > 0)) + else if (!av_strncasecmp ("ALBUM=", comment, 6) && (length - 6 > 0)) demux_info_add (demuxer, "Album", comment + 6); - else if (!strncasecmp ("DATE=", comment, 5) && (length - 5 > 0)) + else if (!av_strncasecmp ("DATE=", comment, 5) && (length - 5 > 0)) demux_info_add (demuxer, "Year", comment + 5); - else if (!strncasecmp ("GENRE=", comment, 6) && (length - 6 > 0)) + else if (!av_strncasecmp ("GENRE=", comment, 6) && (length - 6 > 0)) demux_info_add (demuxer, "Genre", comment + 6); - else if (!strncasecmp ("Comment=", comment, 8) && (length - 8 > 0)) + else if (!av_strncasecmp ("Comment=", comment, 8) && (length - 8 > 0)) demux_info_add (demuxer, "Comment", comment + 8); - else if (!strncasecmp ("TRACKNUMBER=", comment, 12) + else if (!av_strncasecmp ("TRACKNUMBER=", comment, 12) && (length - 12 > 0)) { char buf[31]; Modified: trunk/libmpdemux/demux_mf.c ============================================================================== --- trunk/libmpdemux/demux_mf.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpdemux/demux_mf.c Sat Jan 23 20:22:09 2021 (r38233) @@ -19,13 +19,13 @@ #include #include #include -#include #include #include #include #include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "help_mp.h" @@ -151,7 +151,7 @@ static demuxer_t* demux_open_mf(demuxer_ demuxer->video->sh = sh_video; for (i = 0; type2format[i].type; i++) - if (strcasecmp(mf_type, type2format[i].type) == 0) + if (av_strcasecmp(mf_type, type2format[i].type) == 0) break; if (!type2format[i].type) { mp_msg(MSGT_DEMUX, MSGL_INFO, "[demux_mf] unknown input file type.\n" ); Modified: trunk/libmpdemux/demux_ogg.c ============================================================================== --- trunk/libmpdemux/demux_ogg.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpdemux/demux_ogg.c Sat Jan 23 20:22:09 2021 (r38233) @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include @@ -32,6 +31,7 @@ #include "stream/stream.h" #include "demuxer.h" #include "stheader.h" +#include "libavutil/avstring.h" #include "libavutil/intreadwrite.h" #include "aviprint.h" #include "demux_mov.h" @@ -355,11 +355,11 @@ static int demux_ogg_check_lang(const ch if (!langlist || !*langlist) return 0; while ((c = strchr(langlist, ','))) { - if (!strncasecmp(clang, langlist, c - langlist)) + if (!av_strncasecmp(clang, langlist, c - langlist)) return 1; langlist = &c[1]; } - if (!strncasecmp(clang, langlist, strlen(langlist))) + if (!av_strncasecmp(clang, langlist, strlen(langlist))) return 1; return 0; } @@ -420,7 +420,7 @@ static void demux_ogg_check_comments(dem while (*cmt) { hdr = NULL; - if (!strncasecmp(*cmt, "LANGUAGE=", 9)) { + if (!av_strncasecmp(*cmt, "LANGUAGE=", 9)) { val = *cmt + 9; if (ogg_d->subs[id].text) mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SID_%d_LANG=%s\n", @@ -459,7 +459,7 @@ static void demux_ogg_check_comments(dem } else { for (i = 0; table[i].ogg; i++) { - if (!strncasecmp(*cmt, table[i].ogg, strlen(table[i].ogg)) && + if (!av_strncasecmp(*cmt, table[i].ogg, strlen(table[i].ogg)) && (*cmt)[strlen(table[i].ogg)] == '=') { hdr = table[i].mp; val = *cmt + strlen(table[i].ogg) + 1; Modified: trunk/libmpdemux/demux_viv.c ============================================================================== --- trunk/libmpdemux/demux_viv.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpdemux/demux_viv.c Sat Jan 23 20:22:09 2021 (r38233) @@ -24,9 +24,9 @@ #include #include #include /* strtok */ -#include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "help_mp.h" @@ -672,9 +672,9 @@ if (demuxer->audio->id >= -1){ } if (vivo_param_acodec != NULL) { - if (!strcasecmp(vivo_param_acodec, "g723")) + if (!av_strcasecmp(vivo_param_acodec, "g723")) priv->audio_codec = VIVO_AUDIO_G723; - if (!strcasecmp(vivo_param_acodec, "siren")) + if (!av_strcasecmp(vivo_param_acodec, "siren")) priv->audio_codec = VIVO_AUDIO_SIREN; } Modified: trunk/libmpdemux/demuxer.c ============================================================================== --- trunk/libmpdemux/demuxer.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpdemux/demuxer.c Sat Jan 23 20:22:09 2021 (r38233) @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -1437,7 +1436,7 @@ int demux_info_add(demuxer_t *demuxer, c for (n = 0; info && info[2 * n] != NULL; n++) { - if (!strcasecmp(opt, info[2 * n])) { + if (!av_strcasecmp(opt, info[2 * n])) { if (!strcmp(param, info[2 * n + 1])) { mp_msg(MSGT_DEMUX, MSGL_V, "Demuxer info %s set to unchanged value %s\n", opt, param); return 0; @@ -1486,7 +1485,7 @@ char *demux_info_get(demuxer_t *demuxer, char **info = demuxer->info; for (i = 0; info && info[2 * i] != NULL; i++) { - if (!strcasecmp(opt, info[2 * i])) + if (!av_strcasecmp(opt, info[2 * i])) return info[2 * i + 1]; } Modified: trunk/libmpdemux/extension.c ============================================================================== --- trunk/libmpdemux/extension.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpdemux/extension.c Sat Jan 23 20:22:09 2021 (r38233) @@ -19,9 +19,9 @@ #include #include #include -#include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "stream/stream.h" #include "demuxer.h" @@ -101,7 +101,7 @@ int demuxer_type_by_filename(char* filen // mp_msg(MSGT_CPLAYER,MSGL_DBG2,"Extension: %s\n", extension ); // Look for the extension in the extensions table for( i=0 ; i<(sizeof(extensions_table)/sizeof(extensions_table[0])) ; i++ ) { - if( !strcasecmp(extension, extensions_table[i].extension) ) { + if( !av_strcasecmp(extension, extensions_table[i].extension) ) { mp_msg(MSGT_OPEN, MSGL_V, "Trying demuxer %d based on filename extension\n",extensions_table[i].demuxer_type); return extensions_table[i].demuxer_type; } Modified: trunk/libmpdemux/muxer_mpeg.c ============================================================================== --- trunk/libmpdemux/muxer_mpeg.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libmpdemux/muxer_mpeg.c Sat Jan 23 20:22:09 2021 (r38233) @@ -20,13 +20,13 @@ #include #include #include -#include #include #include "config.h" #include "mp_msg.h" #include "help_mp.h" +#include "libavutil/avstring.h" #include "libavutil/intreadwrite.h" #include "aviheader.h" #include "ms_hdr.h" @@ -2502,21 +2502,21 @@ int muxer_init_muxer_mpeg(muxer_t *muxer if(conf_mux != NULL) { - if(! strcasecmp(conf_mux, "mpeg1")) + if(! av_strcasecmp(conf_mux, "mpeg1")) { priv->mux = MUX_MPEG1; priv->packet_size = 2048; priv->is_genmpeg1 = 1; priv->muxrate = 1800 * 125; //Constrained parameters } - else if(! strcasecmp(conf_mux, "dvd")) + else if(! av_strcasecmp(conf_mux, "dvd")) { priv->mux = MUX_MPEG2; priv->is_dvd = 1; priv->packet_size = 2048; priv->muxrate = 10080 * 125; } - else if(! strcasecmp(conf_mux, "xsvcd")) + else if(! av_strcasecmp(conf_mux, "xsvcd")) { priv->mux = MUX_MPEG2; priv->is_xsvcd = 1; @@ -2524,7 +2524,7 @@ int muxer_init_muxer_mpeg(muxer_t *muxer priv->muxrate = 150*2324; priv->ts_allframes = 1; } - else if(! strcasecmp(conf_mux, "xvcd")) + else if(! av_strcasecmp(conf_mux, "xvcd")) { priv->mux = MUX_MPEG1; priv->is_xvcd = 1; @@ -2532,7 +2532,7 @@ int muxer_init_muxer_mpeg(muxer_t *muxer priv->muxrate = 75*2352; priv->ts_allframes = 1; } - else if(! strcasecmp(conf_mux, "pes1")) + else if(! av_strcasecmp(conf_mux, "pes1")) { priv->mux = MUX_MPEG1; priv->rawpes = 1; @@ -2540,7 +2540,7 @@ int muxer_init_muxer_mpeg(muxer_t *muxer priv->muxrate = 10080 * 125; priv->ts_allframes = 1; } - else if(! strcasecmp(conf_mux, "pes2")) + else if(! av_strcasecmp(conf_mux, "pes2")) { priv->mux = MUX_MPEG2; priv->rawpes = 1; @@ -2550,7 +2550,7 @@ int muxer_init_muxer_mpeg(muxer_t *muxer } else { - if(strcasecmp(conf_mux, "mpeg2")) + if(av_strcasecmp(conf_mux, "mpeg2")) mp_msg(MSGT_MUXER, MSGL_ERR, "Unknown format %s, default to mpeg2\n", conf_mux); priv->mux = MUX_MPEG2; priv->is_genmpeg2 = 1; Modified: trunk/libvo/vo_aa.c ============================================================================== --- trunk/libvo/vo_aa.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libvo/vo_aa.c Sat Jan 23 20:22:09 2021 (r38233) @@ -31,10 +31,10 @@ #include #include #include -#include #include #include "config.h" +#include "libavutil/avstring.h" #include "video_out.h" #include "video_out_internal.h" #include "libmpcodecs/vf.h" @@ -572,11 +572,11 @@ getcolor(char * s){ if (s==NULL) return -1; i=strtol(s, &rest, 10); if ((rest==NULL || strlen(rest)==0) && i>=0 && i<=5) return i; - if (!strcasecmp(s, "normal")) return AA_NORMAL; - else if (!strcasecmp(s, "dim")) return AA_DIM; - else if (!strcasecmp(s, "bold")) return AA_BOLD; - else if (!strcasecmp(s, "boldfont")) return AA_BOLDFONT; - else if (!strcasecmp(s, "special")) return AA_SPECIAL; + if (!av_strcasecmp(s, "normal")) return AA_NORMAL; + else if (!av_strcasecmp(s, "dim")) return AA_DIM; + else if (!av_strcasecmp(s, "bold")) return AA_BOLD; + else if (!av_strcasecmp(s, "boldfont")) return AA_BOLDFONT; + else if (!av_strcasecmp(s, "special")) return AA_SPECIAL; else return -1; } Modified: trunk/libvo/vo_dfbmga.c ============================================================================== --- trunk/libvo/vo_dfbmga.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libvo/vo_dfbmga.c Sat Jan 23 20:22:09 2021 (r38233) @@ -26,9 +26,9 @@ #include #include #include -#include #include "config.h" +#include "libavutil/avstring.h" #include "video_out.h" #define NO_DRAW_FRAME #include "video_out_internal.h" @@ -1339,19 +1339,19 @@ set_equalizer( const char *data, int val ca.flags = DCAF_NONE; - if (!strcasecmp( data, "brightness" )) { + if (!av_strcasecmp( data, "brightness" )) { ca.flags |= DCAF_BRIGHTNESS; ca.brightness = value * factor + 0x8000; } - if (!strcasecmp( data, "contrast" )) { + if (!av_strcasecmp( data, "contrast" )) { ca.flags |= DCAF_CONTRAST; ca.contrast = value * factor + 0x8000; } - if (!strcasecmp( data, "hue" )) { + if (!av_strcasecmp( data, "hue" )) { ca.flags |= DCAF_HUE; ca.hue = value * factor + 0x8000; } - if (!strcasecmp( data, "saturation" )) { + if (!av_strcasecmp( data, "saturation" )) { ca.flags |= DCAF_SATURATION; ca.saturation = value * factor + 0x8000; } @@ -1388,16 +1388,16 @@ get_equalizer( const char *data, int *va if (res != DFB_OK) return VO_FALSE; - if (!strcasecmp( data, "brightness" ) && + if (!av_strcasecmp( data, "brightness" ) && (ca.flags & DCAF_BRIGHTNESS)) *value = (ca.brightness - 0x8000) * factor; - if (!strcasecmp( data, "contrast" ) && + if (!av_strcasecmp( data, "contrast" ) && (ca.flags & DCAF_CONTRAST)) *value = (ca.contrast - 0x8000) * factor; - if (!strcasecmp( data, "hue" ) && + if (!av_strcasecmp( data, "hue" ) && (ca.flags & DCAF_HUE)) *value = (ca.hue - 0x8000) * factor; - if (!strcasecmp( data, "saturation" ) && + if (!av_strcasecmp( data, "saturation" ) && (ca.flags & DCAF_SATURATION)) *value = (ca.saturation - 0x8000) * factor; Modified: trunk/libvo/vo_dxr2.c ============================================================================== --- trunk/libvo/vo_dxr2.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libvo/vo_dxr2.c Sat Jan 23 20:22:09 2021 (r38233) @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -31,6 +30,7 @@ #include #include "config.h" +#include "libavutil/avstring.h" #include "aspect.h" #include "video_out.h" #define NO_DRAW_SLICE @@ -824,7 +824,7 @@ static int preinit(const char *arg) { const vo_info_t* vi = video_out_drivers[n]->info; if(!vi) continue; - if(strcasecmp(arg,vi->short_name) == 0) + if(av_strcasecmp(arg,vi->short_name) == 0) break; } sub_vo = video_out_drivers[n]; Modified: trunk/libvo/vo_dxr3.c ============================================================================== --- trunk/libvo/vo_dxr3.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libvo/vo_dxr3.c Sat Jan 23 20:22:09 2021 (r38233) @@ -29,13 +29,13 @@ #include #include #include -#include #include #include #include #include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "help_mp.h" #include "fastmemcpy.h" @@ -256,11 +256,11 @@ static int control(uint32_t request, voi if (ioctl(fd_control, EM8300_IOCTL_GETBCS, &bcs) < 0) return VO_FALSE; - if (!strcasecmp(eq->item, "brightness")) + if (!av_strcasecmp(eq->item, "brightness")) bcs.brightness = (eq->value+100)*5; - else if (!strcasecmp(eq->item, "contrast")) + else if (!av_strcasecmp(eq->item, "contrast")) bcs.contrast = (eq->value+100)*5; - else if (!strcasecmp(eq->item, "saturation")) + else if (!av_strcasecmp(eq->item, "saturation")) bcs.saturation = (eq->value+100)*5; else return VO_FALSE; @@ -276,11 +276,11 @@ static int control(uint32_t request, voi if (ioctl(fd_control, EM8300_IOCTL_GETBCS, &bcs) < 0) return VO_FALSE; - if (!strcasecmp(eq->item, "brightness")) + if (!av_strcasecmp(eq->item, "brightness")) eq->value = (bcs.brightness/5)-100; - else if (!strcasecmp(eq->item, "contrast")) + else if (!av_strcasecmp(eq->item, "contrast")) eq->value = (bcs.contrast/5)-100; - else if (!strcasecmp(eq->item, "saturation")) + else if (!av_strcasecmp(eq->item, "saturation")) eq->value = (bcs.saturation/5)-100; else return VO_FALSE; Modified: trunk/libvo/vo_matrixview.c ============================================================================== --- trunk/libvo/vo_matrixview.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libvo/vo_matrixview.c Sat Jan 23 20:22:09 2021 (r38233) @@ -25,7 +25,8 @@ #include "config.h" #include -#include + +#include "libavutil/avstring.h" #include "mp_msg.h" #include "subopt-helper.h" @@ -266,9 +267,9 @@ static int control(uint32_t request, voi { vf_equalizer_t *eq=data; - if (strcasecmp(eq->item, "contrast") == 0) { + if (av_strcasecmp(eq->item, "contrast") == 0) { eq->value = eq_contrast; - } else if (strcasecmp(eq->item, "brightness") == 0) { + } else if (av_strcasecmp(eq->item, "brightness") == 0) { eq->value = eq_brightness; } } @@ -276,9 +277,9 @@ static int control(uint32_t request, voi case VOCTRL_SET_EQUALIZER: { vf_equalizer_t *eq=data; - if (strcasecmp(eq->item, "contrast") == 0) { + if (av_strcasecmp(eq->item, "contrast") == 0) { contrast_set(eq->value); - } else if (strcasecmp(eq->item, "brightness") == 0) { + } else if (av_strcasecmp(eq->item, "brightness") == 0) { brightness_set(eq->value); } } Modified: trunk/libvo/vo_vdpau.c ============================================================================== --- trunk/libvo/vo_vdpau.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libvo/vo_vdpau.c Sat Jan 23 20:22:09 2021 (r38233) @@ -33,7 +33,6 @@ */ #include -#include #include #include "config.h" @@ -54,6 +53,7 @@ #include "libavcodec/vdpau.h" #include "libavutil/common.h" +#include "libavutil/avstring.h" #include "libavutil/mathematics.h" @@ -1386,13 +1386,13 @@ static int preinit(const char *arg) static int get_equalizer(const char *name, int *value) { - if (!strcasecmp(name, "brightness")) + if (!av_strcasecmp(name, "brightness")) *value = procamp.brightness * 100; - else if (!strcasecmp(name, "contrast")) + else if (!av_strcasecmp(name, "contrast")) *value = (procamp.contrast-1.0) * 100; - else if (!strcasecmp(name, "saturation")) + else if (!av_strcasecmp(name, "saturation")) *value = (procamp.saturation-1.0) * 100; - else if (!strcasecmp(name, "hue")) + else if (!av_strcasecmp(name, "hue")) *value = procamp.hue * 100 / M_PI; else return VO_NOTIMPL; @@ -1401,13 +1401,13 @@ static int get_equalizer(const char *nam static int set_equalizer(const char *name, int value) { - if (!strcasecmp(name, "brightness")) + if (!av_strcasecmp(name, "brightness")) procamp.brightness = value / 100.0; - else if (!strcasecmp(name, "contrast")) + else if (!av_strcasecmp(name, "contrast")) procamp.contrast = value / 100.0 + 1.0; - else if (!strcasecmp(name, "saturation")) + else if (!av_strcasecmp(name, "saturation")) procamp.saturation = value / 100.0 + 1.0; - else if (!strcasecmp(name, "hue")) + else if (!av_strcasecmp(name, "hue")) procamp.hue = value / 100.0 * M_PI; else return VO_NOTIMPL; Modified: trunk/libvo/vo_xvr100.c ============================================================================== --- trunk/libvo/vo_xvr100.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libvo/vo_xvr100.c Sat Jan 23 20:22:09 2021 (r38233) @@ -39,7 +39,6 @@ #include #include #include -#include #include #include "config.h" Modified: trunk/libvo/vo_zr.c ============================================================================== --- trunk/libvo/vo_zr.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libvo/vo_zr.c Sat Jan 23 20:22:09 2021 (r38233) @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -36,6 +35,7 @@ #include #include #include "config.h" +#include "libavutil/avstring.h" #include "videodev_mjpeg.h" #include "video_out.h" #include "video_out_internal.h" @@ -671,7 +671,7 @@ vo_zr_parseoption(const m_option_t* conf zr_info_t *zr = &zr_info[zr_parsing]; int i; /* do WE need it ?, always */ - if (!strcasecmp(opt, "zrdev")) { + if (!av_strcasecmp(opt, "zrdev")) { if (param == NULL) return ERR_MISSING_PARAM; //if ((i=getcolor(param))==-1) return ERR_OUT_OF_RANGE; //aaopt_osdcolor=i; @@ -680,19 +680,19 @@ vo_zr_parseoption(const m_option_t* conf strcpy(zr->device, param); mp_msg(MSGT_VO, MSGL_V, "zr: using device %s\n", zr->device); return 1; - } else if (!strcasecmp(opt, "zrbw")) { + } else if (!av_strcasecmp(opt, "zrbw")) { if (param != NULL) { return ERR_OUT_OF_RANGE; } zr->bw = 1; return 1; - } else if (!strcasecmp(opt, "zrfd")) { + } else if (!av_strcasecmp(opt, "zrfd")) { if (param != NULL) { return ERR_OUT_OF_RANGE; } zr->fd = 1; return 1; - } else if (!strcasecmp(opt, "zrcrop")){ + } else if (!av_strcasecmp(opt, "zrcrop")){ geo_t *g = &zr->g; if (g->set == 1) { zr_parsing++; @@ -716,43 +716,43 @@ vo_zr_parseoption(const m_option_t* conf g->set = 1; mp_msg(MSGT_VO, MSGL_V, "zr: cropping %s\n", param); return 1; - }else if (!strcasecmp(opt, "zrhdec")) { + }else if (!av_strcasecmp(opt, "zrhdec")) { i = atoi(param); if (i != 1 && i != 2 && i != 4) return ERR_OUT_OF_RANGE; zr->hdec = i; return 1; - }else if (!strcasecmp(opt, "zrvdec")) { + }else if (!av_strcasecmp(opt, "zrvdec")) { i = atoi(param); if (i != 1 && i != 2 && i != 4) return ERR_OUT_OF_RANGE; zr->vdec = i; return 1; - }else if (!strcasecmp(opt, "zrxdoff")) { + }else if (!av_strcasecmp(opt, "zrxdoff")) { i = atoi(param); zr->xdoff = i; return 1; - }else if (!strcasecmp(opt, "zrydoff")) { + }else if (!av_strcasecmp(opt, "zrydoff")) { i = atoi(param); zr->ydoff = i; return 1; - }else if (!strcasecmp(opt, "zrquality")) { + }else if (!av_strcasecmp(opt, "zrquality")) { i = atoi(param); if (i < 1 || i > 20) return ERR_OUT_OF_RANGE; zr->quality = i; return 1; - }else if (!strcasecmp(opt, "zrnorm")) { + }else if (!av_strcasecmp(opt, "zrnorm")) { if (param == NULL) return ERR_MISSING_PARAM; - if (!strcasecmp(param, "NTSC")) { + if (!av_strcasecmp(param, "NTSC")) { mp_msg(MSGT_VO, MSGL_V, "zr: Norm set to NTSC\n"); zr->norm = VIDEO_MODE_NTSC; return 1; - } else if (!strcasecmp(param, "PAL")) { + } else if (!av_strcasecmp(param, "PAL")) { mp_msg(MSGT_VO, MSGL_V, "zr: Norm set to PAL\n"); zr->norm = VIDEO_MODE_PAL; return 1; } else { return ERR_OUT_OF_RANGE; } - }else if (!strcasecmp(opt, "zrhelp")){ + }else if (!av_strcasecmp(opt, "zrhelp")){ printf("Help for -vo zr: Zoran ZR360[56]7/ZR36060 based MJPEG capture/playback cards\n"); printf("\n"); printf("Here are the zr options:\n"); @@ -798,26 +798,26 @@ void vo_zr_revertoption(const m_option_t zr_count = 1; zr_parsing = 0; - if (!strcasecmp(param, "zrdev")) { + if (!av_strcasecmp(param, "zrdev")) { free(zr->device); zr->device=NULL; - } else if (!strcasecmp(param, "zrbw")) + } else if (!av_strcasecmp(param, "zrbw")) zr->bw=0; - else if (!strcasecmp(param, "zrfd")) + else if (!av_strcasecmp(param, "zrfd")) zr->fd=0; - else if (!strcasecmp(param, "zrcrop")) + else if (!av_strcasecmp(param, "zrcrop")) zr->g.set = zr->g.xoff = zr->g.yoff = 0; - else if (!strcasecmp(param, "zrhdec")) + else if (!av_strcasecmp(param, "zrhdec")) zr->hdec = 1; - else if (!strcasecmp(param, "zrvdec")) + else if (!av_strcasecmp(param, "zrvdec")) zr->vdec = 1; - else if (!strcasecmp(param, "zrxdoff")) + else if (!av_strcasecmp(param, "zrxdoff")) zr->xdoff = -1; - else if (!strcasecmp(param, "zrydoff")) + else if (!av_strcasecmp(param, "zrydoff")) zr->ydoff = -1; - else if (!strcasecmp(param, "zrquality")) + else if (!av_strcasecmp(param, "zrquality")) zr->quality = 2; - else if (!strcasecmp(param, "zrnorm")) + else if (!av_strcasecmp(param, "zrnorm")) zr->norm = VIDEO_MODE_AUTO; } Modified: trunk/libvo/vosub_vidix.c ============================================================================== --- trunk/libvo/vosub_vidix.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libvo/vosub_vidix.c Sat Jan 23 20:22:09 2021 (r38233) @@ -32,10 +32,10 @@ #include #include #include -#include #include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "help_mp.h" @@ -599,22 +599,22 @@ uint32_t vidix_control(uint32_t request, // printf("vidix seteq %s -> %d \n",eq->item,eq->value); /* vidix eq ranges are -1000..1000 */ - if (!strcasecmp(eq->item, "brightness")) + if (!av_strcasecmp(eq->item, "brightness")) { info.brightness = eq->value*10; info.cap = VEQ_CAP_BRIGHTNESS; } - else if (!strcasecmp(eq->item, "contrast")) + else if (!av_strcasecmp(eq->item, "contrast")) { info.contrast = eq->value*10; info.cap = VEQ_CAP_CONTRAST; } - else if (!strcasecmp(eq->item, "saturation")) + else if (!av_strcasecmp(eq->item, "saturation")) { info.saturation = eq->value*10; info.cap = VEQ_CAP_SATURATION; } - else if (!strcasecmp(eq->item, "hue")) + else if (!av_strcasecmp(eq->item, "hue")) { info.hue = eq->value*10; info.cap = VEQ_CAP_HUE; @@ -634,22 +634,22 @@ uint32_t vidix_control(uint32_t request, return VO_FALSE; /* vidix eq ranges are -1000..1000 */ - if (!strcasecmp(eq->item, "brightness")) + if (!av_strcasecmp(eq->item, "brightness")) { if (info.cap & VEQ_CAP_BRIGHTNESS) eq->value = info.brightness/10; } - else if (!strcasecmp(eq->item, "contrast")) + else if (!av_strcasecmp(eq->item, "contrast")) { if (info.cap & VEQ_CAP_CONTRAST) eq->value = info.contrast/10; } - else if (!strcasecmp(eq->item, "saturation")) + else if (!av_strcasecmp(eq->item, "saturation")) { if (info.cap & VEQ_CAP_SATURATION) eq->value = info.saturation/10; } - else if (!strcasecmp(eq->item, "hue")) + else if (!av_strcasecmp(eq->item, "hue")) { if (info.cap & VEQ_CAP_HUE) eq->value = info.hue/10; Modified: trunk/libvo/x11_common.c ============================================================================== --- trunk/libvo/x11_common.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/libvo/x11_common.c Sat Jan 23 20:22:09 2021 (r38233) @@ -27,10 +27,10 @@ #include "mp_msg.h" #include "mp_fifo.h" #include "libavutil/common.h" +#include "libavutil/avstring.h" #include "x11_common.h" #include -#include #include #include @@ -1903,11 +1903,11 @@ uint32_t vo_x11_set_equalizer(const char if (cmap == None) return VO_NOTAVAIL; - if (!strcasecmp(name, "brightness")) + if (!av_strcasecmp(name, "brightness")) vo_brightness = value; - else if (!strcasecmp(name, "contrast")) + else if (!av_strcasecmp(name, "contrast")) vo_contrast = value; - else if (!strcasecmp(name, "gamma")) + else if (!av_strcasecmp(name, "gamma")) vo_gamma = value; else return VO_NOTIMPL; @@ -1938,11 +1938,11 @@ uint32_t vo_x11_get_equalizer(const char { if (cmap == None) return VO_NOTAVAIL; - if (!strcasecmp(name, "brightness")) + if (!av_strcasecmp(name, "brightness")) *value = vo_brightness; - else if (!strcasecmp(name, "contrast")) + else if (!av_strcasecmp(name, "contrast")) *value = vo_contrast; - else if (!strcasecmp(name, "gamma")) + else if (!av_strcasecmp(name, "gamma")) *value = vo_gamma; else return VO_NOTIMPL; @@ -1970,29 +1970,29 @@ int vo_xv_set_eq(uint32_t xv_port, const int hue = 0, port_value, port_min, port_max; if (!strcmp(attributes[i].name, "XV_BRIGHTNESS") && - (!strcasecmp(name, "brightness"))) + (!av_strcasecmp(name, "brightness"))) port_value = value; else if (!strcmp(attributes[i].name, "XV_CONTRAST") && - (!strcasecmp(name, "contrast"))) + (!av_strcasecmp(name, "contrast"))) port_value = value; else if (!strcmp(attributes[i].name, "XV_SATURATION") && - (!strcasecmp(name, "saturation"))) + (!av_strcasecmp(name, "saturation"))) port_value = value; else if (!strcmp(attributes[i].name, "XV_HUE") && - (!strcasecmp(name, "hue"))) + (!av_strcasecmp(name, "hue"))) { port_value = value; hue = 1; } else /* Note: since 22.01.2002 GATOS supports these attrs for radeons (NK) */ if (!strcmp(attributes[i].name, "XV_RED_INTENSITY") && - (!strcasecmp(name, "red_intensity"))) + (!av_strcasecmp(name, "red_intensity"))) port_value = value; else if (!strcmp(attributes[i].name, "XV_GREEN_INTENSITY") - && (!strcasecmp(name, "green_intensity"))) + && (!av_strcasecmp(name, "green_intensity"))) port_value = value; else if (!strcmp(attributes[i].name, "XV_BLUE_INTENSITY") - && (!strcasecmp(name, "blue_intensity"))) + && (!av_strcasecmp(name, "blue_intensity"))) port_value = value; else continue; @@ -2048,16 +2048,16 @@ int vo_xv_get_eq(uint32_t xv_port, const 100; if (!strcmp(attributes[i].name, "XV_BRIGHTNESS") && - (!strcasecmp(name, "brightness"))) + (!av_strcasecmp(name, "brightness"))) *value = val; else if (!strcmp(attributes[i].name, "XV_CONTRAST") && - (!strcasecmp(name, "contrast"))) + (!av_strcasecmp(name, "contrast"))) *value = val; else if (!strcmp(attributes[i].name, "XV_SATURATION") && - (!strcasecmp(name, "saturation"))) + (!av_strcasecmp(name, "saturation"))) *value = val; else if (!strcmp(attributes[i].name, "XV_HUE") && - (!strcasecmp(name, "hue"))) + (!av_strcasecmp(name, "hue"))) { /* nasty nvidia detect */ if (port_min == 0 && port_max == 360) @@ -2067,13 +2067,13 @@ int vo_xv_get_eq(uint32_t xv_port, const } else /* Note: since 22.01.2002 GATOS supports these attrs for radeons (NK) */ if (!strcmp(attributes[i].name, "XV_RED_INTENSITY") && - (!strcasecmp(name, "red_intensity"))) + (!av_strcasecmp(name, "red_intensity"))) *value = val; else if (!strcmp(attributes[i].name, "XV_GREEN_INTENSITY") - && (!strcasecmp(name, "green_intensity"))) + && (!av_strcasecmp(name, "green_intensity"))) *value = val; else if (!strcmp(attributes[i].name, "XV_BLUE_INTENSITY") - && (!strcasecmp(name, "blue_intensity"))) + && (!av_strcasecmp(name, "blue_intensity"))) *value = val; else continue; Modified: trunk/loader/dshow/DS_VideoDecoder.c ============================================================================== --- trunk/loader/dshow/DS_VideoDecoder.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/loader/dshow/DS_VideoDecoder.c Sat Jan 23 20:22:09 2021 (r38233) @@ -5,6 +5,7 @@ *********************************************************/ #include "config.h" +#include "libavutil/avstring.h" #include "guids.h" #include "interfaces.h" #include "loader/registry.h" @@ -44,7 +45,6 @@ static SampleProcUserData sampleProcData #endif #include #include // labs -#include // strcmp((const char*)info.dll,...) is used instead of (... == ...) // so Arpi could use char* pointer in his simplified DS_VideoDecoder class @@ -762,15 +762,15 @@ int DS_VideoDecoder_SetValue(DS_VideoDec printf("No such interface\n"); return -1; } - if (strcasecmp(name, "Postprocessing") == 0) + if (av_strcasecmp(name, "Postprocessing") == 0) pIDivx->vt->put_PPLevel(pIDivx, value * 10); - else if (strcasecmp(name, "Brightness") == 0) + else if (av_strcasecmp(name, "Brightness") == 0) pIDivx->vt->put_Brightness(pIDivx, value); - else if (strcasecmp(name, "Contrast") == 0) + else if (av_strcasecmp(name, "Contrast") == 0) pIDivx->vt->put_Contrast(pIDivx, value); - else if (strcasecmp(name, "Saturation") == 0) + else if (av_strcasecmp(name, "Saturation") == 0) pIDivx->vt->put_Saturation(pIDivx, value); - else if (strcasecmp(name, "MaxAuto") == 0) + else if (av_strcasecmp(name, "MaxAuto") == 0) this->m_iMaxAuto = value; pIDivx->vt->Release((IUnknown*)pIDivx); //printf("Set %s %d\n", name, value); @@ -796,20 +796,20 @@ int DS_VideoDecoder_SetValue(DS_VideoDec // get6=set5 23 hidden = (IHidden*)((int)this->m_pDS_Filter->m_pFilter + 0xb8); //printf("DS_SetValue for DIVX, name=%s value=%d\n",name,value); - if (strcasecmp(name, "Quality") == 0) + if (av_strcasecmp(name, "Quality") == 0) { this->m_iLastQuality = value; return hidden->vt->SetSmth(hidden, value, 0); } - if (strcasecmp(name, "Brightness") == 0) + if (av_strcasecmp(name, "Brightness") == 0) return hidden->vt->SetSmth2(hidden, value, 0); - if (strcasecmp(name, "Contrast") == 0) + if (av_strcasecmp(name, "Contrast") == 0) return hidden->vt->SetSmth3(hidden, value, 0); - if (strcasecmp(name, "Saturation") == 0) + if (av_strcasecmp(name, "Saturation") == 0) return hidden->vt->SetSmth4(hidden, value, 0); - if (strcasecmp(name, "Hue") == 0) + if (av_strcasecmp(name, "Hue") == 0) return hidden->vt->SetSmth5(hidden, value, 0); - if (strcasecmp(name, "MaxAuto") == 0) + if (av_strcasecmp(name, "MaxAuto") == 0) { this->m_iMaxAuto = value; } @@ -863,7 +863,7 @@ int DS_VideoDecoder_SetValue(DS_VideoDec int DS_SetAttr_DivX(char* attribute, int value){ int result, status, newkey; - if(strcasecmp(attribute, "Quality")==0){ + if(av_strcasecmp(attribute, "Quality")==0){ char* keyname="SOFTWARE\\Microsoft\\Scrunch"; result=RegCreateKeyExA(HKEY_CURRENT_USER, keyname, 0, 0, 0, 0, 0, &newkey, &status); if(result!=0) @@ -889,10 +889,10 @@ int DS_SetAttr_DivX(char* attribute, int } if( - (strcasecmp(attribute, "Saturation")==0) || - (strcasecmp(attribute, "Hue")==0) || - (strcasecmp(attribute, "Contrast")==0) || - (strcasecmp(attribute, "Brightness")==0) + (av_strcasecmp(attribute, "Saturation")==0) || + (av_strcasecmp(attribute, "Hue")==0) || + (av_strcasecmp(attribute, "Contrast")==0) || + (av_strcasecmp(attribute, "Brightness")==0) ) { char* keyname="SOFTWARE\\Microsoft\\Scrunch\\Video"; Modified: trunk/loader/ext.c ============================================================================== --- trunk/loader/ext.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/loader/ext.c Sat Jan 23 20:22:09 2021 (r38233) @@ -23,10 +23,10 @@ #include #include #include -#include #include #include +#include "libavutil/avstring.h" #include "osdep/mmap_anon.h" #include "wine/windef.h" #include "wine/winbase.h" @@ -120,7 +120,7 @@ WIN_BOOL WINAPI ReadFile(HANDLE handle, } INT WINAPI lstrcmpiA(LPCSTR c1, LPCSTR c2) { - return strcasecmp(c1,c2); + return av_strcasecmp(c1,c2); } LPSTR WINAPI lstrcpynA(LPSTR dest, LPCSTR src, INT num) { Modified: trunk/loader/win32.c ============================================================================== --- trunk/loader/win32.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/loader/win32.c Sat Jan 23 20:22:09 2021 (r38233) @@ -55,7 +55,6 @@ for DLL to know too much about its envir #include "path.h" #include -#include #include #include #include @@ -587,10 +586,10 @@ static HMODULE WINAPI expGetModuleHandle } if(!result) { - if(name && (strcasecmp(name, "kernel32")==0 || !strcasecmp(name, "kernel32.dll"))) + if(name && (av_strcasecmp(name, "kernel32")==0 || !av_strcasecmp(name, "kernel32.dll"))) result=MODULE_HANDLE_kernel32; #ifdef CONFIG_QTX_CODECS - if(name && strcasecmp(name, "user32")==0) + if(name && av_strcasecmp(name, "user32")==0) result=MODULE_HANDLE_user32; #endif } @@ -2147,7 +2146,7 @@ static double linux_cpuinfo_freq(void) if ((s=strchr(value,'\n'))) *s='\0'; - if (!strncasecmp(line, "cpu MHz",strlen("cpu MHz")) + if (!av_strncasecmp(line, "cpu MHz",strlen("cpu MHz")) && sscanf(value, "%lf", &freq) == 1) { freq*=1000; break; @@ -2532,33 +2531,33 @@ static int WINAPI expLoadLibraryA(char* dbgprintf("Entering LoadLibraryA(%s)\n", name); // PIMJ and VIVO audio are loading kernel32.dll - if (strcasecmp(name, "kernel32.dll") == 0 || strcasecmp(name, "kernel32") == 0) + if (av_strcasecmp(name, "kernel32.dll") == 0 || av_strcasecmp(name, "kernel32") == 0) return MODULE_HANDLE_kernel32; // return ERROR_SUCCESS; /* yeah, we have also the kernel32 calls */ /* exported -> do not return failed! */ - if (strcasecmp(name, "user32.dll") == 0 || strcasecmp(name, "user32") == 0) + if (av_strcasecmp(name, "user32.dll") == 0 || av_strcasecmp(name, "user32") == 0) // return MODULE_HANDLE_kernel32; return MODULE_HANDLE_user32; #ifdef CONFIG_QTX_CODECS - if (strcasecmp(name, "wininet.dll") == 0 || strcasecmp(name, "wininet") == 0) + if (av_strcasecmp(name, "wininet.dll") == 0 || av_strcasecmp(name, "wininet") == 0) return MODULE_HANDLE_wininet; - if (strcasecmp(name, "ddraw.dll") == 0 || strcasecmp(name, "ddraw") == 0) + if (av_strcasecmp(name, "ddraw.dll") == 0 || av_strcasecmp(name, "ddraw") == 0) return MODULE_HANDLE_ddraw; - if (strcasecmp(name, "advapi32.dll") == 0 || strcasecmp(name, "advapi32") == 0) + if (av_strcasecmp(name, "advapi32.dll") == 0 || av_strcasecmp(name, "advapi32") == 0) return MODULE_HANDLE_advapi32; #endif - if (strcasecmp(name, "comdlg32.dll") == 0 || strcasecmp(name, "comdlg32") == 0) + if (av_strcasecmp(name, "comdlg32.dll") == 0 || av_strcasecmp(name, "comdlg32") == 0) return MODULE_HANDLE_comdlg32; - if (strcasecmp(name, "msvcrt.dll") == 0 || strcasecmp(name, "msvcrt") == 0) + if (av_strcasecmp(name, "msvcrt.dll") == 0 || av_strcasecmp(name, "msvcrt") == 0) return MODULE_HANDLE_msvcrt; - if (strcasecmp(name, "ole32.dll") == 0 || strcasecmp(name, "ole32") == 0) + if (av_strcasecmp(name, "ole32.dll") == 0 || av_strcasecmp(name, "ole32") == 0) return MODULE_HANDLE_ole32; - if (strcasecmp(name, "winmm.dll") == 0 || strcasecmp(name, "winmm") == 0) + if (av_strcasecmp(name, "winmm.dll") == 0 || av_strcasecmp(name, "winmm") == 0) return MODULE_HANDLE_winmm; - if (strcasecmp(name, "psapi.dll") == 0 || strcasecmp(name, "psapi") == 0) + if (av_strcasecmp(name, "psapi.dll") == 0 || av_strcasecmp(name, "psapi") == 0) return MODULE_HANDLE_psapi; result=LoadLibraryA(name); @@ -3955,7 +3954,7 @@ static int WINAPI expMulDiv(int nNumber, static LONG WINAPI explstrcmpiA(const char* str1, const char* str2) { - LONG result=strcasecmp(str1, str2); + LONG result=av_strcasecmp(str1, str2); dbgprintf("strcmpi(0x%x='%s', 0x%x='%s') => %d\n", str1, str1, str2, str2, result); return result; } @@ -4615,7 +4614,7 @@ static char *exp_mbsupr(char *str) static int exp_stricmp(const char* s1, const char* s2) { - return strcasecmp(s1, s2); + return av_strcasecmp(s1, s2); } static uint64_t exp_time64(void) @@ -5748,7 +5747,7 @@ void* LookupExternal(const char* library for(i=0; i #include "windef.h" @@ -10,6 +9,6 @@ LPSTR WINAPI lstrcpyWtoA(LPSTR,LPC LPWSTR WINAPI lstrcpynAtoW(LPWSTR,LPCSTR,INT); LPSTR WINAPI lstrcpynWtoA(LPSTR,LPCWSTR,INT); -#define lstrncmpiA strncasecmp +#define lstrncmpiA av_strncasecmp #endif /* MPLAYER_WINESTRING_H */ Modified: trunk/m_config.c ============================================================================== --- trunk/m_config.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/m_config.c Sat Jan 23 20:22:09 2021 (r38233) @@ -25,11 +25,11 @@ #include #include #include -#include #ifdef MP_DEBUG #include #endif +#include "libavutil/avstring.h" #include "m_config.h" #include "m_option.h" #include "mp_msg.h" @@ -390,9 +390,9 @@ m_config_get_co(const m_config_t *config int l = strlen(co->name) - 1; if((co->opt->type->flags & M_OPT_TYPE_ALLOW_WILDCARD) && (co->name[l] == '*')) { - if(strncasecmp(co->name,arg,l) == 0) + if(av_strncasecmp(co->name,arg,l) == 0) return co; - } else if(strcasecmp(co->name,arg) == 0) + } else if(av_strcasecmp(co->name,arg) == 0) return co; } return NULL; Modified: trunk/m_option.c ============================================================================== --- trunk/m_option.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/m_option.c Sat Jan 23 20:22:09 2021 (r38233) @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -50,9 +49,9 @@ const m_option_t* m_option_list_find(con int l = strlen(list[i].name) - 1; if((list[i].type->flags & M_OPT_TYPE_ALLOW_WILDCARD) && (l > 0) && (list[i].name[l] == '*')) { - if(strncasecmp(list[i].name,name,l) == 0) + if(av_strncasecmp(list[i].name,name,l) == 0) return &list[i]; - } else if(strcasecmp(list[i].name,name) == 0) + } else if(av_strcasecmp(list[i].name,name) == 0) return &list[i]; } return NULL; @@ -99,28 +98,28 @@ static char* dup_printf(const char *fmt, static int parse_flag(const m_option_t* opt,const char *name, const char *param, void* dst, int src) { if (src == M_CONFIG_FILE) { if(!param) return M_OPT_MISSING_PARAM; - if (!strcasecmp(param, "yes") || /* any other language? */ - !strcasecmp(param, "on") || - !strcasecmp(param, "ja") || - !strcasecmp(param, "si") || - !strcasecmp(param, "igen") || - !strcasecmp(param, "y") || - !strcasecmp(param, "j") || - !strcasecmp(param, "i") || - !strcasecmp(param, "tak") || - !strcasecmp(param, "ja") || - !strcasecmp(param, "true") || + if (!av_strcasecmp(param, "yes") || /* any other language? */ + !av_strcasecmp(param, "on") || + !av_strcasecmp(param, "ja") || + !av_strcasecmp(param, "si") || + !av_strcasecmp(param, "igen") || + !av_strcasecmp(param, "y") || + !av_strcasecmp(param, "j") || + !av_strcasecmp(param, "i") || + !av_strcasecmp(param, "tak") || + !av_strcasecmp(param, "ja") || + !av_strcasecmp(param, "true") || !strcmp(param, "1")) { if(dst) VAL(dst) = opt->max; - } else if (!strcasecmp(param, "no") || - !strcasecmp(param, "off") || - !strcasecmp(param, "nein") || - !strcasecmp(param, "nicht") || - !strcasecmp(param, "nem") || - !strcasecmp(param, "n") || - !strcasecmp(param, "nie") || - !strcasecmp(param, "nej") || - !strcasecmp(param, "false") || + } else if (!av_strcasecmp(param, "no") || + !av_strcasecmp(param, "off") || + !av_strcasecmp(param, "nein") || + !av_strcasecmp(param, "nicht") || + !av_strcasecmp(param, "nem") || + !av_strcasecmp(param, "n") || + !av_strcasecmp(param, "nie") || + !av_strcasecmp(param, "nej") || + !av_strcasecmp(param, "false") || !strcmp(param, "0")) { if(dst) VAL(dst) = opt->min; } else { @@ -569,13 +568,13 @@ static int parse_str_list(const m_option if(opt->name[len-1] == '*' && ((int)strlen(name) > len - 1)) { const char* n = &name[len-1]; - if(strcasecmp(n,"-add") == 0) + if(av_strcasecmp(n,"-add") == 0) op = OP_ADD; - else if(strcasecmp(n,"-pre") == 0) + else if(av_strcasecmp(n,"-pre") == 0) op = OP_PRE; - else if(strcasecmp(n,"-del") == 0) + else if(av_strcasecmp(n,"-del") == 0) op = OP_DEL; - else if(strcasecmp(n,"-clr") == 0) + else if(av_strcasecmp(n,"-clr") == 0) op = OP_CLR; else return M_OPT_UNKNOWN; @@ -1196,7 +1195,7 @@ static int parse_imgfmt(const m_option_t if (sscanf(param, "0x%x", &fmt) != 1) { for(i = 0 ; mp_imgfmt_list[i].name ; i++) { - if(!strcasecmp(param,mp_imgfmt_list[i].name)) { + if(!av_strcasecmp(param,mp_imgfmt_list[i].name)) { fmt=mp_imgfmt_list[i].fmt; break; } @@ -1286,7 +1285,7 @@ static int parse_afmt(const m_option_t* if (sscanf(param, "0x%x", &fmt) != 1) { for(i = 0 ; mp_afmt_list[i].name ; i++) { - if(!strcasecmp(param,mp_afmt_list[i].name)) { + if(!av_strcasecmp(param,mp_afmt_list[i].name)) { fmt=mp_afmt_list[i].fmt; break; } @@ -1328,7 +1327,7 @@ int parse_timestring(const char *str, do *time = 60*a + d; else if (sscanf(str, "%lf%n", &d, &len) >= 1) *time = d; - else if (strncasecmp(str, "nopts", 5) == 0) { + else if (av_strncasecmp(str, "nopts", 5) == 0) { *time = MP_NOPTS_VALUE; len = 5; } else @@ -1385,13 +1384,13 @@ static int parse_time_size(const m_optio /* End at size parsing */ if(sscanf(param, "%lf%3s", &end_at, unit) == 2) { ts.type = END_AT_SIZE; - if(!strcasecmp(unit, "b")) + if(!av_strcasecmp(unit, "b")) ; - else if(!strcasecmp(unit, "kb")) + else if(!av_strcasecmp(unit, "kb")) end_at *= 1024; - else if(!strcasecmp(unit, "mb")) + else if(!av_strcasecmp(unit, "mb")) end_at *= 1024*1024; - else if(!strcasecmp(unit, "gb")) + else if(!av_strcasecmp(unit, "gb")) end_at *= 1024*1024*1024; else ts.type = END_AT_NONE; @@ -1805,13 +1804,13 @@ static int parse_obj_settings_list(const if(opt->name[len-1] == '*' && ((int)strlen(name) > len - 1)) { const char* n = &name[len-1]; - if(strcasecmp(n,"-add") == 0) + if(av_strcasecmp(n,"-add") == 0) op = OP_ADD; - else if(strcasecmp(n,"-pre") == 0) + else if(av_strcasecmp(n,"-pre") == 0) op = OP_PRE; - else if(strcasecmp(n,"-del") == 0) + else if(av_strcasecmp(n,"-del") == 0) op = OP_DEL; - else if(strcasecmp(n,"-clr") == 0) + else if(av_strcasecmp(n,"-clr") == 0) op = OP_CLR; else { char prefix[len]; Modified: trunk/m_struct.c ============================================================================== --- trunk/m_struct.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/m_struct.c Sat Jan 23 20:22:09 2021 (r38233) @@ -23,8 +23,8 @@ #include #include -#include +#include "libavutil/avstring.h" #include "m_option.h" #include "m_struct.h" #include "mp_msg.h" @@ -34,7 +34,7 @@ m_struct_get_field(const m_struct_t* st, int i; for(i = 0 ; st->fields[i].name ; i++) { - if(strcasecmp(st->fields[i].name,f) == 0) + if(av_strcasecmp(st->fields[i].name,f) == 0) return &st->fields[i]; } return NULL; Modified: trunk/mencoder.c ============================================================================== --- trunk/mencoder.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/mencoder.c Sat Jan 23 20:22:09 2021 (r38233) @@ -50,12 +50,12 @@ #include #include #include -#include #include #if defined(__MINGW32__) || defined(__CYGWIN__) #include #endif +#include "libavutil/avstring.h" #include "input/input.h" #include "libaf/af_format.h" #include "libao2/audio_out.h" @@ -616,14 +616,14 @@ user_correct_pts = 0; switch (out_file_format) { case MUXER_TYPE_AVI: - if (strcasecmp(extension,"avi")) + if (av_strcasecmp(extension,"avi")) mp_msg(MSGT_MENCODER, MSGL_WARN, MSGTR_MencoderWrongFormatAVI); break; case MUXER_TYPE_MPEG: - if (strcasecmp(extension,"mpg") && - strcasecmp(extension,"mpeg") && - strcasecmp(extension,"vob")) + if (av_strcasecmp(extension,"mpg") && + av_strcasecmp(extension,"mpeg") && + av_strcasecmp(extension,"vob")) mp_msg(MSGT_MENCODER, MSGL_WARN, MSGTR_MencoderWrongFormatMPG); break; } Modified: trunk/mp_msg.c ============================================================================== --- trunk/mp_msg.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/mp_msg.c Sat Jan 23 20:22:09 2021 (r38233) @@ -20,9 +20,9 @@ #include #include #include -#include #include "config.h" +#include "libavutil/avstring.h" #include "osdep/getch2.h" #ifdef CONFIG_ICONV @@ -59,8 +59,8 @@ const char* filename_recode(const char* size_t filename_len, max_path; char* precoded; if (!mp_msg_charset || - !strcasecmp(mp_msg_charset, MSG_CHARSET) || - !strcasecmp(mp_msg_charset, "noconv")) + !av_strcasecmp(mp_msg_charset, MSG_CHARSET) || + !av_strcasecmp(mp_msg_charset, "noconv")) return filename; if (inv_msgiconv == (iconv_t)(-1)) { inv_msgiconv = iconv_open(MSG_CHARSET, mp_msg_charset); @@ -216,7 +216,7 @@ void mp_msg_va(int mod, int lev, const c tmp[MSGSIZE_MAX-1] = 0; #if defined(CONFIG_ICONV) && defined(MSG_CHARSET) - if (mp_msg_charset && strcasecmp(mp_msg_charset, "noconv")) { + if (mp_msg_charset && av_strcasecmp(mp_msg_charset, "noconv")) { char tmp2[MSGSIZE_MAX]; size_t inlen = strlen(tmp), outlen = MSGSIZE_MAX; char *in = tmp, *out = tmp2; Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/mplayer.c Sat Jan 23 20:22:09 2021 (r38233) @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -429,7 +428,7 @@ static char *get_demuxer_info(char *tag) return NULL; for (n = 0; info[2 * n] != NULL; n++) - if (!strcasecmp(info[2 * n], tag)) + if (!av_strcasecmp(info[2 * n], tag)) break; return info[2 * n + 1] ? strdup(info[2 * n + 1]) : NULL; Modified: trunk/osdep/priority.c ============================================================================== --- trunk/osdep/priority.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/osdep/priority.c Sat Jan 23 20:22:09 2021 (r38233) @@ -26,8 +26,8 @@ #include #endif #include -#include +#include "libavutil/avstring.h" #include "mp_msg.h" #include "help_mp.h" @@ -58,7 +58,7 @@ void set_priority(void) int i; for (i = 0; priority_presets_defs[i].name; i++) { - if (strcasecmp(priority_presets_defs[i].name, proc_priority) == 0) + if (av_strcasecmp(priority_presets_defs[i].name, proc_priority) == 0) break; } mp_msg(MSGT_CPLAYER, MSGL_STATUS, MSGTR_SettingProcessPriority, Modified: trunk/parser-mpcmd.c ============================================================================== --- trunk/parser-mpcmd.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/parser-mpcmd.c Sat Jan 23 20:22:09 2021 (r38233) @@ -24,13 +24,14 @@ #include #include #include -#include #include #ifdef MP_DEBUG #include #endif +#include "libavutil/avstring.h" + #include "mp_msg.h" #include "help_mp.h" #include "m_option.h" @@ -56,7 +57,7 @@ static int is_entry_option(char *opt, ch *ret = NULL; - if(strcasecmp(opt,"playlist") == 0) { // We handle playlist here + if(av_strcasecmp(opt,"playlist") == 0) { // We handle playlist here if(!param) return M_OPT_MISSING_PARAM; @@ -159,7 +160,7 @@ m_config_parse_mp_command_line(m_config_ mp_msg(MSGT_CFGPARSER, MSGL_DBG3, "this_opt = option: %s\n", opt); // We handle here some specific option // Loop option when it apply to a group - if(strcasecmp(opt,"loop") == 0 && + if(av_strcasecmp(opt,"loop") == 0 && (! last_entry || last_entry->child) ) { int l; char* end = NULL; @@ -173,12 +174,12 @@ m_config_parse_mp_command_line(m_config_ pt->loop = l; tmp = 1; } - } else if(strcasecmp(opt,"shuffle") == 0) { + } else if(av_strcasecmp(opt,"shuffle") == 0) { if(last_entry && last_entry->child) last_entry->flags |= PLAY_TREE_RND; else last_parent->flags |= PLAY_TREE_RND; - } else if(strcasecmp(opt,"noshuffle") == 0) { + } else if(av_strcasecmp(opt,"noshuffle") == 0) { if(last_entry && last_entry->child) last_entry->flags &= ~PLAY_TREE_RND; else @@ -269,7 +270,7 @@ m_config_parse_mp_command_line(m_config_ } // Lock stdin if it will be used as input - if(strcasecmp(argv[i],"-") == 0) + if(av_strcasecmp(argv[i],"-") == 0) m_config_set_option(config,"noconsolecontrols",NULL); add_entry(&last_parent,&last_entry,entry); UNSET_GLOBAL; // We start entry specific options Modified: trunk/playtree.c ============================================================================== --- trunk/playtree.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/playtree.c Sat Jan 23 20:22:09 2021 (r38233) @@ -22,13 +22,13 @@ #include "config.h" #include #include -#include #include #include #include #ifdef MP_DEBUG #include #endif +#include "libavutil/avstring.h" #include "m_config.h" #include "playtree.h" #include "mp_msg.h" @@ -382,7 +382,7 @@ play_tree_unset_param(play_tree_t* pt, c #endif for(n = 0 ; pt->params[n].name != NULL ; n++) { - if(strcasecmp(pt->params[n].name,name) == 0) + if(av_strcasecmp(pt->params[n].name,name) == 0) ni = n; } Modified: trunk/playtreeparser.c ============================================================================== --- trunk/playtreeparser.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/playtreeparser.c Sat Jan 23 20:22:09 2021 (r38233) @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include "libavutil/avstring.h" #include "asxparser.h" #include "m_config.h" #include "playtree.h" @@ -189,7 +189,7 @@ parse_asx(play_tree_parser_t* p) { line += 4; if(line[0] != '\0' && strlen(line) > 0) get_line = 0; - } else if(strncasecmp(line,"streaming_ctrl->url->port; //Is protocol mms or mmst? - if (!strcasecmp(proto, "mmst") || !strcasecmp(proto, "mms")) + if (!av_strcasecmp(proto, "mmst") || !av_strcasecmp(proto, "mms")) { mp_msg(MSGT_NETWORK,MSGL_V,"Trying ASF/TCP...\n"); fd = asf_mmst_streaming_start( stream ); @@ -89,9 +89,9 @@ static int asf_streaming_start( stream_t } //Is protocol http, http_proxy, or mms? - if (!strcasecmp(proto, "http_proxy") || !strcasecmp(proto, "http") || - !strcasecmp(proto, "mms") || !strcasecmp(proto, "mmsh") || - !strcasecmp(proto, "mmshttp")) + if (!av_strcasecmp(proto, "http_proxy") || !av_strcasecmp(proto, "http") || + !av_strcasecmp(proto, "mms") || !av_strcasecmp(proto, "mmsh") || + !av_strcasecmp(proto, "mmshttp")) { mp_msg(MSGT_NETWORK,MSGL_V,"Trying ASF/HTTP...\n"); fd = asf_http_streaming_start( stream, demuxer_type ); @@ -470,11 +470,11 @@ static int asf_header_check( HTTP_header static int asf_http_streaming_type(char *content_type, char *features, HTTP_header_t *http_hdr ) { if( content_type==NULL ) return ASF_Unknown_e; - if( !strcasecmp(content_type, "application/octet-stream") || - !strcasecmp(content_type, "application/vnd.ms.wms-hdr.asfv1") || // New in Corona, first request - !strcasecmp(content_type, "application/x-mms-framed") || // New in Corana, second request - !strcasecmp(content_type, "video/x-ms-wmv") || - !strcasecmp(content_type, "video/x-ms-asf")) { + if( !av_strcasecmp(content_type, "application/octet-stream") || + !av_strcasecmp(content_type, "application/vnd.ms.wms-hdr.asfv1") || // New in Corona, first request + !av_strcasecmp(content_type, "application/x-mms-framed") || // New in Corana, second request + !av_strcasecmp(content_type, "video/x-ms-wmv") || + !av_strcasecmp(content_type, "video/x-ms-asf")) { if( strstr(features, "broadcast") ) { mp_msg(MSGT_NETWORK,MSGL_V,"=====> ASF Live stream\n"); @@ -492,7 +492,7 @@ static int asf_http_streaming_type(char if( asf_header_check( http_hdr )==0 ) { mp_msg(MSGT_NETWORK,MSGL_V,"=====> ASF Plain text\n"); return ASF_PlainText_e; - } else if( (!strcasecmp(content_type, "text/html")) ) { + } else if( (!av_strcasecmp(content_type, "text/html")) ) { mp_msg(MSGT_NETWORK,MSGL_V,"=====> HTML, MPlayer is not a browser...yet!\n"); return ASF_Unknown_e; } else { @@ -500,15 +500,15 @@ static int asf_http_streaming_type(char return ASF_Redirector_e; } } else { - if( (!strcasecmp(content_type, "audio/x-ms-wax")) || - (!strcasecmp(content_type, "audio/x-ms-wma")) || - (!strcasecmp(content_type, "video/x-ms-asf")) || - (!strcasecmp(content_type, "video/x-ms-afs")) || - (!strcasecmp(content_type, "video/x-ms-wmv")) || - (!strcasecmp(content_type, "video/x-ms-wma")) ) { + if( (!av_strcasecmp(content_type, "audio/x-ms-wax")) || + (!av_strcasecmp(content_type, "audio/x-ms-wma")) || + (!av_strcasecmp(content_type, "video/x-ms-asf")) || + (!av_strcasecmp(content_type, "video/x-ms-afs")) || + (!av_strcasecmp(content_type, "video/x-ms-wmv")) || + (!av_strcasecmp(content_type, "video/x-ms-wma")) ) { mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_ASFRedirector); return ASF_Redirector_e; - } else if( !strcasecmp(content_type, "text/plain") ) { + } else if( !av_strcasecmp(content_type, "text/plain") ) { mp_msg(MSGT_NETWORK,MSGL_V,"=====> ASF Plain text\n"); return ASF_PlainText_e; } else { @@ -545,7 +545,7 @@ static HTTP_header_t *asf_http_request(s http_add_basic_authentication( http_hdr, url->username, url->password ); // Check if we are using a proxy - if( !strcasecmp( url->protocol, "http_proxy" ) ) { + if( !av_strcasecmp( url->protocol, "http_proxy" ) ) { server_url = url_new( (url->file)+1 ); if( server_url==NULL ) { mp_msg(MSGT_NETWORK,MSGL_ERR,MSGTR_MPDEMUX_ASF_InvalidProxyURL); @@ -647,7 +647,7 @@ static int asf_http_parse_response(asf_h // The pragma line can get severals attributes // separeted with a comma ','. do { - if( !strncasecmp( pragma, "features=", 9) ) { + if( !av_strncasecmp( pragma, "features=", 9) ) { pragma += 9; end = strstr( pragma, "," ); if( end==NULL ) { @@ -700,7 +700,7 @@ static int asf_http_streaming_start( str done = 1; if( fd>0 ) closesocket( fd ); - if( !strcasecmp( url->protocol, "http_proxy" ) ) { + if( !av_strcasecmp( url->protocol, "http_proxy" ) ) { if( url->port==0 ) url->port = 8080; } else { if( url->port==0 ) url->port = 80; Modified: trunk/stream/http.c ============================================================================== --- trunk/stream/http.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/http.c Sat Jan 23 20:22:09 2021 (r38233) @@ -25,7 +25,6 @@ #include #include #include -#include #include #if !HAVE_WINSOCK2_H @@ -43,6 +42,7 @@ #include "network.h" #include "help_mp.h" +#include "libavutil/avstring.h" #include "libavutil/base64.h" typedef struct { @@ -187,7 +187,7 @@ static int scast_streaming_start(stream_ int metaint; scast_data_t *scast_data; HTTP_header_t *http_hdr = stream->streaming_ctrl->data; - int is_ultravox = strcasecmp(stream->streaming_ctrl->url->protocol, "unsv") == 0; + int is_ultravox = av_strcasecmp(stream->streaming_ctrl->url->protocol, "unsv") == 0; if (!stream || stream->fd < 0 || !http_hdr) return -1; if (is_ultravox) @@ -378,7 +378,7 @@ http_response_parse( HTTP_header_t *http } strncpy( http_hdr->protocol, http_hdr->buffer, len ); http_hdr->protocol[len]='\0'; - if( !strncasecmp( http_hdr->protocol, "HTTP", 4) ) { + if( !av_strncasecmp( http_hdr->protocol, "HTTP", 4) ) { if( sscanf( http_hdr->protocol+5,"1.%d", &(http_hdr->http_minor_version) )!=1 ) { mp_msg(MSGT_NETWORK,MSGL_ERR,"Malformed answer. Unable to get HTTP minor version.\n"); return -1; @@ -435,7 +435,7 @@ http_response_parse( HTTP_header_t *http hdr_sep_len = 0; break; } - if (len > 16 && !strncasecmp(hdr_ptr + 4, "icy-metaint:", 12)) + if (len > 16 && !av_strncasecmp(hdr_ptr + 4, "icy-metaint:", 12)) { mp_msg(MSGT_NETWORK, MSGL_WARN, "Server sent a severely broken icy-metaint HTTP header!\n"); hdr_ptr += 4; @@ -545,7 +545,7 @@ http_get_next_field( HTTP_header_t *http while( field!=NULL ) { ptr = strstr( field->field_name, ":" ); if( ptr==NULL ) return NULL; - if( !strncasecmp( field->field_name, http_hdr->field_search, ptr-(field->field_name) ) ) { + if( !av_strncasecmp( field->field_name, http_hdr->field_search, ptr-(field->field_name) ) ) { ptr++; // Skip the column while( ptr[0]==' ' ) ptr++; // Skip the spaces if there is some http_hdr->field_search_pos = field->next; @@ -756,7 +756,7 @@ static int http_streaming_start(stream_t print_icy_metadata(http_hdr); // Check if the response is an ICY status_code reason_phrase - if( !strcasecmp(http_hdr->protocol, "ICY") || + if( !av_strcasecmp(http_hdr->protocol, "ICY") || http_get_field(http_hdr, "Icy-MetaInt") ) { switch( http_hdr->status_code ) { case 200: { // OK @@ -807,7 +807,7 @@ static int http_streaming_start(stream_t mp_msg(MSGT_NETWORK,MSGL_V,"Content-Type: [%s]\n", content_type ); // Check in the mime type table for a demuxer type for (i = 0; mime_type_table[i].mime_type != NULL; i++) { - if( !strcasecmp( content_type, mime_type_table[i].mime_type ) ) { + if( !av_strcasecmp( content_type, mime_type_table[i].mime_type ) ) { *file_format = mime_type_table[i].demuxer_type; res = seekable; goto out; @@ -826,7 +826,7 @@ static int http_streaming_start(stream_t // TODO: RFC 2616, recommand to detect infinite redirection loops next_url = http_get_field( http_hdr, "Location" ); if( next_url!=NULL ) { - int is_ultravox = strcasecmp(stream->streaming_ctrl->url->protocol, "unsv") == 0; + int is_ultravox = av_strcasecmp(stream->streaming_ctrl->url->protocol, "unsv") == 0; stream->streaming_ctrl->url = url_redirect( &url, next_url ); if (url_is_protocol(url, "https") || url_is_protocol(url, "mms")) { res = STREAM_REDIRECTED; @@ -866,7 +866,7 @@ out: static int fixup_open(stream_t *stream,int seekable) { HTTP_header_t *http_hdr = stream->streaming_ctrl->data; int is_icy = http_hdr && http_get_field(http_hdr, "Icy-MetaInt"); - int is_ultravox = strcasecmp(stream->streaming_ctrl->url->protocol, "unsv") == 0; + int is_ultravox = av_strcasecmp(stream->streaming_ctrl->url->protocol, "unsv") == 0; stream->type = STREAMTYPE_STREAM; if(!is_icy && !is_ultravox && seekable) Modified: trunk/stream/librtsp/rtsp.c ============================================================================== --- trunk/stream/librtsp/rtsp.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/librtsp/rtsp.c Sat Jan 23 20:22:09 2021 (r38233) @@ -34,7 +34,6 @@ #include #include "config.h" #include -#include #include #include #include @@ -48,6 +47,7 @@ #else #include #endif +#include "libavutil/avstring.h" #include "mp_msg.h" #include "rtsp.h" #include "rtsp_session.h" @@ -280,7 +280,7 @@ static int rtsp_get_answers(rtsp_t *s) { if (!answer) return 0; - if (!strncasecmp(answer,"CSeq:",5)) { + if (!av_strncasecmp(answer,"CSeq:",5)) { sscanf(answer,"%*s %u",&answer_seq); if (s->cseq != answer_seq) { #ifdef LOG @@ -289,14 +289,14 @@ static int rtsp_get_answers(rtsp_t *s) { s->cseq=answer_seq; } } - if (!strncasecmp(answer,"Server:",7)) { + if (!av_strncasecmp(answer,"Server:",7)) { char *buf = malloc(strlen(answer)); sscanf(answer,"%*s %s",buf); free(s->server); s->server=strdup(buf); free(buf); } - if (!strncasecmp(answer,"Session:",8)) { + if (!av_strncasecmp(answer,"Session:",8)) { char *buf = calloc(1, strlen(answer)); sscanf(answer,"%*s %s",buf); if (s->session) { @@ -484,7 +484,7 @@ int rtsp_read_data(rtsp_t *s, char *buff rest=rtsp_get(s); if (!rest) return -1; - if (!strncasecmp(rest,"CSeq:",5)) + if (!av_strncasecmp(rest,"CSeq:",5)) sscanf(rest,"%*s %u",&seq); } while (strlen(rest)!=0); free(rest); @@ -594,7 +594,7 @@ char *rtsp_search_answers(rtsp_t *s, con answer=s->answers; while (*answer) { - if (!strncasecmp(*answer,tag,strlen(tag))) { + if (!av_strncasecmp(*answer,tag,strlen(tag))) { ptr=strchr(*answer,':'); if (!ptr) return NULL; ptr++; Modified: trunk/stream/network.c ============================================================================== --- trunk/stream/network.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/network.c Sat Jan 23 20:22:09 2021 (r38233) @@ -23,13 +23,13 @@ #include #include #include -#include #include #include #include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "help_mp.h" @@ -140,12 +140,12 @@ check4proxies( const URL_t *url ) { URL_t *url_out = NULL; if( url==NULL ) return NULL; url_out = url_new( url->url ); - if( !strcasecmp(url->protocol, "http_proxy") ) { + if( !av_strcasecmp(url->protocol, "http_proxy") ) { mp_msg(MSGT_NETWORK,MSGL_V,"Using HTTP proxy: http://%s:%d\n", url->hostname, url->port ); return url_out; } // Check if the http_proxy environment variable is set. - if( !strcasecmp(url->protocol, "http") ) { + if( !av_strcasecmp(url->protocol, "http") ) { char *proxy; proxy = getenv("http_proxy"); if( proxy!=NULL ) { @@ -210,7 +210,7 @@ http_send_request( URL_t *url, int64_t p http_hdr = http_new_header(); - if( !strcasecmp(url->protocol, "http_proxy") ) { + if( !av_strcasecmp(url->protocol, "http_proxy") ) { proxy = 1; server_url = url_new( (url->file)+1 ); if (!server_url) { @@ -250,7 +250,7 @@ http_send_request( URL_t *url, int64_t p } } - if( strcasecmp(url->protocol, "noicyx") ) + if( av_strcasecmp(url->protocol, "noicyx") ) http_set_field(http_hdr, "Icy-MetaData: 1"); if(pos>0) { Modified: trunk/stream/stream.c ============================================================================== --- trunk/stream/stream.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/stream.c Sat Jan 23 20:22:09 2021 (r38233) @@ -28,7 +28,6 @@ #include #endif #include -#include #include #include "config.h" @@ -37,6 +36,7 @@ #include #endif +#include "libavutil/avstring.h" #include "mp_msg.h" #include "help_mp.h" #include "osdep/shmem.h" @@ -227,7 +227,7 @@ stream_t* open_stream_full(const char* f int l = strlen(sinfo->protocols[j]); // l == 0 => Don't do protocol matching (ie network and filenames) if((l == 0 && !strstr(filename, "://")) || - ((strncasecmp(sinfo->protocols[j],filename,l) == 0) && + ((av_strncasecmp(sinfo->protocols[j],filename,l) == 0) && (strncmp("://",filename+l,3) == 0))) { int r; char *redirected_url = NULL; Modified: trunk/stream/stream_bd.c ============================================================================== --- trunk/stream/stream_bd.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/stream_bd.c Sat Jan 23 20:22:09 2021 (r38233) @@ -22,7 +22,6 @@ #include #include #include -#include #include "libavutil/common.h" #include "libavutil/aes.h" @@ -195,7 +194,7 @@ static int find_vuk(struct bd_priv *bd, // or I | I-Key // can be followed by ; and comment - if (strncasecmp(line, idstr, 40)) + if (av_strncasecmp(line, idstr, 40)) continue; mp_msg(MSGT_OPEN, MSGL_V, "KeyDB found Entry for DiscID:\n%s\n", line); Modified: trunk/stream/stream_dvd.c ============================================================================== --- trunk/stream/stream_dvd.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/stream_dvd.c Sat Jan 23 20:22:09 2021 (r38233) @@ -19,10 +19,10 @@ #include #include #include -#include #include #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include "help_mp.h" #include "path.h" @@ -1053,7 +1053,7 @@ static int ifo_stream_open (stream_t *st struct stream_priv_s *spriv; int len = strlen(stream->url); - if (len < 4 || strcasecmp (stream->url + len - 4, ".ifo")) + if (len < 4 || av_strcasecmp (stream->url + len - 4, ".ifo")) return STREAM_UNSUPPORTED; mp_msg(MSGT_DVD, MSGL_INFO, ".IFO detected. Redirecting to dvd://\n"); @@ -1062,7 +1062,7 @@ static int ifo_stream_open (stream_t *st spriv=calloc(1, sizeof(struct stream_priv_s)); spriv->device = mp_dirname(stream->url); - if(!strncasecmp(filename,"vts_",4)) + if(!av_strncasecmp(filename,"vts_",4)) { if(sscanf(filename+3, "_%02d_", &spriv->title)!=1) spriv->title=1; Modified: trunk/stream/stream_pvr.c ============================================================================== --- trunk/stream/stream_pvr.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/stream_pvr.c Sat Jan 23 20:22:09 2021 (r38233) @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -301,7 +300,7 @@ set_station (struct pvr_t *pvr, const ch /* select channel */ for (i = 0; i < pvr->stationlist.used; i++) { - if (channel && !strcasecmp (pvr->stationlist.list[i].name, channel)) + if (channel && !av_strcasecmp (pvr->stationlist.list[i].name, channel)) break; /* found existing channel entry */ if (freq > 0 && pvr->stationlist.list[i].freq == freq) @@ -416,7 +415,7 @@ parse_setup_stationlist (struct pvr_t *p /* select channel list */ for (i = 0; chanlists[i].name != NULL; i++) { - if (!strcasecmp (chanlists[i].name, stream_tv_defaults.chanlist)) + if (!av_strcasecmp (chanlists[i].name, stream_tv_defaults.chanlist)) { chantab = i; break; @@ -682,7 +681,7 @@ set_station_by_channelname_or_freq (stru /* select by channel */ for (i = 0; i < pvr->stationlist.used ; i++) { - if (!strcasecmp (pvr->stationlist.list[i].name, channel)) + if (!av_strcasecmp (pvr->stationlist.list[i].name, channel)) { if (!pvr->stationlist.list[i].enabled) { Modified: trunk/stream/tv.c ============================================================================== --- trunk/stream/tv.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/tv.c Sat Jan 23 20:22:09 2021 (r38233) @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -280,19 +279,19 @@ static int norm_from_string(tvi_handle_t return 0; } - if (!strcasecmp(norm, "pal")) + if (!av_strcasecmp(norm, "pal")) return TV_NORM_PAL; - else if (!strcasecmp(norm, "ntsc")) + else if (!av_strcasecmp(norm, "ntsc")) return TV_NORM_NTSC; - else if (!strcasecmp(norm, "secam")) + else if (!av_strcasecmp(norm, "secam")) return TV_NORM_SECAM; - else if (!strcasecmp(norm, "palnc")) + else if (!av_strcasecmp(norm, "palnc")) return TV_NORM_PALNC; - else if (!strcasecmp(norm, "palm")) + else if (!av_strcasecmp(norm, "palm")) return TV_NORM_PALM; - else if (!strcasecmp(norm, "paln")) + else if (!av_strcasecmp(norm, "paln")) return TV_NORM_PALN; - else if (!strcasecmp(norm, "ntscjp")) + else if (!av_strcasecmp(norm, "ntscjp")) return TV_NORM_NTSCJP; else { mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_BogusNormParameter, norm, "PAL"); @@ -337,7 +336,7 @@ static void parse_channels(tvi_handle_t tv_channel_current->freq = 0; for (i = 0; i < chanlists[tvh->chanlist].count; i++) { cl = tvh->chanlist_s[i]; - if (!strcasecmp(cl.name, tv_channel_current->number)) { + if (!av_strcasecmp(cl.name, tv_channel_current->number)) { tv_channel_current->freq=cl.freq; break; } @@ -544,7 +543,7 @@ static int open_tv(tvi_handle_t *tvh) /* select channel list */ for (i = 0; chanlists[i].name != NULL; i++) { - if (!strcasecmp(chanlists[i].name, tvh->tv_param->chanlist)) + if (!av_strcasecmp(chanlists[i].name, tvh->tv_param->chanlist)) { tvh->chanlist = i; tvh->chanlist_s = chanlists[i].list; @@ -629,7 +628,7 @@ static int open_tv(tvi_handle_t *tvh) cl = tvh->chanlist_s[i]; // printf("count%d: name: %s, freq: %d\n", // i, cl.name, cl.freq); - if (!strcasecmp(cl.name, tvh->tv_param->channel)) + if (!av_strcasecmp(cl.name, tvh->tv_param->channel)) { strcpy(tv_channel_last_real, cl.name); tvh->channel = i; @@ -1058,7 +1057,7 @@ int tv_set_channel_real(tvi_handle_t *tv cl = tvh->chanlist_s[i]; // printf("count%d: name: %s, freq: %d\n", // i, cl.name, cl.freq); - if (!strcasecmp(cl.name, channel)) + if (!av_strcasecmp(cl.name, channel)) { tvh->channel = i; mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_SelectedChannel2, @@ -1104,7 +1103,7 @@ int tv_last_channel(tvi_handle_t *tvh) { for (i = 0; i < chanlists[tvh->chanlist].count; i++) { cl = tvh->chanlist_s[i]; - if (!strcasecmp(cl.name, tv_channel_last_real)) + if (!av_strcasecmp(cl.name, tv_channel_last_real)) { strcpy(tv_channel_last_real, tvh->chanlist_s[tvh->channel].name); tvh->channel = i; Modified: trunk/stream/tvi_dshow.c ============================================================================== --- trunk/stream/tvi_dshow.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/tvi_dshow.c Sat Jan 23 20:22:09 2021 (r38233) @@ -75,8 +75,8 @@ #include "config.h" #include -#include +#include "libavutil/avstring.h" #include "libmpcodecs/img_format.h" #include "libmpcodecs/dec_teletext.h" #include "libaf/af_format.h" @@ -3463,7 +3463,7 @@ static int control(priv_t * priv, int cm if (!priv->pTVTuner) return TVI_CONTROL_FALSE; for (i = 0; i < tv_available_norms_count; i++) { - if (!strcasecmp + if (!av_strcasecmp (tv_norms[tv_available_norms[i]].name, (char *) arg)) { *(int *) arg = i + 1; return TVI_CONTROL_TRUE; Modified: trunk/stream/tvi_v4l.c ============================================================================== --- trunk/stream/tvi_v4l.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/tvi_v4l.c Sat Jan 23 20:22:09 2021 (r38233) @@ -48,12 +48,12 @@ #include #include #include -#include #include #ifdef HAVE_SYS_SYSINFO_H #include #endif +#include "libavutil/avstring.h" #include "mp_msg.h" #include "libaf/af_format.h" #include "libmpcodecs/img_format.h" @@ -541,11 +541,11 @@ static int init(priv_t *priv) bparm.HorDcm, bparm.VerDcm, bparm.TmpDcm); bparm.input = priv->tv_param->input; /* tv */ - if (!strcasecmp(priv->tv_param->norm, "pal")) + if (!av_strcasecmp(priv->tv_param->norm, "pal")) bparm.norm = 0; /* PAL */ - else if (!strcasecmp(priv->tv_param->norm, "ntsc")) + else if (!av_strcasecmp(priv->tv_param->norm, "ntsc")) bparm.norm = 1; /* NTSC */ - else if (!strcasecmp(priv->tv_param->norm, "secam")) + else if (!av_strcasecmp(priv->tv_param->norm, "secam")) bparm.norm = 2; /* SECAM */ bparm.quality = priv->tv_param->quality; bparm.decimation = priv->tv_param->decimation; Modified: trunk/stream/tvi_v4l2.c ============================================================================== --- trunk/stream/tvi_v4l2.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/tvi_v4l2.c Sat Jan 23 20:22:09 2021 (r38233) @@ -40,7 +40,6 @@ known issues: #include #include #include -#include #include #include #include @@ -56,6 +55,7 @@ known issues: #include #include #endif +#include "libavutil/avstring.h" #include "mp_msg.h" #include "libmpcodecs/img_format.h" #include "libmpcodecs/dec_teletext.h" @@ -1003,7 +1003,7 @@ static int control(priv_t *priv, int cmd standard.index = i; if (-1 == ioctl(priv->video_fd, VIDIOC_ENUMSTD, &standard)) return TVI_CONTROL_FALSE; - if (!strcasecmp(standard.name, (char *)arg)) { + if (!av_strcasecmp(standard.name, (char *)arg)) { *(int *)arg = i; return TVI_CONTROL_TRUE; } Modified: trunk/stream/url.c ============================================================================== --- trunk/stream/url.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/stream/url.c Sat Jan 23 20:22:09 2021 (r38233) @@ -21,12 +21,12 @@ */ #include -#include #include #include #include #include +#include "libavutil/avstring.h" #include "url.h" #include "mp_msg.h" #include "mp_strings.h" @@ -37,18 +37,18 @@ #endif static int is_proxy(const URL_t *url) { - return !strcasecmp(url->protocol, "http_proxy") && url->file && strstr(url->file, "://"); + return !av_strcasecmp(url->protocol, "http_proxy") && url->file && strstr(url->file, "://"); } int url_is_protocol(const URL_t *url, const char *proto) { int proxy = is_proxy(url); if (proxy) { URL_t *tmp = url_new(url->file + 1); - int res = !strcasecmp(tmp->protocol, proto); + int res = !av_strcasecmp(tmp->protocol, proto); url_free(tmp); return res; } - return !strcasecmp(url->protocol, proto); + return !av_strcasecmp(url->protocol, proto); } void url_set_protocol(URL_t *url, const char *proto) { Modified: trunk/sub/font_load.c ============================================================================== --- trunk/sub/font_load.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/sub/font_load.c Sat Jan 23 20:22:09 2021 (r38233) @@ -23,12 +23,12 @@ #include #include #include -#include #include #include #include #include "libavutil/intreadwrite.h" +#include "libavutil/avstring.h" #include "font_load.h" #include "sub.h" @@ -120,7 +120,7 @@ for(i=0;i<65536;i++) desc->start[i]=desc section[0]=0; -unicode = !subtitle_font_encoding || strcasecmp(subtitle_font_encoding, "unicode") == 0; +unicode = !subtitle_font_encoding || av_strcasecmp(subtitle_font_encoding, "unicode") == 0; while(fgets(sor,1020,f)){ unsigned char* p[8]; Modified: trunk/sub/font_load_ft.c ============================================================================== --- trunk/sub/font_load_ft.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/sub/font_load_ft.c Sat Jan 23 20:22:09 2021 (r38233) @@ -29,7 +29,6 @@ #include #include #include -#include #ifdef CONFIG_ICONV #include @@ -44,6 +43,7 @@ #endif #include "libavutil/common.h" +#include "libavutil/avstring.h" #include "mpbswap.h" #include "font_load.h" #include "mp_msg.h" @@ -986,7 +986,7 @@ static font_desc_t* read_font_desc_ft(co if (subtitle_font_ppem > 128) subtitle_font_ppem = 128; if (osd_font_ppem > 128) osd_font_ppem = 128; - unicode = !subtitle_font_encoding || strcasecmp(subtitle_font_encoding, "unicode") == 0; + unicode = !subtitle_font_encoding || av_strcasecmp(subtitle_font_encoding, "unicode") == 0; desc = init_font_desc(); if(!desc) goto err_out; Modified: trunk/sub/spudec.c ============================================================================== --- trunk/sub/spudec.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/sub/spudec.c Sat Jan 23 20:22:09 2021 (r38233) @@ -28,6 +28,7 @@ */ #include "config.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include @@ -36,7 +37,6 @@ #include #include #include -#include #include #include "sub.h" #include "libvo/video_out.h" @@ -1292,7 +1292,7 @@ static void spudec_parse_extradata(spude pal[i] = vobsub_palette_to_yuv(pal[i]); this->auto_palette = 0; } - if (!strncasecmp(ptr, "forced subs: on", 15)) + if (!av_strncasecmp(ptr, "forced subs: on", 15)) this->forced_subs_only = 1; if (!strncmp(ptr, "custom colors: ON, tridx: ", 26) && sscanf(ptr + 26, "%x, colors: %x, %x, %x, %x", Modified: trunk/sub/subassconvert.c ============================================================================== --- trunk/sub/subassconvert.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/sub/subassconvert.c Sat Jan 23 20:22:09 2021 (r38233) @@ -19,7 +19,6 @@ */ #include -#include #include #include #include @@ -30,6 +29,7 @@ #include "bstr.h" #include "subassconvert.h" #include "libavutil/common.h" +#include "libavutil/avstring.h" struct line { char *buf; @@ -223,7 +223,7 @@ void subassconvert_subrip(const char *or for (i = 0; i < FF_ARRAY_ELEMS(subrip_web_colors); i++) { const char *color = subrip_web_colors[i].s; const int len = strlen(color); - if (strncasecmp(line, color, len) == 0) { + if (av_strncasecmp(line, color, len) == 0) { tag->color = SUBRIP_FLAG_COLOR | subrip_web_colors[i].v; line += len; break; Modified: trunk/sub/subreader.c ============================================================================== --- trunk/sub/subreader.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/sub/subreader.c Sat Jan 23 20:22:09 2021 (r38233) @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -111,7 +110,7 @@ static char *stristr(const char *haystac len=strlen(needle); while (*p != '\0') { - if (strncasecmp(p, needle, len) == 0) return (char*)p; + if (av_strncasecmp(p, needle, len) == 0) return (char*)p; p++; } @@ -179,13 +178,13 @@ static subtitle *sub_read_line_sami(stre if (p - text >= LINE_LEN) sami_add_line(current, text, &p); if (*s == '\0') break; - else if (!strncasecmp (s, "
", 4)) { + else if (!av_strncasecmp (s, "
", 4)) { sami_add_line(current, text, &p); s += 4; } else if ((*s == '{') && !sub_no_text_pp) { state = 5; ++s; continue; } else if (*s == '<') { state = 4; } - else if (!strncasecmp (s, " ", 6)) { *p++ = ' '; s += 6; } + else if (!av_strncasecmp (s, " ", 6)) { *p++ = ' '; s += 6; } else if (*s == '\t') { *p++ = ' '; s++; } else if (*s == '\r' || *s == '\n') { s++; } else *p++ = *s++; @@ -1180,7 +1179,7 @@ static int sub_autodetect (stream_t* st, {*uses_time=1;return SUB_VPLAYER;} if (sscanf (line, "%d:%d:%d ", &i, &i, &i )==3) {*uses_time=1;return SUB_VPLAYER;} - if (!strncasecmp(line, "4){ static const char exts[][8] = {".utf", ".utf8", ".utf-8" }; for (k=3;--k>=0;) - if (l >= strlen(exts[k]) && !strcasecmp(filename+(l - strlen(exts[k])), exts[k])){ + if (l >= strlen(exts[k]) && !av_strcasecmp(filename+(l - strlen(exts[k])), exts[k])){ sub_utf8 = 1; break; } @@ -2024,7 +2023,7 @@ static void append_dir_subtitles(struct // If it's a .sub, check if there is a .idx with the same name. If // there is one, it's certainly a vobsub so we skip it. - if (strcasecmp(tmp_fname_ext, "sub") == 0) { + if (av_strcasecmp(tmp_fname_ext, "sub") == 0) { char *idx, *idxname = strdup(de->d_name); strcpy(idxname + strlen(de->d_name) - sizeof("idx") + 1, "idx"); @@ -2042,14 +2041,14 @@ static void append_dir_subtitles(struct found = 0; #ifdef CONFIG_ICONV #ifdef CONFIG_ENCA - for (i = ((sub_cp && strncasecmp(sub_cp, "enca", 4) != 0) ? 3 : 0); sub_exts[i]; i++) { + for (i = ((sub_cp && av_strncasecmp(sub_cp, "enca", 4) != 0) ? 3 : 0); sub_exts[i]; i++) { #else for (i = (sub_cp ? 3 : 0); sub_exts[i]; i++) { #endif #else for (i = 0; sub_exts[i]; i++) { #endif - if (strcasecmp(sub_exts[i], tmp_fname_ext) == 0) { + if (av_strcasecmp(sub_exts[i], tmp_fname_ext) == 0) { found = 1; break; } Modified: trunk/sub/vobsub.c ============================================================================== --- trunk/sub/vobsub.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/sub/vobsub.c Sat Jan 23 20:22:09 2021 (r38233) @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -41,6 +40,7 @@ #include "path.h" #include "unrar_exec.h" #include "libavutil/common.h" +#include "libavutil/avstring.h" #include "libavutil/intreadwrite.h" #include "osdep/osdep.h" @@ -116,7 +116,7 @@ static rar_stream_t *rar_open(const char int demanded_ext_len = strlen (demanded_ext); for (i = 0, lp = list; i < num_files; i++, lp = lp->next) { name_len = strlen (lp->item.Name); - if (name_len >= demanded_ext_len && !strcasecmp (lp->item.Name + name_len - demanded_ext_len, demanded_ext)) { + if (name_len >= demanded_ext_len && !av_strcasecmp (lp->item.Name + name_len - demanded_ext_len, demanded_ext)) { rc = unrar_exec_get(&stream->data, &stream->size, lp->item.Name, rar_filename); if (rc) Modified: trunk/subopt-helper.c ============================================================================== --- trunk/subopt-helper.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/subopt-helper.c Sat Jan 23 20:22:09 2021 (r38233) @@ -36,11 +36,11 @@ */ #include "subopt-helper.h" +#include "libavutil/avstring.h" #include "mp_msg.h" #include #include -#include #include #include @@ -337,9 +337,9 @@ int strargcmp(strarg_t *arg, const char return res; } -/** \brief compare the stings just as strcasecmp does */ +/** \brief compare the stings just as av_strcasecmp does */ int strargcasecmp(strarg_t *arg, char *str) { - int res = strncasecmp(arg->str, str, arg->len); + int res = av_strncasecmp(arg->str, str, arg->len); if (!res && arg->len != strlen(str)) res = arg->len - strlen(str); return res; Modified: trunk/udp_sync.c ============================================================================== --- trunk/udp_sync.c Fri Jan 22 14:08:20 2021 (r38232) +++ trunk/udp_sync.c Sat Jan 23 20:22:09 2021 (r38233) @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #else From subversion at mplayerhq.hu Sat Jan 23 20:22:14 2021 From: subversion at mplayerhq.hu (reimar) Date: Sat, 23 Jan 2021 20:22:14 +0200 (EET) Subject: [MPlayer-cvslog] r38234 - in trunk: command.c libmenu/menu.c libmenu/menu_console.c libmenu/menu_filesel.c libmpcodecs/vf.c libmpdemux/demux_film.c libmpdemux/demux_mov.c libvo/vo_gif89a.c libvo/vo_md5sum.c m_confi... Message-ID: <20210123182214.401D7680071@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Sat Jan 23 20:22:13 2021 New Revision: 38234 Log: Remove usage of variable-length stack arrays. They have a couple of issues like complicating stack hardening, stack sizes can be very different and thus failures particularly unpredictable but also compiler support is not universal. In particular MSVC does not support it. As a side benefit, at least some of the code becomes easier to understand. Modified: trunk/command.c trunk/libmenu/menu.c trunk/libmenu/menu_console.c trunk/libmenu/menu_filesel.c trunk/libmpcodecs/vf.c trunk/libmpdemux/demux_film.c trunk/libmpdemux/demux_mov.c trunk/libvo/vo_gif89a.c trunk/libvo/vo_md5sum.c trunk/m_config.c trunk/m_option.c trunk/m_property.c trunk/mplayer.c trunk/stream/freesdp/parser.c Modified: trunk/command.c ============================================================================== --- trunk/command.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/command.c Sat Jan 23 20:22:13 2021 (r38234) @@ -1314,10 +1314,10 @@ static int mp_property_gamma(m_option_t #ifdef CONFIG_TV if (mpctx->demuxer->type == DEMUXER_TYPE_TV) { - int l = strlen(prop->name); - char tv_prop[3 + l + 1]; - sprintf(tv_prop, "tv_%s", prop->name); - return mp_property_do(tv_prop, action, arg, mpctx); + char *tv_prop = av_asprintf("tv_%s", prop->name); + r = mp_property_do(tv_prop, action, arg, mpctx); + av_freep(&tv_prop); + return r; } #endif Modified: trunk/libmenu/menu.c ============================================================================== --- trunk/libmenu/menu.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/libmenu/menu.c Sat Jan 23 20:22:13 2021 (r38234) @@ -747,17 +747,14 @@ void menu_draw_box(mp_image_t* mpi,unsig { int stride = (w+15)&(~15); // round to 16 -#if HAVE_LOCAL_ALIGNED - DECLARE_ALIGNED(16, char, pic)[stride]; - DECLARE_ALIGNED(16, char, pic_alpha)[stride]; -#else - char pic[stride],pic_alpha[stride]; -#endif + char *pic = av_malloc(2*stride); + char *pic_alpha = pic + stride; memset(pic,g,stride); memset(pic_alpha,alpha,stride); draw_alpha(w,h,pic,pic_alpha,0, mpi->planes[0] + y * mpi->stride[0] + x * (mpi->bpp>>3), mpi->stride[0]); + av_freep(&pic); } } Modified: trunk/libmenu/menu_console.c ============================================================================== --- trunk/libmenu/menu_console.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/libmenu/menu_console.c Sat Jan 23 20:22:13 2021 (r38234) @@ -32,6 +32,8 @@ #include #include +#include "libavutil/mem.h" +#include "libavutil/avstring.h" #include "libmpcodecs/img_format.h" #include "libmpcodecs/mp_image.h" @@ -217,12 +219,12 @@ static void draw(menu_t* menu, mp_image_ menu_draw_box(mpi,mpriv->bg,mpriv->bg_alpha,0,0,mpi->w,h); if(!mpriv->child || !mpriv->raw_child){ - char input[strlen(mpriv->cur_history->buffer) + strlen(mpriv->prompt) + 1]; - sprintf(input,"%s%s",mpriv->prompt,mpriv->cur_history->buffer); + char *input = av_asprintf("%s%s",mpriv->prompt,mpriv->cur_history->buffer); menu_text_size(input,w,mpriv->vspace,1,&lw,&lh); menu_draw_text_full(mpi,input,x,y,w,h,mpriv->vspace,1, MENU_TEXT_BOT|MENU_TEXT_LEFT, MENU_TEXT_BOT|MENU_TEXT_LEFT); + av_freep(&input); y -= lh + mpriv->vspace; } @@ -342,10 +344,9 @@ static int run_shell_cmd(menu_t* menu, c static void enter_cmd(menu_t* menu) { history_t* h; - char input[strlen(mpriv->cur_history->buffer) + strlen(mpriv->prompt) + 1]; - - sprintf(input,"%s%s",mpriv->prompt,mpriv->cur_history->buffer); + char *input = av_asprintf("%s%s",mpriv->prompt,mpriv->cur_history->buffer); add_line(mpriv,input); + av_freep(&input); if(mpriv->history == mpriv->cur_history) { if(mpriv->history_size >= mpriv->history_max) { Modified: trunk/libmenu/menu_filesel.c ============================================================================== --- trunk/libmenu/menu_filesel.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/libmenu/menu_filesel.c Sat Jan 23 20:22:13 2021 (r38234) @@ -142,12 +142,13 @@ static char* replace_path(char* title , } static int mylstat(char *dir, char *file,struct stat* st) { - int l = strlen(dir) + strlen(file); - char s[l+2]; + int res; + char *s = av_asprintf("%s/%s",dir,file); + int l = strlen(s); if (!strcmp("..", file)) { char *slash; l -= 3; - strcpy(s, dir); + s[l+1] = 0; #if HAVE_DOS_PATHS if (s[l] == '/' || s[l] == '\\') #else @@ -159,13 +160,12 @@ static int mylstat(char *dir, char *file if (!slash) slash = strrchr(s,'\\'); #endif - if (!slash) - return stat(dir,st); - slash[1] = '\0'; - return stat(s,st); + if (slash) + slash[1] = '\0'; } - sprintf(s,"%s/%s",dir,file); - return stat(s,st); + res = stat(s,st); + av_freep(&s); + return res; } static int compare(const void *av, const void *bv){ @@ -373,26 +373,22 @@ static void read_cmd(menu_t* menu,int cm } free(p); } else { // File and directory dealt with action string. - int fname_len = strlen(mpriv->dir) + strlen(mpriv->p.current->p.txt) + 1; - char filename[fname_len]; - char *str; char *action = mpriv->p.current->d ? mpriv->dir_action:mpriv->file_action; - sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt); - str = replace_path(action, filename,1); + char *filename = av_asprintf("%s%s",mpriv->dir,mpriv->p.current->p.txt); + char *str = replace_path(action, filename,1); mp_input_parse_and_queue_cmds(str); if (str != action) free(str); + av_freep(&filename); } } break; case MENU_CMD_ACTION: { - int fname_len = strlen(mpriv->dir) + strlen(mpriv->p.current->p.txt) + 1; - char filename[fname_len]; - char *str; - sprintf(filename,"%s%s",mpriv->dir,mpriv->p.current->p.txt); - str = replace_path(action, filename,1); + char *filename = av_asprintf("%s%s",mpriv->dir,mpriv->p.current->p.txt); + char *str = replace_path(action, filename,1); mp_input_parse_and_queue_cmds(str); if(str != action) free(str); + av_freep(&filename); } break; default: menu_list_read_cmd(menu,cmd); Modified: trunk/libmpcodecs/vf.c ============================================================================== --- trunk/libmpcodecs/vf.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/libmpcodecs/vf.c Sat Jan 23 20:22:13 2021 (r38234) @@ -513,12 +513,13 @@ vf_instance_t* vf_open_filter(vf_instanc l += 1 + strlen(args[2*i]) + 1 + strlen(args[2*i+1]); l += strlen(name); { - char str[l+1]; + char *str = malloc(l+1); char* p = str; p += sprintf(str,"%s",name); for(i = 0 ; args && args[2*i] ; i++) p += sprintf(p," %s=%s",args[2*i],args[2*i+1]); mp_msg(MSGT_VFILTER,MSGL_INFO,MSGTR_OpeningVideoFilter "[%s]\n",str); + free(str); } } else if(strcmp(name,"vo")) { if(args && strcmp(args[0],"_oldargs_") == 0) Modified: trunk/libmpdemux/demux_film.c ============================================================================== --- trunk/libmpdemux/demux_film.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/libmpdemux/demux_film.c Sat Jan 23 20:22:13 2021 (r38234) @@ -148,21 +148,23 @@ static int demux_film_fill_buffer(demuxe if (sh_audio->wf->nChannels == 2) { if (sh_audio->wf->wBitsPerSample == 8) { unsigned char* tmp = dp->buffer; - unsigned char buf[film_chunk.chunk_size]; + unsigned char* buf = malloc(film_chunk.chunk_size); for(i = 0; i < film_chunk.chunk_size/2; i++) { buf[i*2] = tmp[i]; buf[i*2+1] = tmp[film_chunk.chunk_size/2+i]; } memcpy( tmp, buf, film_chunk.chunk_size ); + free(buf); } else {/* for 16bit */ unsigned short* tmp = dp->buffer; - unsigned short buf[film_chunk.chunk_size/2]; + unsigned short* buf = malloc(film_chunk.chunk_size); for(i = 0; i < film_chunk.chunk_size/4; i++) { buf[i*2] = tmp[i]; buf[i*2+1] = tmp[film_chunk.chunk_size/4+i]; } memcpy( tmp, buf, film_chunk.chunk_size ); + free(buf); } } Modified: trunk/libmpdemux/demux_mov.c ============================================================================== --- trunk/libmpdemux/demux_mov.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/libmpdemux/demux_mov.c Sat Jan 23 20:22:13 2021 (r38234) @@ -1527,8 +1527,9 @@ static void lschunks(demuxer_t* demuxer, case MOV_FOURCC(0xa9,'s','w','r'): { off_t text_len = stream_read_word(demuxer->stream); - char text[text_len+2+1]; - stream_read(demuxer->stream, (char *)&text, text_len+2); + if (text_len >> 16) { udta_size = 0; break; } // eof + char *text = malloc(text_len+2+1); + stream_read(demuxer->stream, text, text_len+2); text[text_len+2] = 0x0; switch(udta_id) { @@ -1581,6 +1582,7 @@ static void lschunks(demuxer_t* demuxer, mp_msg(MSGT_DEMUX, MSGL_V, " Source providers: %s\n", &text[2]); break; } + free(text); udta_size -= 4+text_len; break; } Modified: trunk/libvo/vo_gif89a.c ============================================================================== --- trunk/libvo/vo_gif89a.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/libvo/vo_gif89a.c Sat Jan 23 20:22:13 2021 (r38234) @@ -268,9 +268,9 @@ static void check_events(void) {} static int gif_reduce(int width, int height, uint8_t *src, uint8_t *dst, GifColorType *colors) { - unsigned char Ra[width * height]; - unsigned char Ga[width * height]; - unsigned char Ba[width * height]; + unsigned char *Ra = malloc(3*width * height); + unsigned char *Ga = Ra + width * height; + unsigned char *Ba = Ga + width * height; unsigned char *R, *G, *B; int size = 256; int i; @@ -284,7 +284,9 @@ static int gif_reduce(int width, int hei } R = Ra; G = Ga; B = Ba; - return QuantizeBuffer(width, height, &size, R, G, B, dst, colors); + i = QuantizeBuffer(width, height, &size, R, G, B, dst, colors); + free(Ra); + return i; } static void flip_page(void) Modified: trunk/libvo/vo_md5sum.c ============================================================================== --- trunk/libvo/vo_md5sum.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/libvo/vo_md5sum.c Sat Jan 23 20:22:13 2021 (r38234) @@ -66,6 +66,7 @@ const LIBVO_EXTERN (md5sum) char *md5sum_outfile = NULL; +struct AVMD5 *md5_context; FILE *md5sum_fd; int framenum = 0; @@ -153,6 +154,8 @@ static int config(uint32_t width, uint32 exit_player(EXIT_ERROR); } + md5_context = av_md5_alloc(); + return 0; } @@ -195,8 +198,6 @@ static uint32_t draw_image(mp_image_t *m uint32_t strideU = mpi->stride[1]; uint32_t strideV = mpi->stride[2]; - uint8_t md5_context_memory[av_md5_size]; - struct AVMD5 *md5_context = (struct AVMD5*) md5_context_memory; unsigned int i; if (mpi->flags & MP_IMGFLAG_PLANAR) { /* Planar */ @@ -266,6 +267,7 @@ static void uninit(void) free(md5sum_outfile); md5sum_outfile = NULL; if (md5sum_fd && md5sum_fd != stdout) fclose(md5sum_fd); + av_freep(&md5_context); } /* ------------------------------------------------------------------------- */ Modified: trunk/m_config.c ============================================================================== --- trunk/m_config.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/m_config.c Sat Jan 23 20:22:13 2021 (r38234) @@ -29,6 +29,7 @@ #include #endif +#include "libavutil/common.h" #include "libavutil/avstring.h" #include "m_config.h" #include "m_option.h" @@ -110,10 +111,9 @@ static int show_profile(m_option_t *opt, p->desc ? p->desc : ""); config->profile_depth++; for (i = 0; i < p->num_opts; i++) { - char spc[config->profile_depth + 1]; - for (j = 0; j < config->profile_depth; j++) - spc[j] = ' '; - spc[config->profile_depth] = '\0'; + char spc[MAX_PROFILE_DEPTH + 1]; + memset(spc, ' ', MAX_PROFILE_DEPTH); + spc[FFMIN(config->profile_depth, MAX_PROFILE_DEPTH)] = '\0'; mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s%s=%s\n", spc, p->opts[2 * i], p->opts[2 * i + 1]); @@ -123,12 +123,11 @@ static int show_profile(m_option_t *opt, char *e, *list = p->opts[2 * i + 1]; while ((e = strchr(list, ','))) { int l = e-list; - char tmp[l+1]; if (!l) continue; - memcpy(tmp, list, l); - tmp[l] = '\0'; + char *tmp = av_strndup(list, l); show_profile(opt, name, tmp); + av_freep(&tmp); list = e+1; } if (list[0] != '\0') @@ -449,9 +448,9 @@ m_config_parse_option(const m_config_t * int l = strlen(co->name) + 1 + strlen(lst[2*i]) + 1; if(r >= 0) { // Build the full name - char n[l]; - sprintf(n,"%s:%s",co->name,lst[2*i]); + char *n = av_asprintf("%s:%s",co->name,lst[2*i]); sr = m_config_parse_option(config,n,lst[2*i+1],set); + av_freep(&n); if(sr < 0){ if(sr == M_OPT_UNKNOWN){ mp_msg(MSGT_CFGPARSER, MSGL_ERR,MSGTR_InvalidSuboption,co->name,lst[2*i]); Modified: trunk/m_option.c ============================================================================== --- trunk/m_option.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/m_option.c Sat Jan 23 20:22:13 2021 (r38234) @@ -36,6 +36,7 @@ #include "stream/url.h" #include "libavutil/avstring.h" #include "libavutil/attributes.h" +#include "libavutil/mem.h" // Don't free for 'production' atm #ifndef MP_DEBUG @@ -1813,9 +1814,7 @@ static int parse_obj_settings_list(const else if(av_strcasecmp(n,"-clr") == 0) op = OP_CLR; else { - char prefix[len]; - strncpy(prefix,opt->name,len-1); - prefix[len-1] = '\0'; + char *prefix = av_strndup(opt->name, len-1); mp_msg(MSGT_VFILTER,MSGL_ERR, "Option %s: unknown postfix %s\n" "Supported postfixes are:\n" " %s-add\n" @@ -1827,6 +1826,7 @@ static int parse_obj_settings_list(const " Negative index can be used (i.e. -1 is the last element)\n\n" " %s-clr\n" " Clear the current list.\n",name,n,prefix,prefix,prefix,prefix); + av_freep(&prefix); return M_OPT_UNKNOWN; } @@ -2196,10 +2196,9 @@ static int parse_custom_url(const m_opti mp_msg(MSGT_CFGPARSER, MSGL_WARN, "Option %s: This URL doesn't have a hostname part.\n",name); // skip } else { - char tmp[pos2-pos1+1]; - strncpy(tmp,ptr1, pos2-pos1); - tmp[pos2-pos1] = '\0'; + char *tmp = av_strndup(ptr1, pos2-pos1); r = m_struct_set(desc,dst,"hostname",tmp); + av_freep(&tmp); if(r < 0) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %s: Error while setting hostname.\n",name); return r; Modified: trunk/m_property.c ============================================================================== --- trunk/m_property.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/m_property.c Sat Jan 23 20:22:13 2021 (r38234) @@ -27,6 +27,7 @@ #include #include +#include "libavutil/mem.h" #include "m_option.h" #include "m_property.h" #include "mp_msg.h" @@ -41,10 +42,9 @@ static int do_action(const m_option_t* p int r; if((sep = strchr(name,'/')) && sep[1]) { int len = sep-name; - char base[len+1]; - memcpy(base,name,len); - base[len] = 0; + char *base = av_strndup(name, len); prop = m_option_list_find(prop_list, base); + av_freep(&base); ka.key = sep+1; ka.action = action; ka.arg = arg; @@ -150,29 +150,27 @@ char* m_properties_expand_string(const m lvl--, str++, l = 0; } else if(str[0] == '$' && str[1] == '{' && (e = strchr(str+2,'}'))) { int pl = e-str-2; - char pname[pl+1]; - memcpy(pname,str+2,pl); - pname[pl] = 0; + char *pname = av_strndup(str+2, pl); if(m_property_do(prop_list, pname, M_PROPERTY_PRINT, &p, ctx) >= 0 && p) l = strlen(p), fr = 1; else l = 0; + av_freep(&pname); str = e+1; } else if(str[0] == '?' && str[1] == '(' && (e = strchr(str+2,':'))) { lvl++; if(!skip) { int is_not = str[2] == '!'; int pl = e - str - (is_not ? 3 : 2); - char pname[pl+1]; - memcpy(pname, str + (is_not ? 3 : 2), pl); - pname[pl] = 0; + char *pname = av_strndup(str + (is_not ? 3 : 2), pl); if(m_property_do(prop_list,pname,M_PROPERTY_GET,NULL,ctx) < 0) { if (!is_not) skip = 1, skip_lvl = lvl; } else if (is_not) skip = 1, skip_lvl = lvl; + av_freep(&pname); } str = e+1, l = 0; } else Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/mplayer.c Sat Jan 23 20:22:13 2021 (r38234) @@ -890,7 +890,7 @@ static void parse_cfgfiles(m_config_t *c static void load_per_protocol_config(m_config_t *conf, const char *const file) { char *str; - char protocol[strlen(PROFILE_CFG_PROTOCOL) + strlen(file) + 1]; + char *protocol; m_profile_t *p; /* does filename actually uses a protocol ? */ @@ -898,13 +898,14 @@ static void load_per_protocol_config(m_c if (!str) return; - sprintf(protocol, "%s%s", PROFILE_CFG_PROTOCOL, file); - protocol[strlen(PROFILE_CFG_PROTOCOL) + strlen(file) - strlen(str)] = '\0'; + protocol = av_asprintf("%s%s", PROFILE_CFG_PROTOCOL, file); + *strstr(protocol, "://") = 0; p = m_config_get_profile(conf, protocol); if (p) { mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_LoadingProtocolProfile, protocol); m_config_set_profile(conf, p); } + av_freep(&protocol); } #define PROFILE_CFG_EXTENSION "extension." @@ -912,7 +913,7 @@ static void load_per_protocol_config(m_c static void load_per_extension_config(m_config_t *conf, const char *const file) { char *str; - char extension[strlen(PROFILE_CFG_EXTENSION) + 8]; + char extension[sizeof(PROFILE_CFG_EXTENSION) + 7]; m_profile_t *p; /* does filename actually have an extension ? */ @@ -920,8 +921,7 @@ static void load_per_extension_config(m_ if (!str) return; - sprintf(extension, PROFILE_CFG_EXTENSION); - strncat(extension, ++str, 7); + snprintf(extension, sizeof(extension), "%s%s", PROFILE_CFG_EXTENSION, ++str); p = m_config_get_profile(conf, extension); if (p) { mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_LoadingExtensionProfile, extension); @@ -934,15 +934,15 @@ static void load_per_extension_config(m_ static void load_per_output_config(m_config_t *conf, char *cfg, char *out) { - char profile[strlen(cfg) + strlen(out) + 1]; m_profile_t *p; - sprintf(profile, "%s%s", cfg, out); + char *profile = av_asprintf("%s%s", cfg, out); p = m_config_get_profile(conf, profile); if (p) { mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_LoadingExtensionProfile, profile); m_config_set_profile(conf, p); } + av_freep(&profile); } /** Modified: trunk/stream/freesdp/parser.c ============================================================================== --- trunk/stream/freesdp/parser.c Sat Jan 23 20:22:09 2021 (r38233) +++ trunk/stream/freesdp/parser.c Sat Jan 23 20:22:13 2021 (r38234) @@ -67,10 +67,10 @@ fsdp_parse (const char *text_description const char *p = text_description, *p2; unsigned int j; /* temps for sscanf */ - const unsigned int TEMPCHARS = 6; +#define TEMPCHARS 6 char fsdp_buf[TEMPCHARS][MAXSHORTFIELDLEN]; char longfsdp_buf[MAXLONGFIELDLEN]; - const unsigned int TEMPINTS = 2; +#define TEMPINTS 2 unsigned long int wuint[TEMPINTS]; if ((NULL == text_description) || (NULL == dsc)) @@ -912,7 +912,8 @@ fsdp_parse_c (const char **p, fsdp_netwo fsdp_address_type_t * atype, fsdp_connection_address_t * address) { - const unsigned int TEMPCHARS = 3; +#undef TEMPCHARS +#define TEMPCHARS 3 char fsdp_buf[TEMPCHARS][MAXSHORTFIELDLEN]; if (!strncmp (*p, "c=", 2)) From subversion at mplayerhq.hu Sat Jan 23 20:22:15 2021 From: subversion at mplayerhq.hu (reimar) Date: Sat, 23 Jan 2021 20:22:15 +0200 (EET) Subject: [MPlayer-cvslog] r38235 - in trunk: libmpcodecs/vf_filmdint.c libmpcodecs/vf_gradfun.c libmpcodecs/vf_ow.c libmpcodecs/vf_spp.c m_config.h sub/osd.c Message-ID: <20210123182215.F1841689C96@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Sat Jan 23 20:22:15 2021 New Revision: 38235 Log: Switch to using DECLARE_ALIGNED for better portability. Modified: trunk/libmpcodecs/vf_filmdint.c trunk/libmpcodecs/vf_gradfun.c trunk/libmpcodecs/vf_ow.c trunk/libmpcodecs/vf_spp.c trunk/m_config.h trunk/sub/osd.c Modified: trunk/libmpcodecs/vf_filmdint.c ============================================================================== --- trunk/libmpcodecs/vf_filmdint.c Sat Jan 23 20:22:13 2021 (r38234) +++ trunk/libmpcodecs/vf_filmdint.c Sat Jan 23 20:22:15 2021 (r38235) @@ -44,13 +44,13 @@ enum pu_field_type_t { PU_INTERLACED }; -struct metrics { +DECLARE_ALIGNED(8, , struct metrics) { /* This struct maps to a packed word 64-bit MMX register */ unsigned short int even; unsigned short int odd; unsigned short int noise; unsigned short int temp; -} __attribute__ ((aligned (8))); +}; struct frame_stats { struct metrics tiny, low, high, bigger, twox, max; Modified: trunk/libmpcodecs/vf_gradfun.c ============================================================================== --- trunk/libmpcodecs/vf_gradfun.c Sat Jan 23 20:22:13 2021 (r38234) +++ trunk/libmpcodecs/vf_gradfun.c Sat Jan 23 20:22:15 2021 (r38235) @@ -53,9 +53,9 @@ struct vf_priv_s { uint8_t *src, int sstride, int width); }; -static const uint16_t __attribute__((aligned(16))) pw_7f[8] = {127,127,127,127,127,127,127,127}; -static const uint16_t __attribute__((aligned(16))) pw_ff[8] = {255,255,255,255,255,255,255,255}; -static const uint16_t __attribute__((aligned(16))) dither[8][8] = { +DECLARE_ALIGNED(16, static const uint16_t, pw_7f)[8] = {127,127,127,127,127,127,127,127}; +DECLARE_ALIGNED(16, static const uint16_t, pw_ff)[8] = {255,255,255,255,255,255,255,255}; +DECLARE_ALIGNED(16, static const uint16_t, dither)[8][8] = { { 0, 96, 24,120, 6,102, 30,126 }, { 64, 32, 88, 56, 70, 38, 94, 62 }, { 16,112, 8,104, 22,118, 14,110 }, Modified: trunk/libmpcodecs/vf_ow.c ============================================================================== --- trunk/libmpcodecs/vf_ow.c Sat Jan 23 20:22:13 2021 (r38234) +++ trunk/libmpcodecs/vf_ow.c Sat Jan 23 20:22:15 2021 (r38235) @@ -32,13 +32,14 @@ #include #include +#include "libavutil/mem_internal.h" #include "mp_msg.h" #include "img_format.h" #include "mp_image.h" #include "vf.h" //===========================================================================// -static const uint8_t __attribute__((aligned(8))) dither[8][8]={ +DECLARE_ALIGNED(8, static const uint8_t, dither)[8][8]={ { 0, 48, 12, 60, 3, 51, 15, 63, }, { 32, 16, 44, 28, 35, 19, 47, 31, }, { 8, 56, 4, 52, 11, 59, 7, 55, }, Modified: trunk/libmpcodecs/vf_spp.c ============================================================================== --- trunk/libmpcodecs/vf_spp.c Sat Jan 23 20:22:13 2021 (r38234) +++ trunk/libmpcodecs/vf_spp.c Sat Jan 23 20:22:15 2021 (r38235) @@ -58,7 +58,7 @@ #define XMIN(a,b) ((a) < (b) ? (a) : (b)) //===========================================================================// -static const uint8_t __attribute__((aligned(8))) dither[8][8]={ +DECLARE_ALIGNED(8, static const uint8_t, dither)[8][8]={ { 0, 48, 12, 60, 3, 51, 15, 63, }, { 32, 16, 44, 28, 35, 19, 47, 31, }, { 8, 56, 4, 52, 11, 59, 7, 55, }, @@ -383,7 +383,7 @@ static void filter(struct vf_priv_s *p, int x, y, i; const int count= 1<log2_count; const int stride= is_luma ? p->temp_stride : ((width+16+15)&(~15)); - uint64_t __attribute__((aligned(16))) block_align[32]; + LOCAL_ALIGNED_16(uint64_t, block_align, [32]); int16_t *block = (int16_t *)block_align; int16_t *block2= (int16_t *)(block_align+16); Modified: trunk/m_config.h ============================================================================== --- trunk/m_config.h Sat Jan 23 20:22:13 2021 (r38234) +++ trunk/m_config.h Sat Jan 23 20:22:15 2021 (r38235) @@ -19,6 +19,8 @@ #ifndef MPLAYER_M_CONFIG_H #define MPLAYER_M_CONFIG_H +#include "libavutil/mem_internal.h" + /// \defgroup Config Config manager /// /// m_config provides an API to manipulate the config variables in MPlayer. @@ -43,7 +45,7 @@ struct m_config_save_slot { int lvl; // We have to store other datatypes in this as well, // so make sure we get properly aligned addresses. - unsigned char data[0] __attribute__ ((aligned (8))); + DECLARE_ALIGNED(8, unsigned char, data)[0]; }; /// Config option Modified: trunk/sub/osd.c ============================================================================== --- trunk/sub/osd.c Sat Jan 23 20:22:13 2021 (r38234) +++ trunk/sub/osd.c Sat Jan 23 20:22:15 2021 (r38235) @@ -28,13 +28,14 @@ #include "mp_msg.h" #include #include +#include "libavutil/mem_internal.h" #include "libmpcodecs/img_format.h" #include "cpudetect.h" #if ARCH_X86 && (!HAVE_SSE2 || CONFIG_RUNTIME_CPUDETECT) -static const uint64_t bFF __attribute__((aligned(8))) = 0xFFFFFFFFFFFFFFFFULL; -static const unsigned long long mask24lh __attribute__((aligned(8))) = 0xFFFF000000000000ULL; -static const unsigned long long mask24hl __attribute__((aligned(8))) = 0x0000FFFFFFFFFFFFULL; +DECLARE_ALIGNED(8, static const uint64_t, bFF) = 0xFFFFFFFFFFFFFFFFULL; +DECLARE_ALIGNED(8, static const unsigned long long, mask24lh) = 0xFFFF000000000000ULL; +DECLARE_ALIGNED(8, static const unsigned long long, mask24hl) = 0x0000FFFFFFFFFFFFULL; #endif //Note: we have C, X86-nommx, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one From subversion at mplayerhq.hu Sat Jan 23 20:54:46 2021 From: subversion at mplayerhq.hu (reimar) Date: Sat, 23 Jan 2021 20:54:46 +0200 (EET) Subject: [MPlayer-cvslog] r38236 - trunk/m_option.c Message-ID: <20210123185446.E4BB668811F@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Sat Jan 23 20:54:46 2021 New Revision: 38236 Log: m_options.c: Add sys/types.h included needed for off_t. Modified: trunk/m_option.c Modified: trunk/m_option.c ============================================================================== --- trunk/m_option.c Sat Jan 23 20:22:15 2021 (r38235) +++ trunk/m_option.c Sat Jan 23 20:54:46 2021 (r38236) @@ -28,6 +28,7 @@ #include #include #include +#include #include "m_option.h" //#include "m_config.h" From subversion at mplayerhq.hu Sat Jan 23 21:05:29 2021 From: subversion at mplayerhq.hu (reimar) Date: Sat, 23 Jan 2021 21:05:29 +0200 (EET) Subject: [MPlayer-cvslog] r38237 - trunk/codec-cfg.c Message-ID: <20210123190530.01EE26880C4@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Sat Jan 23 21:05:29 2021 New Revision: 38237 Log: codec-cfg.c: Also switch to av_strcasecmp. Except when compiling stand-alone, a libavutil dependency would complicate things when cross-compiling, and the locale issue wth strcasecmp is less of a problem when compiling it as a small stand-alone utility. Modified: trunk/codec-cfg.c Modified: trunk/codec-cfg.c ============================================================================== --- trunk/codec-cfg.c Sat Jan 23 20:54:46 2021 (r38236) +++ trunk/codec-cfg.c Sat Jan 23 21:05:29 2021 (r38237) @@ -40,7 +40,6 @@ #include #include #include -#include #include "config.h" #include "mp_msg.h" @@ -50,6 +49,10 @@ #else #define mp_msg(t, l, ...) fprintf(stderr, __VA_ARGS__) #endif +#include +#define av_strcasecmp(a, b) strcasecmp(a, b) +#else +#include #endif #include "help_mp.h" @@ -816,13 +819,13 @@ int parse_codec_cfg(const char *cfgfile) } else if (!strcmp(token[0], "status")) { if (get_token(1, 1) < 0) goto err_out_parse_error; - if (!strcasecmp(token[0], "working")) + if (!av_strcasecmp(token[0], "working")) codec->status = CODECS_STATUS_WORKING; - else if (!strcasecmp(token[0], "crashing")) + else if (!av_strcasecmp(token[0], "crashing")) codec->status = CODECS_STATUS_NOT_WORKING; - else if (!strcasecmp(token[0], "untested")) + else if (!av_strcasecmp(token[0], "untested")) codec->status = CODECS_STATUS_UNTESTED; - else if (!strcasecmp(token[0], "buggy")) + else if (!av_strcasecmp(token[0], "buggy")) codec->status = CODECS_STATUS_PROBLEMS; else goto err_out_parse_error; From subversion at mplayerhq.hu Sun Jan 24 00:26:29 2021 From: subversion at mplayerhq.hu (reimar) Date: Sun, 24 Jan 2021 00:26:29 +0200 (EET) Subject: [MPlayer-cvslog] r38238 - trunk/libmpcodecs/vf_spp.c Message-ID: <20210123222629.316EE680B67@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Sun Jan 24 00:26:28 2021 New Revision: 38238 Log: vf_spp.c: Add missing include for LOCAL_ALIGNED_16. Modified: trunk/libmpcodecs/vf_spp.c Modified: trunk/libmpcodecs/vf_spp.c ============================================================================== --- trunk/libmpcodecs/vf_spp.c Sat Jan 23 21:05:29 2021 (r38237) +++ trunk/libmpcodecs/vf_spp.c Sun Jan 24 00:26:28 2021 (r38238) @@ -39,6 +39,7 @@ #include "libavutil/common.h" #include "libavutil/internal.h" +#include "libavutil/mem_internal.h" #include "libavutil/intreadwrite.h" #include "libavcodec/avcodec.h" #include "libavcodec/pixblockdsp.h" From subversion at mplayerhq.hu Mon Jan 25 21:10:26 2021 From: subversion at mplayerhq.hu (reimar) Date: Mon, 25 Jan 2021 21:10:26 +0200 (EET) Subject: [MPlayer-cvslog] r38239 - in trunk: command.c mplayer.c stream/cache2.c stream/stream.c stream/stream.h stream/stream_file.c Message-ID: <20210125191026.8645C687FC9@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Mon Jan 25 21:10:25 2021 New Revision: 38239 Log: Switch -dumpstream/stream capturing via command away from fopen. Use our own stream functions which for example have proper UTF-8 support on Windows. Would also allow to capture to other stream types than just files, but this is likely to have problems, e.g. FFmpeg's AVIO supports appending only via stream-specific options, so stream_ffmpeg does not support it. Modified: trunk/command.c trunk/mplayer.c trunk/stream/cache2.c trunk/stream/stream.c trunk/stream/stream.h trunk/stream/stream_file.c Modified: trunk/command.c ============================================================================== --- trunk/command.c Sun Jan 24 00:26:28 2021 (r38238) +++ trunk/command.c Mon Jan 25 21:10:25 2021 (r38239) @@ -1122,7 +1122,7 @@ static int mp_property_capture(m_option_ void *arg, MPContext *mpctx) { int ret; - int capturing = mpctx->stream && mpctx->stream->capture_file; + int capturing = mpctx->stream && mpctx->stream->capture_stream; if (!mpctx->stream) return M_PROPERTY_UNAVAILABLE; @@ -1133,17 +1133,18 @@ static int mp_property_capture(m_option_ } ret = m_property_flag(prop, action, arg, &capturing); - if (ret == M_PROPERTY_OK && capturing != !!mpctx->stream->capture_file) { + if (ret == M_PROPERTY_OK && capturing != !!mpctx->stream->capture_stream) { if (capturing) { - mpctx->stream->capture_file = fopen(stream_dump_name, "ab"); - if (!mpctx->stream->capture_file) { + int dummy; + mpctx->stream->capture_stream = open_stream_full(stream_dump_name, STREAM_APPEND, NULL, &dummy); + if (!mpctx->stream->capture_stream) { mp_msg(MSGT_GLOBAL, MSGL_ERR, "Error opening capture file: %s\n", strerror(errno)); ret = M_PROPERTY_ERROR; } } else { - fclose(mpctx->stream->capture_file); - mpctx->stream->capture_file = NULL; + free_stream(mpctx->stream->capture_stream); + mpctx->stream->capture_stream = NULL; } } @@ -1153,7 +1154,7 @@ static int mp_property_capture(m_option_ break; case M_PROPERTY_OK: set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDCapturing, - mpctx->stream->capture_file ? MSGTR_Enabled : MSGTR_Disabled); + mpctx->stream->capture_stream ? MSGTR_Enabled : MSGTR_Disabled); break; default: break; Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Sun Jan 24 00:26:28 2021 (r38238) +++ trunk/mplayer.c Mon Jan 25 21:10:25 2021 (r38239) @@ -3280,12 +3280,12 @@ play_next_file: if (stream_dump_type == 5) { unsigned char buf[4096]; int len; - FILE *f; + stream_t *os; current_module = "dumpstream"; stream_reset(mpctx->stream); stream_seek(mpctx->stream, mpctx->stream->start_pos); - f = fopen(stream_dump_name, "wb"); - if (!f) { + os = open_output_stream(stream_dump_name, NULL); + if (!os) { mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_CantOpenDumpfile); exit_player(EXIT_ERROR); } @@ -3302,7 +3302,7 @@ play_next_file: break; len = stream_read(mpctx->stream, buf, 4096); if (len > 0) { - if (fwrite(buf, len, 1, f) != 1) { + if (stream_write_buffer(os, buf, len) != len) { mp_msg(MSGT_MENCODER, MSGL_FATAL, MSGTR_ErrorWritingFile, stream_dump_name); exit_player(EXIT_ERROR); } @@ -3315,7 +3315,7 @@ play_next_file: break; } } - if (fclose(f)) { + if (free_stream(os)) { mp_msg(MSGT_MENCODER, MSGL_FATAL, MSGTR_ErrorWritingFile, stream_dump_name); exit_player(EXIT_ERROR); } @@ -3483,7 +3483,7 @@ goto_enable_cache: // DUMP STREAMS: if ((stream_dump_type) && (stream_dump_type < 4)) { - FILE *f; + stream_t *os; demux_stream_t *ds = NULL; current_module = "dump"; // select stream to dump @@ -3512,8 +3512,8 @@ goto_enable_cache: mpctx->d_sub->id = -2; } // let's dump it! - f = fopen(stream_dump_name, "wb"); - if (!f) { + os = open_output_stream(stream_dump_name, NULL); + if (!os) { mp_msg(MSGT_CPLAYER, MSGL_FATAL, MSGTR_CantOpenDumpfile); exit_player(EXIT_ERROR); } @@ -3530,9 +3530,9 @@ goto_enable_cache: break; if ((mpctx->demuxer->file_format == DEMUXER_TYPE_AVI || mpctx->demuxer->file_format == DEMUXER_TYPE_ASF || mpctx->demuxer->file_format == DEMUXER_TYPE_MOV) && stream_dump_type == 2) - fwrite(&in_size, 1, 4, f); + stream_write_buffer(os, &in_size, 4); if (in_size > 0) { - fwrite(start, in_size, 1, f); + stream_write_buffer(os, start, in_size); stream_dump_progress(in_size, mpctx->stream); } if (dvd_last_chapter > 0) { @@ -3541,7 +3541,7 @@ goto_enable_cache: break; } } - fclose(f); + free_stream(os); stream_dump_progress_end(); mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_CoreDumped); exit_player_with_rc(EXIT_EOF, 0); Modified: trunk/stream/cache2.c ============================================================================== --- trunk/stream/cache2.c Sun Jan 24 00:26:28 2021 (r38238) +++ trunk/stream/cache2.c Mon Jan 25 21:10:25 2021 (r38239) @@ -578,7 +578,7 @@ int cache_stream_fill_buffer(stream_t *s s->buf_len=len; s->pos+=len; // printf("[%d]",len);fflush(stdout); - if (s->capture_file) + if (s->capture_stream) stream_capture_do(s); return len; Modified: trunk/stream/stream.c ============================================================================== --- trunk/stream/stream.c Sun Jan 24 00:26:28 2021 (r38238) +++ trunk/stream/stream.c Mon Jan 25 21:10:25 2021 (r38239) @@ -181,7 +181,7 @@ static stream_t* open_stream_plugin(cons } } s = new_stream(-2,-2); - s->capture_file = NULL; + s->capture_stream = NULL; s->url=strdup(filename); s->flags |= mode; *ret = sinfo->open(s,mode,arg,file_format); @@ -270,11 +270,11 @@ stream_t* open_output_stream(const char* void stream_capture_do(stream_t *s) { - if (fwrite(s->buffer, s->buf_len, 1, s->capture_file) < 1) { + if (stream_write_buffer(s->capture_stream, s->buffer, s->buf_len) != s->buf_len) { mp_msg(MSGT_GLOBAL, MSGL_ERR, MSGTR_StreamErrorWritingCapture, strerror(errno)); - fclose(s->capture_file); - s->capture_file = NULL; + free_stream(s->capture_stream); + s->capture_stream = NULL; } } @@ -370,7 +370,7 @@ int stream_fill_buffer(stream_t *s){ // definitely not at EOF yet s->eof = 0; // printf("[%d]",len);fflush(stdout); - if (s->capture_file) + if (s->capture_stream) stream_capture_do(s); return s->buf_len; } @@ -540,14 +540,15 @@ stream_t* new_stream(int fd,int type){ return s; } -void free_stream(stream_t *s){ +int free_stream(stream_t *s){ + int res = 0; // printf("\n*** free_stream() called ***\n"); #ifdef CONFIG_STREAM_CACHE cache_uninit(s); #endif - if (s->capture_file) { - fclose(s->capture_file); - s->capture_file = NULL; + if (s->capture_stream) { + res |= free_stream(s->capture_stream); + s->capture_stream = NULL; } if(s->close) s->close(s); @@ -557,7 +558,7 @@ void free_stream(stream_t *s){ network socket and file */ if(s->url && strstr(s->url,"://")) closesocket(s->fd); - else close(s->fd); + else res |= close(s->fd); } #if HAVE_WINSOCK2_H mp_msg(MSGT_STREAM,MSGL_V,"WINSOCK2 uninit\n"); @@ -568,6 +569,7 @@ void free_stream(stream_t *s){ //free(s->priv); free(s->url); free(s); + return res; } stream_t* new_ds_stream(demux_stream_t *ds) { Modified: trunk/stream/stream.h ============================================================================== --- trunk/stream/stream.h Sun Jan 24 00:26:28 2021 (r38238) +++ trunk/stream/stream.h Mon Jan 25 21:10:25 2021 (r38239) @@ -63,6 +63,7 @@ /// streams that use the new api should check the mode at open #define STREAM_READ 0 #define STREAM_WRITE 1 +#define STREAM_APPEND 2 /// Seek flags, if not mannualy set and s->seek isn't NULL /// MP_STREAM_SEEK is automaticly set #define MP_STREAM_SEEK_BW 2 @@ -178,7 +179,7 @@ typedef struct stream { streaming_ctrl_t *streaming_ctrl; #endif unsigned char buffer[STREAM_BUFFER_SIZE>STREAM_MAX_SECTOR_SIZE?STREAM_BUFFER_SIZE:STREAM_MAX_SECTOR_SIZE]; - FILE *capture_file; + struct stream *capture_stream; } stream_t; #ifdef CONFIG_NETWORKING @@ -361,7 +362,7 @@ static inline int stream_skip(stream_t * void stream_reset(stream_t *s); int stream_control(stream_t *s, int cmd, void *arg); stream_t* new_stream(int fd,int type); -void free_stream(stream_t *s); +int free_stream(stream_t *s); stream_t* new_memory_stream(unsigned char* data,int len); stream_t* open_stream(const char* filename,char** options,int* file_format); stream_t* open_stream_full(const char* filename,int mode, char** options, int* file_format); Modified: trunk/stream/stream_file.c ============================================================================== --- trunk/stream/stream_file.c Sun Jan 24 00:26:28 2021 (r38238) +++ trunk/stream/stream_file.c Mon Jan 25 21:10:25 2021 (r38239) @@ -149,6 +149,8 @@ static int open_f(stream_t *stream,int m m = O_RDONLY; else if(mode == STREAM_WRITE) m = O_RDWR|O_CREAT|O_TRUNC; + else if (mode == STREAM_APPEND) + m = O_RDWR|O_CREAT|O_APPEND; else { mp_msg(MSGT_OPEN,MSGL_ERR, "[file] Unknown open mode %d\n",mode); m_struct_free(&stream_opts,opts); From subversion at mplayerhq.hu Mon Jan 25 21:10:27 2021 From: subversion at mplayerhq.hu (reimar) Date: Mon, 25 Jan 2021 21:10:27 +0200 (EET) Subject: [MPlayer-cvslog] r38240 - trunk/configure Message-ID: <20210125191027.D751068812C@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Mon Jan 25 21:10:27 2021 New Revision: 38240 Log: configure: Fix FFmpeg on MinGW compilation. FFmpeg depends on CancelIoEx which means we need to define _WIN32_WINNT=0x0600, which results in pollfd being defined, so needs to happen before that check. Modified: trunk/configure Modified: trunk/configure ============================================================================== --- trunk/configure Mon Jan 25 21:10:25 2021 (r38239) +++ trunk/configure Mon Jan 25 21:10:27 2021 (r38240) @@ -3594,6 +3594,11 @@ else fi echores "$_nanosleep" +echocheck "windows.h" +windows_h=no +def_windows_h='#define HAVE_WINDOWS_H 0' +header_check windows.h && windows_h=yes && def_windows_h='#define HAVE_WINDOWS_H 1' && extra_cflags="$extra_cflags -D_WIN32_WINNT=0x0600" +echores "$windows_h" echocheck "socklib" # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl): @@ -4218,12 +4223,6 @@ else _threads=no fi -echocheck "windows.h" -windows_h=no -def_windows_h='#define HAVE_WINDOWS_H 0' -header_check windows.h && windows_h=yes && def_windows_h='#define HAVE_WINDOWS_H 1' -echores "$windows_h" - echocheck "io.h" _io_h=no From subversion at mplayerhq.hu Mon Jan 25 21:10:28 2021 From: subversion at mplayerhq.hu (reimar) Date: Mon, 25 Jan 2021 21:10:28 +0200 (EET) Subject: [MPlayer-cvslog] r38241 - trunk/libao2/ao_mpegpes.c Message-ID: <20210125191028.DE05168818D@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Mon Jan 25 21:10:28 2021 New Revision: 38241 Log: ao_mpegpes.c: Put code accessing DVB devices under CONFIG_DVB. Modified: trunk/libao2/ao_mpegpes.c Modified: trunk/libao2/ao_mpegpes.c ============================================================================== --- trunk/libao2/ao_mpegpes.c Mon Jan 25 21:10:27 2021 (r38240) +++ trunk/libao2/ao_mpegpes.c Mon Jan 25 21:10:28 2021 (r38241) @@ -161,6 +161,7 @@ static int preinit(const char *arg) mp_msg(MSGT_VO, MSGL_ERR, "AO_MPEGPES, Unrecognized options\n"); return -1; } +#ifdef CONFIG_DVB if(card==-1) { //search the first usable card @@ -183,7 +184,6 @@ static int preinit(const char *arg) } card--; -#ifdef CONFIG_DVB if(!ao_file) return init_device(card); #else From subversion at mplayerhq.hu Mon Jan 25 21:10:33 2021 From: subversion at mplayerhq.hu (reimar) Date: Mon, 25 Jan 2021 21:10:33 +0200 (EET) Subject: [MPlayer-cvslog] r38242 - in trunk: input/input.c libao2/ao_alsa.c libmenu/menu_console.c libmpcodecs/vf_filmdint.c mencoder.c mplayer.c stream/freesdp/common.h stream/frequencies.c stream/librtsp/rtsp.c stream/net... Message-ID: <20210125191033.435D06881B0@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Mon Jan 25 21:10:32 2021 New Revision: 38242 Log: Remove unnecessary/duplicated includes. In particular sys/time.h is included in a lot of places that do not need or need it only when specific defines are set. Besides being cleaner this should also be better for portability, though there is a risk of it breaking something on some less common systems. Modified: trunk/input/input.c trunk/libao2/ao_alsa.c trunk/libmenu/menu_console.c trunk/libmpcodecs/vf_filmdint.c trunk/mencoder.c trunk/mplayer.c trunk/stream/freesdp/common.h trunk/stream/frequencies.c trunk/stream/librtsp/rtsp.c trunk/stream/network.h trunk/stream/pnm.c trunk/stream/stream_dvb.c trunk/stream/stream_pvr.c trunk/stream/tcp.c trunk/stream/tv.c trunk/stream/udp.c Modified: trunk/input/input.c ============================================================================== --- trunk/input/input.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/input/input.c Mon Jan 25 21:10:32 2021 (r38242) @@ -25,7 +25,9 @@ #include #include #include +#ifdef HAVE_POSIX_SELECT #include +#endif #include #include Modified: trunk/libao2/ao_alsa.c ============================================================================== --- trunk/libao2/ao_alsa.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/libao2/ao_alsa.c Mon Jan 25 21:10:32 2021 (r38242) @@ -27,7 +27,6 @@ */ #include -#include #include #include #include Modified: trunk/libmenu/menu_console.c ============================================================================== --- trunk/libmenu/menu_console.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/libmenu/menu_console.c Mon Jan 25 21:10:32 2021 (r38242) @@ -20,14 +20,20 @@ #include "mp_msg.h" #include "help_mp.h" +#ifdef HAVE_POSIX_SELECT +#define RUN_CMD 1 +#else +#define RUN_CMD 0 +#endif + #include #include #include #include -#include #include -#ifndef __MINGW32__ +#if RUN_CMD #include +#include #endif #include #include @@ -241,7 +247,7 @@ static void draw(menu_t* menu, mp_image_ } static void check_child(menu_t* menu) { -#ifndef __MINGW32__ +#if RUN_CMD fd_set rfd; struct timeval tv; int max_fd = mpriv->child_fd[2] > mpriv->child_fd[1] ? mpriv->child_fd[2] : @@ -295,7 +301,7 @@ static void check_child(menu_t* menu) { #define close_pipe(pipe) close(pipe[0]); close(pipe[1]) static int run_shell_cmd(menu_t* menu, char* cmd) { -#ifndef __MINGW32__ +#if RUN_CMD int in[2],out[2],err[2]; mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_LIBMENU_ConsoleRun,cmd); Modified: trunk/libmpcodecs/vf_filmdint.c ============================================================================== --- trunk/libmpcodecs/vf_filmdint.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/libmpcodecs/vf_filmdint.c Mon Jan 25 21:10:32 2021 (r38242) @@ -19,11 +19,11 @@ #include #include #include -#include #include "config.h" #include "mp_msg.h" #include "cpudetect.h" +#include "osdep/timer.h" #include "img_format.h" #include "mp_image.h" @@ -927,9 +927,7 @@ static void init(struct vf_priv_s *p, mp static inline double get_time(void) { - struct timeval tv; - gettimeofday(&tv, 0); - return tv.tv_sec + tv.tv_usec * 1e-6; + return GetTimer() * 1e-6; } static void get_image(struct vf_instance *vf, mp_image_t *mpi) Modified: trunk/mencoder.c ============================================================================== --- trunk/mencoder.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/mencoder.c Mon Jan 25 21:10:32 2021 (r38242) @@ -50,7 +50,6 @@ #include #include #include -#include #if defined(__MINGW32__) || defined(__CYGWIN__) #include #endif Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/mplayer.c Mon Jan 25 21:10:32 2021 (r38242) @@ -29,7 +29,6 @@ #include #include #include -#include #include #if defined(__MINGW32__) || defined(__CYGWIN__) @@ -123,8 +122,6 @@ #include "sub/subreader.h" #include "sub/vobsub.h" #include "sub/eosd.h" -#include "osdep/getch2.h" -#include "osdep/timer.h" #include "udp_sync.h" Modified: trunk/stream/freesdp/common.h ============================================================================== --- trunk/stream/freesdp/common.h Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/stream/freesdp/common.h Mon Jan 25 21:10:32 2021 (r38242) @@ -35,7 +35,6 @@ # define END_C_DECLS #endif /* __cplusplus */ -#include #include BEGIN_C_DECLS Modified: trunk/stream/frequencies.c ============================================================================== --- trunk/stream/frequencies.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/stream/frequencies.c Mon Jan 25 21:10:32 2021 (r38242) @@ -17,7 +17,6 @@ */ #include -#include #include "frequencies.h" Modified: trunk/stream/librtsp/rtsp.c ============================================================================== --- trunk/stream/librtsp/rtsp.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/stream/librtsp/rtsp.c Mon Jan 25 21:10:32 2021 (r38242) @@ -39,12 +39,12 @@ #include #include #include -#include #include #include #if HAVE_WINSOCK2_H #include #else +#include #include #endif #include "libavutil/avstring.h" Modified: trunk/stream/network.h ============================================================================== --- trunk/stream/network.h Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/stream/network.h Mon Jan 25 21:10:32 2021 (r38242) @@ -24,7 +24,6 @@ #define MPLAYER_NETWORK_H #include -#include #include #include "config.h" @@ -32,6 +31,7 @@ #include #include #include +#include #include #endif Modified: trunk/stream/pnm.c ============================================================================== --- trunk/stream/pnm.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/stream/pnm.c Mon Jan 25 21:10:32 2021 (r38242) @@ -33,10 +33,10 @@ #include #include #include -#include #include #if !HAVE_WINSOCK2_H #include +#include //#include //#include #else Modified: trunk/stream/stream_dvb.c ============================================================================== --- trunk/stream/stream_dvb.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/stream/stream_dvb.c Mon Jan 25 21:10:32 2021 (r38242) @@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fi #include #include #include -#include #include #include #include Modified: trunk/stream/stream_pvr.c ============================================================================== --- trunk/stream/stream_pvr.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/stream/stream_pvr.c Mon Jan 25 21:10:32 2021 (r38242) @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include Modified: trunk/stream/tcp.c ============================================================================== --- trunk/stream/tcp.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/stream/tcp.c Mon Jan 25 21:10:32 2021 (r38242) @@ -30,7 +30,6 @@ #include #include -#include #include #include "config.h" @@ -42,6 +41,7 @@ #include #include #include +#include #include #else #include Modified: trunk/stream/tv.c ============================================================================== --- trunk/stream/tv.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/stream/tv.c Mon Jan 25 21:10:32 2021 (r38242) @@ -30,7 +30,6 @@ #include #include #include -#include #include "config.h" Modified: trunk/stream/udp.c ============================================================================== --- trunk/stream/udp.c Mon Jan 25 21:10:28 2021 (r38241) +++ trunk/stream/udp.c Mon Jan 25 21:10:32 2021 (r38242) @@ -30,13 +30,13 @@ #include #include #include -#include #include #if !HAVE_WINSOCK2_H #include #include #include +#include #include #else #include From subversion at mplayerhq.hu Mon Jan 25 21:47:48 2021 From: subversion at mplayerhq.hu (reimar) Date: Mon, 25 Jan 2021 21:47:48 +0200 (EET) Subject: [MPlayer-cvslog] r38243 - trunk/stream/stream_bd.c Message-ID: <20210125194748.364116881B7@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Mon Jan 25 21:47:47 2021 New Revision: 38243 Log: stream_bd: avoid using PATH_MAX. There is no need to make assumptions on path lengths and possibly large stack allocations when it's not much more complicated to do without. Modified: trunk/stream/stream_bd.c Modified: trunk/stream/stream_bd.c ============================================================================== --- trunk/stream/stream_bd.c Mon Jan 25 21:10:32 2021 (r38242) +++ trunk/stream/stream_bd.c Mon Jan 25 21:47:47 2021 (r38243) @@ -147,7 +147,6 @@ static void id2str(const uint8_t *id, in static int find_vuk(struct bd_priv *bd, const uint8_t discid[20]) { char line[1024]; - char filename[PATH_MAX]; const char *home; int vukfound = 0; stream_t *file; @@ -156,8 +155,9 @@ static int find_vuk(struct bd_priv *bd, // look up discid in KEYDB.cfg to get VUK home = getenv("HOME"); - snprintf(filename, sizeof(filename), "%s/.cache/aacs/vuk/%s", home, idstr); + char *filename = av_asprintf("%s/.cache/aacs/vuk/%s", home, idstr); file = open_stream(filename, NULL, NULL); + av_freep(&filename); if (file) { vukfound = 1; memset(line, 0, sizeof(line)); @@ -170,17 +170,20 @@ static int find_vuk(struct bd_priv *bd, if (vukfound) return 1; } - snprintf(filename, sizeof(filename), "%s/.config/aacs/KEYDB.cfg", home); + filename = av_asprintf("%s/.config/aacs/KEYDB.cfg", home); file = open_stream(filename, NULL, NULL); if (!file) { - snprintf(filename, sizeof(filename), "%s/.dvdcss/KEYDB.cfg", home); + av_freep(&filename); + filename = av_asprintf("%s/.dvdcss/KEYDB.cfg", home); file = open_stream(filename, NULL, NULL); } if (!file) { mp_msg(MSGT_OPEN,MSGL_ERR, "Cannot open VUK database file %s\n", filename); + av_freep(&filename); return 0; } + av_freep(&filename); while (stream_read_line(file, line, sizeof(line), 0)) { char *vst; @@ -224,23 +227,25 @@ static int bd_get_uks(struct bd_priv *bd struct AVAES *a; struct AVSHA *asha; stream_t *file; - char filename[PATH_MAX]; uint8_t discid[20]; char idstr[ID_STR_LEN]; - snprintf(filename, sizeof(filename), BD_UKF_PATH, bd->device); + char *filename = av_asprintf(BD_UKF_PATH, bd->device); file = open_stream(filename, NULL, NULL); if (!file) { mp_msg(MSGT_OPEN, MSGL_ERR, "Cannot open file %s to get UK and DiscID\n", filename); + av_freep(&filename); return 0; } file_size = file->end_pos; if (file_size <= 0 || file_size > 10 * 1024* 1024) { mp_msg(MSGT_OPEN, MSGL_ERR, "File %s too large\n", filename); + av_freep(&filename); free_stream(file); return 0; } + av_freep(&filename); buf = av_malloc(file_size); stream_read(file, buf, file_size); free_stream(file); @@ -432,15 +437,16 @@ static void get_clipinf(struct bd_priv * { int i; int langmap_offset, index_offset, end_offset; - char filename[PATH_MAX]; stream_t *file; - snprintf(filename, sizeof(filename), BD_CLIPINF_PATH, bd->device, bd->title); + char *filename = av_asprintf(BD_CLIPINF_PATH, bd->device, bd->title); file = open_stream(filename, NULL, NULL); if (!file) { mp_msg(MSGT_OPEN, MSGL_ERR, "Cannot open clipinf %s\n", filename); + av_freep(&filename); return; } + av_freep(&filename); if (stream_read_qword(file) != AV_RB64("HDMV0200")) { mp_msg(MSGT_OPEN, MSGL_ERR, "Unknown clipinf format\n"); return; @@ -490,7 +496,7 @@ static int bd_stream_control(stream_t *s static int bd_stream_open(stream_t *s, int mode, void* opts, int* file_format) { - char filename[PATH_MAX]; + char *filename; struct stream_priv_s* p = opts; struct bd_priv *bd = calloc(1, sizeof(*bd)); @@ -527,9 +533,10 @@ static int bd_stream_open(stream_t *s, i // set up AES key from uk av_aes_init(bd->aeseed, bd->uks.keys[0].u8, 128, 0); - snprintf(filename, sizeof(filename), BD_M2TS_PATH, bd->device, bd->title); + filename = av_asprintf(BD_M2TS_PATH, bd->device, bd->title); mp_msg(MSGT_OPEN, MSGL_STATUS, "Opening %s\n", filename); bd->title_file = open_stream(filename, NULL, NULL); + av_freep(&filename); if (!bd->title_file) return STREAM_ERROR; s->end_pos = bd->title_file->end_pos; From subversion at mplayerhq.hu Mon Jan 25 23:02:22 2021 From: subversion at mplayerhq.hu (reimar) Date: Mon, 25 Jan 2021 23:02:22 +0200 (EET) Subject: [MPlayer-cvslog] r38244 - trunk/libvo/aclib.c Message-ID: <20210125210222.2124C6881C7@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Mon Jan 25 23:02:21 2021 New Revision: 38244 Log: aclib.c: Fix conditions when inline asm is disabled. Modified: trunk/libvo/aclib.c Modified: trunk/libvo/aclib.c ============================================================================== --- trunk/libvo/aclib.c Mon Jan 25 21:47:47 2021 (r38243) +++ trunk/libvo/aclib.c Mon Jan 25 23:02:21 2021 (r38244) @@ -41,7 +41,7 @@ //#define COMPILE_C //#endif -#if ARCH_X86 +#if ARCH_X86 && HAVE_INLINE_ASM #if (HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || CONFIG_RUNTIME_CPUDETECT #define COMPILE_MMX @@ -160,7 +160,7 @@ void * fast_memcpy(void * to, const void * from, size_t len) { #if CONFIG_RUNTIME_CPUDETECT -#if ARCH_X86 +#if ARCH_X86 && HAVE_INLINE_ASM // ordered per speed fasterst first if(gCpuCaps.hasSSE2) fast_memcpy_SSE(to, from, len); @@ -174,13 +174,13 @@ void * fast_memcpy(void * to, const void #endif memcpy(to, from, len); // prior to mmx we use the standart memcpy #else -#if HAVE_SSE2 +#if HAVE_SSE2_INLINE fast_memcpy_SSE(to, from, len); -#elif HAVE_MMX2 +#elif HAVE_MMX2_INLINE fast_memcpy_MMX2(to, from, len); -#elif HAVE_AMD3DNOW +#elif HAVE_AMD3DNOW_INLINE fast_memcpy_3DNow(to, from, len); -#elif HAVE_MMX +#elif HAVE_MMX_INLINE fast_memcpy_MMX(to, from, len); #else memcpy(to, from, len); // prior to mmx we use the standart memcpy @@ -194,7 +194,7 @@ void * fast_memcpy(void * to, const void void * mem2agpcpy(void * to, const void * from, size_t len) { #if CONFIG_RUNTIME_CPUDETECT -#if ARCH_X86 +#if ARCH_X86 && HAVE_INLINE_ASM // ordered per speed fasterst first if(gCpuCaps.hasSSE2) mem2agpcpy_SSE(to, from, len); @@ -208,13 +208,13 @@ void * mem2agpcpy(void * to, const void #endif memcpy(to, from, len); // prior to mmx we use the standart memcpy #else -#if HAVE_SSE2 +#if HAVE_SSE2_INLINE mem2agpcpy_SSE(to, from, len); -#elif HAVE_MMX2 +#elif HAVE_MMX2_INLINE mem2agpcpy_MMX2(to, from, len); -#elif HAVE_AMD3DNOW +#elif HAVE_AMD3DNOW_INLINE mem2agpcpy_3DNow(to, from, len); -#elif HAVE_MMX +#elif HAVE_MMX_INLINE mem2agpcpy_MMX(to, from, len); #else memcpy(to, from, len); // prior to mmx we use the standart memcpy From subversion at mplayerhq.hu Mon Jan 25 23:25:40 2021 From: subversion at mplayerhq.hu (reimar) Date: Mon, 25 Jan 2021 23:25:40 +0200 (EET) Subject: [MPlayer-cvslog] r38245 - trunk/libmpcodecs/dec_video.c Message-ID: <20210125212540.42BB5688179@ffbox0-bg.mplayerhq.hu> Author: reimar Date: Mon Jan 25 23:25:40 2021 New Revision: 38245 Log: dec_video.c: check HAVE_INLINE_ASM before using inline asm. Fixes compilation when inline assembler is not actually supported. Modified: trunk/libmpcodecs/dec_video.c Modified: trunk/libmpcodecs/dec_video.c ============================================================================== --- trunk/libmpcodecs/dec_video.c Mon Jan 25 23:02:21 2021 (r38244) +++ trunk/libmpcodecs/dec_video.c Mon Jan 25 23:25:40 2021 (r38245) @@ -434,11 +434,13 @@ void *decode_video(sh_video_t *sh_video, // some codecs are broken, and doesn't restore MMX state :( // it happens usually with broken/damaged files. +#if HAVE_INLINE_ASM if (HAVE_AMD3DNOW_INLINE && gCpuCaps.has3DNow) { __asm__ volatile ("femms\n\t":::"memory"); } else if (HAVE_MMX_INLINE && gCpuCaps.hasMMX) { __asm__ volatile ("emms\n\t":::"memory"); } +#endif t2 = GetTimer(); t = t2 - t; From subversion at mplayerhq.hu Thu Jan 28 13:33:22 2021 From: subversion at mplayerhq.hu (ib) Date: Thu, 28 Jan 2021 13:33:22 +0200 (EET) Subject: [MPlayer-cvslog] r38246 - trunk/gui/util/bitmap.c Message-ID: <20210128113322.A2A9D689F4D@ffbox0-bg.mplayerhq.hu> Author: ib Date: Thu Jan 28 13:33:22 2021 New Revision: 38246 Log: Use new lavc decode API for GUI's PNG decode. Modified: trunk/gui/util/bitmap.c Modified: trunk/gui/util/bitmap.c ============================================================================== --- trunk/gui/util/bitmap.c Mon Jan 25 23:25:40 2021 (r38245) +++ trunk/gui/util/bitmap.c Thu Jan 28 13:33:22 2021 (r38246) @@ -124,8 +124,6 @@ static int pngRead(const char *fname, gu return 6; } - avcodec_register_all(); - if (avcodec_open2(avctx, avcodec_find_decoder(AV_CODEC_ID_PNG), NULL) < 0) { av_free(frame); av_free(avctx); @@ -139,7 +137,8 @@ static int pngRead(const char *fname, gu /* HACK: Make PNGs decode normally instead of as CorePNG delta frames. */ pkt.flags = AV_PKT_FLAG_KEY; - avcodec_decode_video2(avctx, frame, &decode_ok, &pkt); + decode_ok = (avcodec_send_packet(avctx, &pkt) == 0 && + avcodec_receive_frame(avctx, frame) == 0); memset(img, 0, sizeof(*img)); memset(palette, 0, sizeof(palette)); @@ -186,6 +185,8 @@ static int pngRead(const char *fname, gu decode_ok = False; } + avcodec_send_packet(avctx, NULL); // flush the decoder + avcodec_close(avctx); av_free(frame); av_free(avctx); From subversion at mplayerhq.hu Thu Jan 28 13:35:00 2021 From: subversion at mplayerhq.hu (ib) Date: Thu, 28 Jan 2021 13:35:00 +0200 (EET) Subject: [MPlayer-cvslog] r38247 - trunk/gui/dialog/fileselect.c Message-ID: <20210128113500.34876689E84@ffbox0-bg.mplayerhq.hu> Author: ib Date: Thu Jan 28 13:35:00 2021 New Revision: 38247 Log: Make cosmetic changes. Modified: trunk/gui/dialog/fileselect.c Modified: trunk/gui/dialog/fileselect.c ============================================================================== --- trunk/gui/dialog/fileselect.c Thu Jan 28 13:33:22 2021 (r38246) +++ trunk/gui/dialog/fileselect.c Thu Jan 28 13:35:00 2021 (r38247) @@ -52,8 +52,8 @@ #include "help_mp.h" #include "mpcommon.h" #include "mplayer.h" -#include "libavutil/common.h" #include "libavutil/avstring.h" +#include "libavutil/common.h" #include "stream/stream.h" #ifdef __linux__ @@ -169,22 +169,22 @@ GtkStyle *style; GdkPixmap *dpixmap; GdkBitmap *dmask; -static void fs_PersistantHistory(char *subject) +static void fs_PersistantHistory(char *directory) { unsigned int i; char *entry; - if (!subject) + if (!directory) return; for (i = 0; i < FF_ARRAY_ELEMS(fsHistory); i++) - if (gstrcmp(fsHistory[i], subject) == 0) { + if (gstrcmp(fsHistory[i], directory) == 0) { entry = fsHistory[i]; break; } if (i == FF_ARRAY_ELEMS(fsHistory)) { - entry = strdup(subject); + entry = strdup(directory); free(fsHistory[--i]); }