On 06/10/2011 04:13 PM, Anton Khirnov wrote:

> @@ -3597,28 +3602,26 @@ static void extract_mpeg4_header(AVFormatContext 
> *infile)
>  static void build_file_streams(void)
>  {
>      FFStream *stream, *stream_next;
> -    AVFormatContext *infile;
>      int i, ret;
>  
>      /* gather all streams */
>      for(stream = first_stream; stream != NULL; stream = stream_next) {
> +        AVFormatContext *infile = NULL;
>          stream_next = stream->next;
>          if (stream->stream_type == STREAM_TYPE_LIVE &&
>              !stream->feed) {
>              /* the stream comes from a file */
>              /* try to open the file */
>              /* open stream */
> -            stream->ap_in = av_mallocz(sizeof(AVFormatParameters));
>              if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
>                  /* specific case : if transport stream output to RTP,
>                     we use a raw transport stream reader */
> -                stream->ap_in->mpeg2ts_raw = 1;
> -                stream->ap_in->mpeg2ts_compute_pcr = 1;
> +                av_dict_set(&stream->in_opts, "mpeg2ts_compute_pcr", "1", 0);
>              }
> +            infile->iformat = stream->ifmt;
>  
>              http_log("Opening file '%s'\n", stream->feed_filename);
> -            if ((ret = av_open_input_file(&infile, stream->feed_filename,
> -                                          stream->ifmt, 0, stream->ap_in)) < 
> 0) {
> +            if ((ret = avformat_open_input(&infile, stream->feed_filename, 
> stream->in_opts, NULL)) < 0) {
>                  http_log("Could not open '%s': %d\n", stream->feed_filename, 
> ret);
>                  /* remove stream (no need to spend more time on it) */
>              fail:


I think this would segfault. infile is still NULL when infile->iformat
is accessed.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to