Hi Luca,

On Sat, Mar 28, 2015 at 9:08 PM, Luca Barbato <[email protected]> wrote:
[...]
> nothing is called then, why you did not wire in your read_header?

Here is my current version:
https://github.com/malaterre/libav/blob/dicom-video/libavformat/dicmdec.c#L602

As per documentation, I should:

    /**
     * Read the format header and initialize the AVFormatContext
     * structure. Return 0 if OK. 'avformat_new_stream' should be
     * called to create new streams.
     */
    int (*read_header)(struct AVFormatContext *);

What do you mean by `nothing is called then` ?

BTW, if I use this sample
(http://dicom.netpatia.com/video/MPEG4_720.dcm) with my code, it
segfault here:

[...]
[dicm @ 0x6290a0] MPEG stream start here: 1038 length is: 14417560
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x6290a0] ISO: File Type Major Brand: mp42

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff767ee69 in mov_find_next_sample (s=0x6290a0,
st=0x7fffffffd8d8) at libavformat/mov.c:3336
3336        if (msc->pb && msc->current_sample < avst->nb_index_entries) {
(gdb) bt
#0  0x00007ffff767ee69 in mov_find_next_sample (s=0x6290a0,
st=0x7fffffffd8d8) at libavformat/mov.c:3336
#1  0x00007ffff767f050 in mov_read_packet (s=0x6290a0,
pkt=0x7fffffffd9c0) at libavformat/mov.c:3362
#2  0x00007ffff771b015 in ff_read_packet (s=0x6290a0,
pkt=0x7fffffffd9c0) at libavformat/utils.c:403
#3  0x00007ffff771c789 in read_frame_internal (s=0x6290a0,
pkt=0x7fffffffdbf0) at libavformat/utils.c:886
#4  0x00007ffff771fe67 in avformat_find_stream_info (ic=0x6290a0,
options=0x63b7a0) at libavformat/utils.c:2139
#5  0x000000000040e0c6 in open_input_file (o=0x7fffffffde40,
filename=0x7fffffffe6ee "/tmp/MPEG4_720.dcm") at avconv_opt.c:728
#6  0x0000000000413e52 in open_files (l=0x629898, inout=0x4224f7
"input", open_file=0x40dbce <open_input_file>) at avconv_opt.c:2133
#7  0x0000000000413fbd in avconv_parse_options (argc=9,
argv=0x7fffffffe348) at avconv_opt.c:2170
#8  0x000000000041ef2f in main (argc=9, argv=0x7fffffffe348) at avconv.c:2660
(gdb) p msc
$1 = (MOVStreamContext *) 0x0


Thanks again for your help,
-- 
Mathieu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to