comparison libmpdemux/muxer_lavf.c @ 23602:a7dc7b4c1401

pstrcpy -> av_strlcpy
author reimar
date Sun, 24 Jun 2007 08:39:40 +0000
parents ab8f2f9afd51
children c4c4712cebae
comparison
equal deleted inserted replaced
23601:0f1c9cf1752d 23602:a7dc7b4c1401
20 #ifdef USE_LIBAVFORMAT_SO 20 #ifdef USE_LIBAVFORMAT_SO
21 #include <ffmpeg/avformat.h> 21 #include <ffmpeg/avformat.h>
22 #else 22 #else
23 #include "avformat.h" 23 #include "avformat.h"
24 #endif 24 #endif
25 #include "libavutil/avstring.h"
25 26
26 extern const struct AVCodecTag *mp_wav_taglists[]; 27 extern const struct AVCodecTag *mp_wav_taglists[];
27 extern const struct AVCodecTag *mp_bmp_taglists[]; 28 extern const struct AVCodecTag *mp_bmp_taglists[];
28 29
29 extern char *info_name; 30 extern char *info_name;
31 extern char *info_genre; 32 extern char *info_genre;
32 extern char *info_subject; 33 extern char *info_subject;
33 extern char *info_copyright; 34 extern char *info_copyright;
34 extern char *info_sourceform; 35 extern char *info_sourceform;
35 extern char *info_comment; 36 extern char *info_comment;
36
37 void pstrcpy(char *buf, int buf_size, const char *str);
38 37
39 typedef struct { 38 typedef struct {
40 //AVInputFormat *avif; 39 //AVInputFormat *avif;
41 AVFormatContext *oc; 40 AVFormatContext *oc;
42 ByteIOContext pb; 41 ByteIOContext pb;
394 priv->oc->packet_size= mux_packet_size; 393 priv->oc->packet_size= mux_packet_size;
395 priv->oc->mux_rate= mux_rate; 394 priv->oc->mux_rate= mux_rate;
396 priv->oc->preload= (int)(mux_preload*AV_TIME_BASE); 395 priv->oc->preload= (int)(mux_preload*AV_TIME_BASE);
397 priv->oc->max_delay= (int)(mux_max_delay*AV_TIME_BASE); 396 priv->oc->max_delay= (int)(mux_max_delay*AV_TIME_BASE);
398 if (info_name) 397 if (info_name)
399 pstrcpy(priv->oc->title , sizeof(priv->oc->title ), info_name ); 398 av_strlcpy(priv->oc->title , info_name, sizeof(priv->oc->title ));
400 if (info_artist) 399 if (info_artist)
401 pstrcpy(priv->oc->author , sizeof(priv->oc->author ), info_artist ); 400 av_strlcpy(priv->oc->author , info_artist, sizeof(priv->oc->author ));
402 if (info_genre) 401 if (info_genre)
403 pstrcpy(priv->oc->genre , sizeof(priv->oc->genre ), info_genre ); 402 av_strlcpy(priv->oc->genre , info_genre, sizeof(priv->oc->genre ));
404 if (info_copyright) 403 if (info_copyright)
405 pstrcpy(priv->oc->copyright, sizeof(priv->oc->copyright), info_copyright); 404 av_strlcpy(priv->oc->copyright, info_copyright, sizeof(priv->oc->copyright));
406 if (info_comment) 405 if (info_comment)
407 pstrcpy(priv->oc->comment , sizeof(priv->oc->comment ), info_comment ); 406 av_strlcpy(priv->oc->comment , info_comment, sizeof(priv->oc->comment ));
408 register_protocol(&mp_protocol); 407 register_protocol(&mp_protocol);
409 408
410 if(url_fopen(&priv->oc->pb, mp_filename, URL_WRONLY)) 409 if(url_fopen(&priv->oc->pb, mp_filename, URL_WRONLY))
411 { 410 {
412 mp_msg(MSGT_MUXER, MSGL_FATAL, "Coulnd't open outfile\n"); 411 mp_msg(MSGT_MUXER, MSGL_FATAL, "Coulnd't open outfile\n");