Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
ffmpeg-doc / usr / share / doc / ffmpeg-doc / api / resampling_audio_8c-example.html
Size: Mime:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>FFmpeg: resampling_audio.c</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">FFmpeg
   &#160;<span id="projectnumber">2.7.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">resampling_audio.c</div>  </div>
</div><!--header-->
<div class="contents">
<p>libswresample API use example.</p>
<div class="fragment"><pre class="fragment"><span class="comment">/*</span>
<span class="comment"> * Copyright (c) 2012 Stefano Sabatini</span>
<span class="comment"> *</span>
<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a copy</span>
<span class="comment"> * of this software and associated documentation files (the &quot;Software&quot;), to deal</span>
<span class="comment"> * in the Software without restriction, including without limitation the rights</span>
<span class="comment"> * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
<span class="comment"> * copies of the Software, and to permit persons to whom the Software is</span>
<span class="comment"> * furnished to do so, subject to the following conditions:</span>
<span class="comment"> *</span>
<span class="comment"> * The above copyright notice and this permission notice shall be included in</span>
<span class="comment"> * all copies or substantial portions of the Software.</span>
<span class="comment"> *</span>
<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
<span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL</span>
<span class="comment"> * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
<span class="comment"> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span>
<span class="comment"> * THE SOFTWARE.</span>
<span class="comment"> */</span>
<span class="comment"></span>
<span class="comment">/**</span>
<span class="comment"> * @example resampling_audio.c</span>
<span class="comment"> * libswresample API use example.</span>
<span class="comment"> */</span>

<span class="preprocessor">#include &lt;<a class="code" href="opt_8h.html" title="AVOptions.">libavutil/opt.h</a>&gt;</span>
<span class="preprocessor">#include &lt;<a class="code" href="channel__layout_8h.html" title="audio channel layout utility functions">libavutil/channel_layout.h</a>&gt;</span>
<span class="preprocessor">#include &lt;<a class="code" href="samplefmt_8h.html">libavutil/samplefmt.h</a>&gt;</span>
<span class="preprocessor">#include &lt;<a class="code" href="swresample_8h.html" title="libswresample public header">libswresample/swresample.h</a>&gt;</span>

<span class="keyword">static</span> <span class="keywordtype">int</span> <a name="a0"></a><a class="code" href="demuxing__decoding_8c.html#a5e068fc5e6dc5c59638ec235f7f6db89">get_format_from_sample_fmt</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> **fmt,
                                      <span class="keyword">enum</span> <a class="code" href="group__lavu__sampfmts.html#gaf9a51ca15301871723577c730b5865c5" title="Audio sample formats.">AVSampleFormat</a> sample_fmt)
{
    <span class="keywordtype">int</span> i;
    <span class="keyword">struct </span>sample_fmt_entry {
        <span class="keyword">enum</span> <a class="code" href="group__lavu__sampfmts.html#gaf9a51ca15301871723577c730b5865c5" title="Audio sample formats.">AVSampleFormat</a> sample_fmt; <span class="keyword">const</span> <span class="keywordtype">char</span> *fmt_be, *fmt_le;
    } sample_fmt_entries[] = {
        { <a name="a1"></a><a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5adf0f66f21492f8fd5db6debb8b3f932a" title="unsigned 8 bits">AV_SAMPLE_FMT_U8</a>,  <span class="stringliteral">&quot;u8&quot;</span>,    <span class="stringliteral">&quot;u8&quot;</span>    },
        { <a name="a2"></a><a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5aea6132df57aebc3f76e10665395c46af" title="signed 16 bits">AV_SAMPLE_FMT_S16</a>, <span class="stringliteral">&quot;s16be&quot;</span>, <span class="stringliteral">&quot;s16le&quot;</span> },
        { <a name="a3"></a><a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5ab7ae6bb6718c07cd316778783a57a63b" title="signed 32 bits">AV_SAMPLE_FMT_S32</a>, <span class="stringliteral">&quot;s32be&quot;</span>, <span class="stringliteral">&quot;s32le&quot;</span> },
        { <a name="a4"></a><a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5a5251d62cc3c7f18e56bc8e0c48a27903" title="float">AV_SAMPLE_FMT_FLT</a>, <span class="stringliteral">&quot;f32be&quot;</span>, <span class="stringliteral">&quot;f32le&quot;</span> },
        { <a name="a5"></a><a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5ae35a2a6a7593723d9fe4bcefb2876606" title="double">AV_SAMPLE_FMT_DBL</a>, <span class="stringliteral">&quot;f64be&quot;</span>, <span class="stringliteral">&quot;f64le&quot;</span> },
    };
    *fmt = NULL;

    <span class="keywordflow">for</span> (i = 0; i &lt; <a name="a6"></a><a class="code" href="common_8h.html#a3508a98d3ee7e2c9a4841fe264cf70f7">FF_ARRAY_ELEMS</a>(sample_fmt_entries); i++) {
        <span class="keyword">struct </span>sample_fmt_entry *entry = &amp;sample_fmt_entries[i];
        <span class="keywordflow">if</span> (sample_fmt == entry-&gt;sample_fmt) {
            *fmt = <a name="a7"></a><a class="code" href="common_8h.html#a309bdca20f6a78431379fc69442d98ea">AV_NE</a>(entry-&gt;fmt_be, entry-&gt;fmt_le);
            <span class="keywordflow">return</span> 0;
        }
    }

    fprintf(stderr,
            <span class="stringliteral">&quot;Sample format %s not supported as output format\n&quot;</span>,
            <a name="a8"></a><a class="code" href="group__lavu__sampfmts.html#ga31b9d149b2de9821a65f4f5612970838" title="Return the name of sample_fmt, or NULL if sample_fmt is not recognized.">av_get_sample_fmt_name</a>(sample_fmt));
    <span class="keywordflow">return</span> <a name="a9"></a><a class="code" href="group__lavu__error.html#gae4bb6f165973d09584e0ec0f335f69ca">AVERROR</a>(EINVAL);
}
<span class="comment"></span>
<span class="comment">/**</span>
<span class="comment"> * Fill dst buffer with nb_samples, generated starting from t.</span>
<span class="comment"> */</span>
<span class="keyword">static</span> <span class="keywordtype">void</span> <a name="a10"></a><a class="code" href="resampling__audio_8c.html#af40a34d598e4ae80bc0539e9f5761c5f" title="Fill dst buffer with nb_samples, generated starting from t.">fill_samples</a>(<span class="keywordtype">double</span> *dst, <span class="keywordtype">int</span> nb_samples, <span class="keywordtype">int</span> nb_channels, <span class="keywordtype">int</span> sample_rate, <span class="keywordtype">double</span> *t)
{
    <span class="keywordtype">int</span> i, j;
    <span class="keywordtype">double</span> tincr = 1.0 / sample_rate, *dstp = dst;
    <span class="keyword">const</span> <span class="keywordtype">double</span> c = 2 * M_PI * 440.0;

    <span class="comment">/* generate sin tone with 440Hz frequency and duplicated channels */</span>
    <span class="keywordflow">for</span> (i = 0; i &lt; nb_samples; i++) {
        *dstp = sin(c * *t);
        <span class="keywordflow">for</span> (j = 1; j &lt; nb_channels; j++)
            dstp[j] = dstp[0];
        dstp += nb_channels;
        *t += tincr;
    }
}

<span class="keywordtype">int</span> <a name="a11"></a><a class="code" href="avio__list__dir_8c.html#a0ddf1224851353fc92bfbff6f499fa97">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)
{
    int64_t src_ch_layout = <a name="a12"></a><a class="code" href="group__channel__mask__c.html#gabc6d6651bba254cd0fa2c42a57228e65">AV_CH_LAYOUT_STEREO</a>, dst_ch_layout = <a name="a13"></a><a class="code" href="group__channel__mask__c.html#ga625aec7f2285dc35e3ed801e91889564">AV_CH_LAYOUT_SURROUND</a>;
    <span class="keywordtype">int</span> src_rate = 48000, dst_rate = 44100;
    uint8_t **src_data = NULL, **dst_data = NULL;
    <span class="keywordtype">int</span> src_nb_channels = 0, dst_nb_channels = 0;
    <span class="keywordtype">int</span> src_linesize, dst_linesize;
    <span class="keywordtype">int</span> src_nb_samples = 1024, dst_nb_samples, max_dst_nb_samples;
    <span class="keyword">enum</span> <a class="code" href="group__lavu__sampfmts.html#gaf9a51ca15301871723577c730b5865c5" title="Audio sample formats.">AVSampleFormat</a> src_sample_fmt = <a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5ae35a2a6a7593723d9fe4bcefb2876606" title="double">AV_SAMPLE_FMT_DBL</a>, dst_sample_fmt = <a class="code" href="group__lavu__sampfmts.html#ggaf9a51ca15301871723577c730b5865c5aea6132df57aebc3f76e10665395c46af" title="signed 16 bits">AV_SAMPLE_FMT_S16</a>;
    <span class="keyword">const</span> <span class="keywordtype">char</span> *dst_filename = NULL;
    FILE *dst_file;
    <span class="keywordtype">int</span> dst_bufsize;
    <span class="keyword">const</span> <span class="keywordtype">char</span> *fmt;
    <span class="keyword">struct </span><a class="code" href="group__lswr.html#ga4aa775b7fba31d2c8dc14c7b7e282863" title="The libswresample context.">SwrContext</a> *swr_ctx;
    <span class="keywordtype">double</span> t;
    <span class="keywordtype">int</span> ret;

    <span class="keywordflow">if</span> (argc != 2) {
        fprintf(stderr, <span class="stringliteral">&quot;Usage: %s output_file\n&quot;</span>
                <span class="stringliteral">&quot;API example program to show how to resample an audio stream with libswresample.\n&quot;</span>
                <span class="stringliteral">&quot;This program generates a series of audio frames, resamples them to a specified &quot;</span>
                <span class="stringliteral">&quot;output format and rate and saves them to an output file named output_file.\n&quot;</span>,
            argv[0]);
        exit(1);
    }
    dst_filename = argv[1];

    dst_file = fopen(dst_filename, <span class="stringliteral">&quot;wb&quot;</span>);
    <span class="keywordflow">if</span> (!dst_file) {
        fprintf(stderr, <span class="stringliteral">&quot;Could not open destination file %s\n&quot;</span>, dst_filename);
        exit(1);
    }

    <span class="comment">/* create resampler context */</span>
    swr_ctx = <a name="a14"></a><a class="code" href="group__lswr.html#gaf58c4ff10f73d74bdab8e5aa7193147c" title="Allocate SwrContext.">swr_alloc</a>();
    <span class="keywordflow">if</span> (!swr_ctx) {
        fprintf(stderr, <span class="stringliteral">&quot;Could not allocate resampler context\n&quot;</span>);
        ret = <a class="code" href="group__lavu__error.html#gae4bb6f165973d09584e0ec0f335f69ca">AVERROR</a>(ENOMEM);
        <span class="keywordflow">goto</span> end;
    }

    <span class="comment">/* set options */</span>
    <a name="a15"></a><a class="code" href="group__opt__set__funcs.html#ga3adf7185c21cc080890a5ec02c2e56b2">av_opt_set_int</a>(swr_ctx, <span class="stringliteral">&quot;in_channel_layout&quot;</span>,    src_ch_layout, 0);
    <a class="code" href="group__opt__set__funcs.html#ga3adf7185c21cc080890a5ec02c2e56b2">av_opt_set_int</a>(swr_ctx, <span class="stringliteral">&quot;in_sample_rate&quot;</span>,       src_rate, 0);
    <a name="a16"></a><a class="code" href="group__opt__set__funcs.html#gad446f7a7b92442e464d43e400e661040">av_opt_set_sample_fmt</a>(swr_ctx, <span class="stringliteral">&quot;in_sample_fmt&quot;</span>, src_sample_fmt, 0);

    <a class="code" href="group__opt__set__funcs.html#ga3adf7185c21cc080890a5ec02c2e56b2">av_opt_set_int</a>(swr_ctx, <span class="stringliteral">&quot;out_channel_layout&quot;</span>,    dst_ch_layout, 0);
    <a class="code" href="group__opt__set__funcs.html#ga3adf7185c21cc080890a5ec02c2e56b2">av_opt_set_int</a>(swr_ctx, <span class="stringliteral">&quot;out_sample_rate&quot;</span>,       dst_rate, 0);
    <a class="code" href="group__opt__set__funcs.html#gad446f7a7b92442e464d43e400e661040">av_opt_set_sample_fmt</a>(swr_ctx, <span class="stringliteral">&quot;out_sample_fmt&quot;</span>, dst_sample_fmt, 0);

    <span class="comment">/* initialize the resampling context */</span>
    <span class="keywordflow">if</span> ((ret = <a name="a17"></a><a class="code" href="group__lswr.html#gae173e8ed91717700471a1dcd06f00f67" title="Initialize context after user parameters have been set.">swr_init</a>(swr_ctx)) &lt; 0) {
        fprintf(stderr, <span class="stringliteral">&quot;Failed to initialize the resampling context\n&quot;</span>);
        <span class="keywordflow">goto</span> end;
    }

    <span class="comment">/* allocate source and destination samples buffers */</span>

    src_nb_channels = <a name="a18"></a><a class="code" href="group__channel__mask__c.html#gac95619abeb32e4a3daa18e3ff3419380" title="Return the number of channels in the channel layout.">av_get_channel_layout_nb_channels</a>(src_ch_layout);
    ret = <a name="a19"></a><a class="code" href="group__lavu__sampmanip.html#gae8b9f22f2f659d023f111390d9545273" title="Allocate a data pointers array, samples buffer for nb_samples samples, and fill data pointers and lin...">av_samples_alloc_array_and_samples</a>(&amp;src_data, &amp;src_linesize, src_nb_channels,
                                             src_nb_samples, src_sample_fmt, 0);
    <span class="keywordflow">if</span> (ret &lt; 0) {
        fprintf(stderr, <span class="stringliteral">&quot;Could not allocate source samples\n&quot;</span>);
        <span class="keywordflow">goto</span> end;
    }

    <span class="comment">/* compute the number of converted samples: buffering is avoided</span>
<span class="comment">     * ensuring that the output buffer will contain at least all the</span>
<span class="comment">     * converted input samples */</span>
    max_dst_nb_samples = dst_nb_samples =
        <a name="a20"></a><a class="code" href="group__lavu__math.html#gad686ab94939ed4c65218309e94bdca72" title="Rescale a 64-bit integer with specified rounding.">av_rescale_rnd</a>(src_nb_samples, dst_rate, src_rate, <a name="a21"></a><a class="code" href="group__lavu__math.html#gga921d656eaf2c4d6800a734a13af021d0aa1d28e08e2f8b49b256e056f93038c1a" title="Round toward +infinity.">AV_ROUND_UP</a>);

    <span class="comment">/* buffer is going to be directly written to a rawaudio file, no alignment */</span>
    dst_nb_channels = <a class="code" href="group__channel__mask__c.html#gac95619abeb32e4a3daa18e3ff3419380" title="Return the number of channels in the channel layout.">av_get_channel_layout_nb_channels</a>(dst_ch_layout);
    ret = <a class="code" href="group__lavu__sampmanip.html#gae8b9f22f2f659d023f111390d9545273" title="Allocate a data pointers array, samples buffer for nb_samples samples, and fill data pointers and lin...">av_samples_alloc_array_and_samples</a>(&amp;dst_data, &amp;dst_linesize, dst_nb_channels,
                                             dst_nb_samples, dst_sample_fmt, 0);
    <span class="keywordflow">if</span> (ret &lt; 0) {
        fprintf(stderr, <span class="stringliteral">&quot;Could not allocate destination samples\n&quot;</span>);
        <span class="keywordflow">goto</span> end;
    }

    t = 0;
    <span class="keywordflow">do</span> {
        <span class="comment">/* generate synthetic audio */</span>
        <a class="code" href="resampling__audio_8c.html#af40a34d598e4ae80bc0539e9f5761c5f" title="Fill dst buffer with nb_samples, generated starting from t.">fill_samples</a>((<span class="keywordtype">double</span> *)src_data[0], src_nb_samples, src_nb_channels, src_rate, &amp;t);

        <span class="comment">/* compute destination number of samples */</span>
        dst_nb_samples = <a class="code" href="group__lavu__math.html#gad686ab94939ed4c65218309e94bdca72" title="Rescale a 64-bit integer with specified rounding.">av_rescale_rnd</a>(<a name="a22"></a><a class="code" href="group__lswr.html#ga5121a5a7890a2d23b72dc871dd0ebb06" title="Gets the delay the next input sample will experience relative to the next output sample.">swr_get_delay</a>(swr_ctx, src_rate) +
                                        src_nb_samples, dst_rate, src_rate, <a class="code" href="group__lavu__math.html#gga921d656eaf2c4d6800a734a13af021d0aa1d28e08e2f8b49b256e056f93038c1a" title="Round toward +infinity.">AV_ROUND_UP</a>);
        <span class="keywordflow">if</span> (dst_nb_samples &gt; max_dst_nb_samples) {
            <a name="a23"></a><a class="code" href="group__lavu__mem.html#ga0cc84043ea2167ad005c86e11d0bcdba" title="Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...">av_freep</a>(&amp;dst_data[0]);
            ret = <a name="a24"></a><a class="code" href="group__lavu__sampmanip.html#ga4db4c77f928d32c7d8854732f50b8c04" title="Allocate a samples buffer for nb_samples samples, and fill data pointers and linesize accordingly...">av_samples_alloc</a>(dst_data, &amp;dst_linesize, dst_nb_channels,
                                   dst_nb_samples, dst_sample_fmt, 1);
            <span class="keywordflow">if</span> (ret &lt; 0)
                <span class="keywordflow">break</span>;
            max_dst_nb_samples = dst_nb_samples;
        }

        <span class="comment">/* convert to destination format */</span>
        ret = <a name="a25"></a><a class="code" href="group__lswr.html#gaa5bb6cab830146efa8c760fa66ee582a" title="Convert audio.">swr_convert</a>(swr_ctx, dst_data, dst_nb_samples, (<span class="keyword">const</span> uint8_t **)src_data, src_nb_samples);
        <span class="keywordflow">if</span> (ret &lt; 0) {
            fprintf(stderr, <span class="stringliteral">&quot;Error while converting\n&quot;</span>);
            <span class="keywordflow">goto</span> end;
        }
        dst_bufsize = <a name="a26"></a><a class="code" href="group__lavu__sampfmts.html#gaa7368bc4e3a366b688e81938ed55eb06" title="Get the required buffer size for the given audio parameters.">av_samples_get_buffer_size</a>(&amp;dst_linesize, dst_nb_channels,
                                                 ret, dst_sample_fmt, 1);
        <span class="keywordflow">if</span> (dst_bufsize &lt; 0) {
            fprintf(stderr, <span class="stringliteral">&quot;Could not get sample buffer size\n&quot;</span>);
            <span class="keywordflow">goto</span> end;
        }
        printf(<span class="stringliteral">&quot;t:%f in:%d out:%d\n&quot;</span>, t, src_nb_samples, ret);
        fwrite(dst_data[0], 1, dst_bufsize, dst_file);
    } <span class="keywordflow">while</span> (t &lt; 10);

    <span class="keywordflow">if</span> ((ret = <a class="code" href="demuxing__decoding_8c.html#a5e068fc5e6dc5c59638ec235f7f6db89">get_format_from_sample_fmt</a>(&amp;fmt, dst_sample_fmt)) &lt; 0)
        <span class="keywordflow">goto</span> end;
    fprintf(stderr, <span class="stringliteral">&quot;Resampling succeeded. Play the output file with the command:\n&quot;</span>
            <span class="stringliteral">&quot;ffplay -f %s -channel_layout %&quot;</span>PRId64<span class="stringliteral">&quot; -channels %d -ar %d %s\n&quot;</span>,
            fmt, dst_ch_layout, dst_nb_channels, dst_rate, dst_filename);

end:
    fclose(dst_file);

    <span class="keywordflow">if</span> (src_data)
        <a class="code" href="group__lavu__mem.html#ga0cc84043ea2167ad005c86e11d0bcdba" title="Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...">av_freep</a>(&amp;src_data[0]);
    <a class="code" href="group__lavu__mem.html#ga0cc84043ea2167ad005c86e11d0bcdba" title="Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...">av_freep</a>(&amp;src_data);

    <span class="keywordflow">if</span> (dst_data)
        <a class="code" href="group__lavu__mem.html#ga0cc84043ea2167ad005c86e11d0bcdba" title="Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...">av_freep</a>(&amp;dst_data[0]);
    <a class="code" href="group__lavu__mem.html#ga0cc84043ea2167ad005c86e11d0bcdba" title="Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...">av_freep</a>(&amp;dst_data);

    <a name="a27"></a><a class="code" href="group__lswr.html#ga818f7d78b1ad7d8d5b70de374b668c34" title="Free the given SwrContext and set the pointer to NULL.">swr_free</a>(&amp;swr_ctx);
    <span class="keywordflow">return</span> ret &lt; 0;
}
</pre></div> </div><!-- contents -->
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>