| 107 | } |
| 108 | |
| 109 | void ds_free(DecodeContext *dc) |
| 110 | { |
| 111 | av_dict_free(&dc->decoder_opts); |
| 112 | |
| 113 | av_frame_free(&dc->frame); |
| 114 | av_packet_free(&dc->pkt); |
| 115 | |
| 116 | avcodec_free_context(&dc->decoder); |
| 117 | avformat_close_input(&dc->demuxer); |
| 118 | } |
| 119 | |
| 120 | int ds_open(DecodeContext *dc, const char *url, int stream_idx) |
| 121 | { |